Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow ERB use in campaign_monitor_subscriber.yml #7

Merged
merged 1 commit into from

2 participants

@mattreduce

This change allows for the use of ERB for dynamic configuration.

My specific use case is to keep things like the API key in an environment variable, and read that into the config file.

@garygreyling garygreyling merged commit 1aaa1bf into from
@garygreyling
Owner

Nice addition :) I've updated the README and published this as v1.0.3. Thanks Matt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2012
  1. @mattreduce
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/campaign_monitor_subscriber/basic_configuration.rb
View
2  lib/campaign_monitor_subscriber/basic_configuration.rb
@@ -10,7 +10,7 @@ module BasicConfiguration
# All yaml config is namespaced under the environment name (the same way
# database.yml does it)
def raw_cms_config
- @raw_cms_config ||= YAML::load_file(File.join("config/campaign_monitor_subscriber.yml"))[::Rails.env]
+ @raw_cms_config ||= YAML.load(ERB.new(File.read("config/campaign_monitor_subscriber.yml")).result)[Rails.env]
end
end
end
Something went wrong with that request. Please try again.