Skip to content

Instantly share code, notes, and snippets.

@chsh
Created November 9, 2013 05:33
Show Gist options
  • Save chsh/7382106 to your computer and use it in GitHub Desktop.
Save chsh/7382106 to your computer and use it in GitHub Desktop.
Read multiple setting files in Settingslogic.
class Settings < Settingslogic
# load default app
cf = File.join(Rails.root, 'config', 'settings', 'application.yml')
source cf if File.exist? cf
cf = File.join(Rails.root, 'config', 'settings', "#{Rails.env}.yml")
instance.deep_merge! Settings.new(cf) if File.exist? cf
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment