Skip to content

Instantly share code, notes, and snippets.

@stevenringo
Forked from justinweiss/settings.rb
Created May 28, 2014 12:33
Show Gist options
  • Save stevenringo/6398ffc421cd2b5c38b9 to your computer and use it in GitHub Desktop.
Save stevenringo/6398ffc421cd2b5c38b9 to your computer and use it in GitHub Desktop.
require 'yaml'
require 'erb'
require 'ostruct'
class Settings < OpenStruct
# Settings.new(:google_analytics)
def initialize(config_file_base_name)
super(YAML.load(ERB.new(File.read(Rails.root.join("config", "#{config_file_base_name}.yml"))).result)[Rails.env])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment