lib/basquiat/support/configuration.rb in basquiat-1.1.1 vs lib/basquiat/support/configuration.rb in basquiat-1.2.0
- old
+ new
@@ -1,10 +1,11 @@
require 'basquiat/support/hash_refinements'
require 'naught'
require 'erb'
module Basquiat
+ require 'logger'
DefaultLogger = Naught.build { |config| config.mimic Logger }
class Configuration
using HashRefinements
@@ -38,21 +39,20 @@
def default_adapter
config.fetch(:default_adapter) { Basquiat::Adapter::Test }
end
def reload_classes
- Basquiat::Base.descendants.each do |klass|
- klass.reload_adapter_from_configuration
- end
+ Basquiat::Base.descendants.each(&:reload_adapter_from_configuration)
end
private
+
def config
@yaml.fetch(environment)
end
def load_yaml(path)
- @yaml = YAML.load(ERB.new(IO.readlines(path).join).result).symbolize_keys
+ @yaml = YAML.load(ERB.new(IO.readlines(path).join).result).symbolize_keys
end
def setup_basic_options
@queue_name ||= config.fetch(:queue_name) { 'basquiat.exchange' }
@exchange_name ||= config.fetch(:exchange_name) { 'basquiat.queue' }