Class: WorkOn::ConfigParser

Inherits:
Object
  • Object
show all
Defined in:
lib/work_on/config.rb

Direct Known Subclasses

YAMLConfig

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ ConfigParser

Returns a new instance of ConfigParser.



63
64
65
66
# File 'lib/work_on/config.rb', line 63

def initialize(file_name)
  @windows = {}
  parse(file_name)
end

Instance Attribute Details

#project_dirObject

should be set to the complete and expanded path to the project



61
62
63
# File 'lib/work_on/config.rb', line 61

def project_dir
  @project_dir
end

#windowsObject

windows is an hash which looks like this => [[‘ls -al’, ‘ls’], [‘ls’]] the above hash would open 2 tabs

if additional windows need to be opened you can specify the windows key (and provide and array of tab

hashes)

=> {[{:tabs => [], =>[]]}}



58
59
60
# File 'lib/work_on/config.rb', line 58

def windows
  @windows
end

Instance Method Details

#parse(file_name) ⇒ Object

this method should read and parse the file will be called when initialized implementations should set @windows and @project_dir



76
77
78
# File 'lib/work_on/config.rb', line 76

def parse(file_name)
  not_implemented
end