Sha256: 5a83ac3de665dc27075bf68ce64169779e3f54424c56959dd937cf8a9239fe05
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
config_yml = "#{Rails.root}/config/astrochimp.yml" config_example_yml = File.expand_path '../../astrochimp.example.yml', __FILE__ # Copy example config if there is not already one present FileUtils.cp config_example_yml, config_yml if !File.exists?(config_yml) # Load the current environmnts astrochimp configuration config = YAML.load(File.read(config_yml))[Rails.env] # Set environment variables based on config (not overiding already set ENVs) config.each do |key, value| key = 'AC_' + key.upcase ENV[key] = value.to_s if !value.kind_of?(Hash) && ENV[key].blank? end #if File.basename($0) != 'rake' #unless ActiveRecord::Base.connection.table_exists?('astrochimp_signups') #raise "\n\nThe Chimp wants you to run rake db:migrate\n\n" #end #if ENV['AC_MAILCHIMP_API_KEY'].blank? || ENV['AC_MAILCHIMP_LIST_ID'].blank? #raise "\n\nThe Chimp wants you to set the ENV variables: AC_MAILCHIMP_API_KEY and AC_MAILCHIMP_LIST_ID.\n" << #"You can also set them in astrochimp.yml if you're an ape.\n\n" #end #end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
astrochimp-0.1.3 | config/initializers/settings.rb |
astrochimp-0.1.2 | config/initializers/settings.rb |