lib/ucb_rails/engine.rb in ucb_rails-0.0.1 vs lib/ucb_rails/engine.rb in ucb_rails-0.0.2
- old
+ new
@@ -1,12 +1,33 @@
module UcbRails
+ # @private
class Engine < ::Rails::Engine
+ config.generators.integration_tool :rspec
+ config.generators.test_framework :rspec
initializer 'ucb_rails.app_controller' do |app|
ActiveSupport.on_load(:action_controller) do
- # extend MyModule::ClassMethods
include UcbRails::ControllerMethods
end
+ end
+ end
+
+ def self.config(&block)
+ yield Engine.config if block
+ Engine.config
+ end
+
+ def self.[](key)
+ setting = config.send(key)
+
+ if setting.is_a?(Proc)
+ setting.call
+ else
+ setting
end
+ rescue NameError
+ Rails.logger.debug "[UcbRails] Tried to access unknown UcbRails.config key: #{key.inspect}"
+ nil
end
+
end