Skip to content

Instantly share code, notes, and snippets.

@fletcherm
Last active December 18, 2015 12:29
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 fletcherm/5783620 to your computer and use it in GitHub Desktop.
Save fletcherm/5783620 to your computer and use it in GitHub Desktop.
def self.playlist_id
SystemConfiguration.youtube.playlist.id
end
# or
config.api_key = SystemConfiguration.airbrake.api_key
# or
GOOGLE_ANALYTICS_TRACKING_ID = SystemConfiguration.google_analytics.tracking_id
SystemConfiguration.stub_chain(:youtube, :playlist, :id) { '1234' }
require 'fedora/connection'
config_file = Rails.root.join('config', 'fedora.yml').to_s
if not File.exist?(config_file)
raise "You need a config/fedora.yml file. Try starting with config/fedora.example.yml if you need a sample to start from."
end
configuration = HashWithIndifferentAccess.new(YAML.load_file(config_file))[Rails.env]
Fedora.connect!(configuration)
class SystemConfiguration < Settingslogic
source "#{Rails.root}/config/system_config.yml"
namespace Rails.env
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment