Class: Ribbit::Adapters::Merb

Inherits:
Adapter
  • Object
show all
Defined in:
lib/ribbit/adapters/merb.rb

Defined Under Namespace

Modules: ControllerMixin, DefaultExceptionExtensions

Instance Attribute Summary

Attributes inherited from Adapter

#configuration

Instance Method Summary collapse

Methods inherited from Adapter

inherited

Constructor Details

#initialize(config) ⇒ Merb

Returns a new instance of Merb.



5
6
7
8
9
# File 'lib/ribbit/adapters/merb.rb', line 5

def initialize(config)
  super(config)
  config.environment_name = ::Merb.env
  config.project_root = ::Merb.root
end

Instance Method Details

#activate!Object



15
16
17
18
19
20
21
22
23
# File 'lib/ribbit/adapters/merb.rb', line 15

def activate!
  ::Merb::BootLoader.after_app_loads do
    ::Merb::AbstractController.send(:include, ControllerMixin)
    if configuration.automatic?
      ::Merb::Dispatcher::DefaultException.send(:include, ControllerMixin)
      ::Merb::Dispatcher::DefaultException.send(:include, DefaultExceptionExtensions)
    end
  end
end

#loggerObject



11
12
13
# File 'lib/ribbit/adapters/merb.rb', line 11

def logger
  ::Merb.logger
end