Sha256: c6408c25a3962d234994c28ba764c722e9690562b4aa8d39e23f6b415886da7f

Contents?: true

Size: 691 Bytes

Versions: 13

Compression:

Stored size: 691 Bytes

Contents

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
        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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ucb_rails-0.0.14 lib/ucb_rails/engine.rb
ucb_rails-0.0.13 lib/ucb_rails/engine.rb
ucb_rails-0.0.12 lib/ucb_rails/engine.rb
ucb_rails-0.0.11 lib/ucb_rails/engine.rb
ucb_rails-0.0.10 lib/ucb_rails/engine.rb
ucb_rails-0.0.9 lib/ucb_rails/engine.rb
ucb_rails-0.0.8 lib/ucb_rails/engine.rb
ucb_rails-0.0.7 lib/ucb_rails/engine.rb
ucb_rails-0.0.6 lib/ucb_rails/engine.rb
ucb_rails-0.0.5 lib/ucb_rails/engine.rb
ucb_rails-0.0.4 lib/ucb_rails/engine.rb
ucb_rails-0.0.3 lib/ucb_rails/engine.rb
ucb_rails-0.0.2 lib/ucb_rails/engine.rb