Skip to content

Instantly share code, notes, and snippets.

@shadoi
Created June 8, 2012 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shadoi/4d61554d69261d1759e3 to your computer and use it in GitHub Desktop.
Save shadoi/4d61554d69261d1759e3 to your computer and use it in GitHub Desktop.
conf_ini.each_line do |line|
line.chomp!
next if line =~ /^#/
next unless line =~ /\w+=\w+/
key, val = line.split('=')
if self.send(key.to_sym).is_a?(Array)
if val =~ /,\s*/
val = val.split(%r{,\s*}
else
val = Array(val)
end
end
site_conf[key] = val
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment