Module: Config
- Defined in:
- lib/config.rb
Class Method Summary collapse
- .config ⇒ Object
-
.using(path_to_yaml_file) ⇒ Object
Configure through yaml file.
Class Method Details
.config ⇒ Object
28 29 30 |
# File 'lib/config.rb', line 28 def self.config @config end |
.using(path_to_yaml_file) ⇒ Object
Configure through yaml file
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/config.rb', line 14 def self.using(path_to_yaml_file) begin config = YAML::load(IO.read(path_to_yaml_file)) rescue Errno::ENOENT puts(:warning, "YAML configuration file couldn't be found. Using defaults."); return # log(:warning, "YAML configuration file couldn't be found. Using defaults."); return rescue Psych::SyntaxError puts(:warning, "YAML configuration file contains invalid syntax. Using defaults."); return # log(:warning, "YAML configuration file contains invalid syntax. Using defaults."); return end configure(config) end |