Ruby/Yaml failo nuskaitymas

Iš Wikibooks.
Jump to navigation Jump to search

settings.yaml failas:

user: test
pass: test

something.rb failas:

require 'yaml'
settings = YAML::load_file('settings.yaml')