Method: Lab419::Config::Parser#parse
- Defined in:
- lib/lab419/config/parser.rb
#parse(params = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lab419/config/parser.rb', line 10 def parse params={} check_source_setup @params = params @parsed = true loop do @source.next while @source.current && @source.current =~ comment return self if @source.eos? key, value = @source.current.split separator_rgx, 2 raise SyntaxError, "No = found in line \"#{key}\"" unless value @config[key.strip] = parse_value value, params @source.next end end |