class Fastly

def self.load_config(file)


Skips whitespace and lines starting with C<#>.

From a file.

=

Attempts to load various config options in the form
#
def self.load_config(file)
  options = {}
  return options unless File.exist?(file)
  File.open(file, 'r') do |infile|
    while line = infile.gets
      line.chomp!
      next if line =~ /^#/
      next if line =~ /^\s*$/
      next unless line =~ /=/
      line.strip!
      key, val = line.split(/\s*=\s*/, 2)
      options[key.to_sym] = val
    end
  end
  options
end