lib/herokuconf.rb in herokuconf-0.0.6 vs lib/herokuconf.rb in herokuconf-0.0.7

- old
+ new

@@ -5,17 +5,21 @@ # Base module for HerokuConf module HerokuConf class << self DEFAULT_OPTIONS = { app: nil, - keys: nil + keys: nil, + exclude: ['RACK_ENV'] } def configure!(params = {}) return if ENV['DYNO'] - app, keys = DEFAULT_OPTIONS.dup.merge!(params).values_at(:app, :keys) + app, keys, exclude = DEFAULT_OPTIONS.dup.merge!(params).values_at( + :app, :keys, exclude + ) pairs = config_vars(app) pairs.select! { |k, _| keys.include? k } if keys + pairs.reject! { |k, _| exclude.include? k } if exclude pairs.each { |k, v| ENV[k] = v } end private