Sha256: afc8f07ed175d5fb3741378e74df83752751cbf679c1195fb96304a30d8b0a45

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 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

ActionMailer::Base.default_url_options[:host] ||= ENV['AC_HOST']

#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

6 entries across 6 versions & 1 rubygems

Version Path
astrochimp-0.2.5 config/initializers/settings.rb
astrochimp-0.2.4 config/initializers/settings.rb
astrochimp-0.2.3 config/initializers/settings.rb
astrochimp-0.2.2 config/initializers/settings.rb
astrochimp-0.2.1 config/initializers/settings.rb
astrochimp-0.2.0 config/initializers/settings.rb