lib/brillo.rb in brillo-2.0.0 vs lib/brillo.rb in brillo-2.1.0
- old
+ new
@@ -25,23 +25,29 @@
module Brillo
def self.configure
yield config
end
- def self.scrub!(logger: ::Logger.new(STDOUT))
+ def self.scrub!(logger: ::Logger.new(STDOUT), filename: nil)
Brillo::Logger.logger = logger
- Scrubber.new(config).scrub!
+ configuration = config
+ configuration.app_name = filename if filename
+ Scrubber.new(configuration).scrub!
end
- def self.load!(logger: ::Logger.new(STDOUT))
+ def self.load!(keep_local: false, logger: ::Logger.new(STDOUT), filename: nil)
Brillo::Logger.logger = logger
- Loader.new(config).load!
+ configuration = config
+ configuration.app_name = filename if filename
+ Loader.new(configuration).load! keep_local
end
def self.config
@config ||= begin
static_config = YAML.load(ERB.new(File.read("#{Rails.root.to_s}/config/brillo.yml")).result).deep_symbolize_keys
- Config.new(static_config)
+ c = Config.new(static_config)
+ yield c if block_given?
+ c
end
end
def self.config=(config)
@config = config