Last active
December 18, 2015 12:29
-
-
Save fletcherm/5783620 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SystemConfiguration.stub_chain(:youtube, :playlist, :id) { '1234' } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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