Parent

Methods

Console::ConfigFile

Public Class Methods

new(file) click to toggle source
# File lib/console/config_file.rb, line 3
def initialize(file)
  IO.read(File.expand_path(file)).lines.
    map{ |s| s.gsub(/((^|[^\\])(\\\\)*)#.*/,'\1') }. # eliminate unescaped comments
    each do |s|
      if pair = /^\s*(.*?[^\\]+?(?:\\\\)*)=(.*)$/.match(s)
        self[pair[1].strip.gsub(/\\(.)/,'\1')] = pair[2].strip.gsub(/\\(.)/,'\1')
      end
    end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.