Module: MerbBackground
- Defined in:
- lib/merb_background.rb
Overview
All Slice code is expected to be namespaced inside a module
Defined Under Namespace
Classes: Application, Job, Main
Constant Summary collapse
- Config =
Mash.new( :cleanup_interval => :on_startup, :monitor_interval => 10 )
Class Method Summary collapse
-
.activate ⇒ Object
Activation hook - runs after AfterAppLoads BootLoader.
-
.deactivate ⇒ Object
Deactivation hook - triggered by Merb::Slices.deactivate(MerbBackground).
-
.init ⇒ Object
Initialization hook - runs before AfterAppLoads BootLoader.
-
.loaded ⇒ Object
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
-
.setup_router(scope) ⇒ Object
Setup routes inside the host application.
Class Method Details
.activate ⇒ Object
Activation hook - runs after AfterAppLoads BootLoader
44 45 |
# File 'lib/merb_background.rb', line 44 def self.activate end |
.deactivate ⇒ Object
Deactivation hook - triggered by Merb::Slices.deactivate(MerbBackground)
48 49 |
# File 'lib/merb_background.rb', line 48 def self.deactivate end |
.init ⇒ Object
Initialization hook - runs before AfterAppLoads BootLoader
40 41 |
# File 'lib/merb_background.rb', line 40 def self.init end |
.loaded ⇒ Object
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
35 36 37 |
# File 'lib/merb_background.rb', line 35 def self.loaded require 'merb_background/job' end |
.setup_router(scope) ⇒ Object
prefix your named routes with :merb_background_ to avoid potential conflicts with global named routes.
Setup routes inside the host application
60 61 62 63 64 65 66 67 |
# File 'lib/merb_background.rb', line 60 def self.setup_router(scope) # example of a named route scope.match('/index(.:format)').to(:controller => 'main', :action => 'index').name(:index) # the slice is mounted at /merb_background - note that it comes before default_routes scope.match('/').to(:controller => 'main', :action => 'index').name(:home) # enable slice-level default routes by default scope.default_routes end |