Class: WorkOn::YAMLConfig
- Inherits:
-
ConfigParser
- Object
- ConfigParser
- WorkOn::YAMLConfig
- Defined in:
- lib/work_on/config.rb
Instance Attribute Summary
Attributes inherited from ConfigParser
Instance Method Summary collapse
Methods inherited from ConfigParser
Constructor Details
This class inherits a constructor from WorkOn::ConfigParser
Instance Method Details
#parse(file_name) ⇒ Object
82 83 84 85 86 87 88 89 90 |
# File 'lib/work_on/config.rb', line 82 def parse(file_name) hash = YAML.load_file(file_name) self.project_dir = hash['project-dir'] windows = hash.select {|k,v| /window/ === k} tabs = hash.select {|k,v| /tab/ === k} self.windows[:tabs] = tabs.values self.windows[:windows] = windows.values.map {|hash| {:tabs => hash.values}} end |