Method: SimpleConfig#parse
- Defined in:
- lib/utils/simpleconfig.rb
#parse(raw_data, opts = nil) ⇒ Object
Parse some data quotes: quoting characters, which are parsed, so everything inside it will be part of a string multiline: allow quoted text to span multiple lines comment_char: char which identifies comments standalone_comments: comments must appear alone in a line; if set to true, no comments can be added to the end of an assignment/statement line
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/utils/simpleconfig.rb', line 24 def parse(raw_data, opts = nil) @params = {} @groups = [] @vals = @params = .merge(opts || {}) return if raw_data.nil? # prepare raw data if required if ![:line_separator].nil? raw_data = raw_data.tr([:line_separator], "\n") end rest = raw_data rest = parse_rest(rest, ) while rest.length > 0 end |