### Home Classes Methods

### In Files

- lib/merb-core/bootloader.rb

### Parent

Object

### Namespace

- CLASS Merb::BootLoader::AfterAppLoads
- CLASS Merb::BootLoader::BackgroundServices
- CLASS Merb::BootLoader::BeforeAppLoads
- CLASS Merb::BootLoader::BuildFramework
- CLASS Merb::BootLoader::ChooseAdapter
- CLASS Merb::BootLoader::Cookies
- CLASS Merb::BootLoader::Defaults
- CLASS Merb::BootLoader::Dependencies
- CLASS Merb::BootLoader::DropPidFile
- CLASS Merb::BootLoader::LoadClasses
- CLASS Merb::BootLoader::Logger
- CLASS Merb::BootLoader::MimeTypes
- CLASS Merb::BootLoader::MixinSession
- CLASS Merb::BootLoader::RackUpApplication
- CLASS Merb::BootLoader::ReloadClasses
- CLASS Merb::BootLoader::Router
- CLASS Merb::BootLoader::SetupSession
- CLASS Merb::BootLoader::SetupStubClasses
- CLASS Merb::BootLoader::Templates

### Methods

- ::after
- ::after_app_loads
- ::before
- ::before_app_loads
- ::before_master_shutdown
- ::before_worker_shutdown
- ::default_framework
- ::finished?
- ::inherited
- ::move_klass
- ::run

### Files

- CHANGELOG
- LICENSE
- README
- TODO

### Class/Module Index

Quicksearch

- Merb
- Merb::AbstractController
- Merb::AcceptType
- Merb::AuthenticationMixin
- Merb::AuthenticationMixin::BasicAuthentication
- Merb::BootLoader
- Merb::BootLoader::AfterAppLoads
- Merb::BootLoader::BackgroundServices
- Merb::BootLoader::BeforeAppLoads
- Merb::BootLoader::BuildFramework
- Merb::BootLoader::ChooseAdapter
- Merb::BootLoader::Cookies
- Merb::BootLoader::Defaults
- Merb::BootLoader::Dependencies
- Merb::BootLoader::DropPidFile
- Merb::BootLoader::LoadClasses
- Merb::BootLoader::Logger
- Merb::BootLoader::MimeTypes
- Merb::BootLoader::MixinSession
- Merb::BootLoader::RackUpApplication
- Merb::BootLoader::ReloadClasses
- Merb::BootLoader::ReloadClasses::TimedExecutor
- Merb::BootLoader::Router
- Merb::BootLoader::SetupSession
- Merb::BootLoader::SetupStubClasses
- Merb::BootLoader::Templates
- Merb::ConditionalGetMixin
- Merb::Config
- Merb::Config::ConfigBlock
- Merb::Const
- Merb::Controller
- Merb::ControllerExceptions
- Merb::ControllerExceptions::Accepted
- Merb::ControllerExceptions::ActionNotFound
- Merb::ControllerExceptions::BadGateway
- Merb::ControllerExceptions::BadRequest
- Merb::ControllerExceptions::Base
- Merb::ControllerExceptions::ClientError
- Merb::ControllerExceptions::Conflict
- Merb::ControllerExceptions::Continue
- Merb::ControllerExceptions::Created
- Merb::ControllerExceptions::ExpectationFailed
- Merb::ControllerExceptions::Forbidden
- Merb::ControllerExceptions::GatewayTimeout
- Merb::ControllerExceptions::Gone
- Merb::ControllerExceptions::HTTPVersionNotSupported
- Merb::ControllerExceptions::Informational
- Merb::ControllerExceptions::InternalServerError
- Merb::ControllerExceptions::LayoutNotFound
- Merb::ControllerExceptions::LengthRequired
- Merb::ControllerExceptions::MethodNotAllowed
- Merb::ControllerExceptions::MovedPermanently
- Merb::ControllerExceptions::MovedTemporarily
- Merb::ControllerExceptions::MultiPartParseError
- Merb::ControllerExceptions::MultipleChoices
- Merb::ControllerExceptions::NoContent
- Merb::ControllerExceptions::NonAuthoritativeInformation
- Merb::ControllerExceptions::NotAcceptable
- Merb::ControllerExceptions::NotFound
- Merb::ControllerExceptions::NotImplemented
- Merb::ControllerExceptions::NotModified
- Merb::ControllerExceptions::OK
- Merb::ControllerExceptions::PartialContent
- Merb::ControllerExceptions::PaymentRequired
- Merb::ControllerExceptions::PreconditionFailed
- Merb::ControllerExceptions::ProxyAuthenticationRequired
- Merb::ControllerExceptions::Redirection
- Merb::ControllerExceptions::RequestEntityTooLarge
- Merb::ControllerExceptions::RequestRangeNotSatisfiable
- Merb::ControllerExceptions::RequestTimeout
- Merb::ControllerExceptions::RequestURITooLarge
- Merb::ControllerExceptions::ResetContent
- Merb::ControllerExceptions::SeeOther
- Merb::ControllerExceptions::ServerError
- Merb::ControllerExceptions::ServiceUnavailable
- Merb::ControllerExceptions::Successful
- Merb::ControllerExceptions::SwitchingProtocols
- Merb::ControllerExceptions::TemplateNotFound
- Merb::ControllerExceptions::TemporaryRedirect
- Merb::ControllerExceptions::Unauthorized
- Merb::ControllerExceptions::UnsupportedMediaType
- Merb::ControllerExceptions::UseProxy
- Merb::ControllerMixin
- Merb::CookieSession
- Merb::CookieSession::CookieOverflow
- Merb::CookieSession::TamperedWithCookie
- Merb::Cookies
- Merb::CookiesMixin
- Merb::CookiesMixin::RequestMixin
- Merb::Counter
- Merb::Dispatcher
- Merb::Dispatcher::DefaultException
- Merb::Dispatcher::DefaultExceptionHelper
- Merb::GlobalHelpers
- Merb::InlineTemplates
- Merb::Logger
- Merb::MemcacheSession
- Merb::MemcacheStore
- Merb::MemorySession
- Merb::MemorySessionStore
- Merb::Parse
- Merb::Plugins
- Merb::Rack
- Merb::Rack::AbstractAdapter
- Merb::Rack::Adapter
- Merb::Rack::Application
- Merb::Rack::ConditionalGet
- Merb::Rack::Console
- Merb::Rack::ContentLength
- Merb::Rack::DeferrableMiddleware
- Merb::Rack::Ebb
- Merb::Rack::EventedMongrel
- Merb::Rack::FastCGI
- Merb::Rack::Handler
- Merb::Rack::Handler::Mongrel
- Merb::Rack::Head
- Merb::Rack::Helpers
- Merb::Rack::Irb
- Merb::Rack::Middleware
- Merb::Rack::Mongrel
- Merb::Rack::PathPrefix
- Merb::Rack::Profiler
- Merb::Rack::Runner
- Merb::Rack::Static
- Merb::Rack::StreamWrapper
- Merb::Rack::SwiftipliedMongrel
- Merb::Rack::Thin
- Merb::Rack::ThinTurbo
- Merb::Rack::Tracer
- Merb::Rack::WEBrick
- Merb::RenderMixin
- Merb::RenderMixin::ClassMethods
- Merb::Request
- Merb::ReservedError
- Merb::Responder
- Merb::ResponderMixin
- Merb::ResponderMixin::ClassMethods
- Merb::ResponderMixin::ContentTypeAlreadySet
- Merb::Router
- Merb::Router::Behavior
- Merb::Router::Behavior::Error
- Merb::Router::Behavior::Proxy
- Merb::Router::CachedProc
- Merb::Router::GenerationError
- Merb::Router::NotCompiledError
- Merb::Router::Resources
- Merb::Router::RouteNotFound
- Merb::Server
- Merb::Session
- Merb::SessionContainer
- Merb::SessionMixin
- Merb::SessionMixin::NoSessionContainer
- Merb::SessionMixin::RequestMixin
- Merb::SessionMixin::RequestMixin::ClassMethods
- Merb::SessionMixin::SessionOverflow
- Merb::SessionStoreContainer
- Merb::System
- Merb::System::PortablePoller
- Merb::Template
- Merb::Template::Erubis
- Merb::Template::Erubis::Mixin
- Merb::Test
- Merb::Test::ControllerHelper
- Merb::Test::Cookie
- Merb::Test::CookieJar
- Merb::Test::ExampleGroup
- Merb::Test::Helpers
- Merb::Test::MakeRequest
- Merb::Test::Matchers
- Merb::Test::MultipartRequestHelper
- Merb::Test::MultipartRequestHelper::FileParam
- Merb::Test::MultipartRequestHelper::Param
- Merb::Test::MultipartRequestHelper::Post
- Merb::Test::RequestHelper
- Merb::Test::RequestHelper::CookieJar
- Merb::Test::RequestHelper::FakeRequest
- Merb::Test::RouteHelper
- Merb::Test::Rspec
- Merb::Test::Rspec::ControllerMatchers
- Merb::Test::Rspec::ControllerMatchers::BeError
- Merb::Test::Rspec::ControllerMatchers::BeRedirect
- Merb::Test::Rspec::ControllerMatchers::Provide
- Merb::Test::Rspec::RouteMatchers
- Merb::Test::Rspec::RouteMatchers::ParameterMatcher
- Merb::Test::Rspec::RouteMatchers::RouteToMatcher
- Merb::Test::ViewHelper
- Merb::Test::WebratHelper
- Merb::Worker
- Erubis
- Erubis::Basic
- Erubis::Basic::Converter
- Erubis::BlockAwareEnhancer
- Erubis::BlockAwareEruby
- Erubis::MEruby
- Spec
- Spec::Matchers
- Spec::Matchers::MatcherDSL
- Spec::Runner
- Spec::Runner::Formatter
- Spec::Runner::Formatter::BaseTextFormatter
- Gem
- Gem::Dependency
- Hpricot
- Hpricot::Elem
- Mongrel
- Mongrel::HttpResponse
- Class
- Exception
- Hash
- Kernel
- MemCache
- Memcached
- Object
- String
- Time

No matching classes.

# Merb::BootLoader

### Public Class Methods

after(klass) click to toggle source

Execute this boot loader after the specified boot loader.

#### Parameters

klass<~to_s> | The boot loader class after which this boot loader should be run.

#### Returns

nil

:api: plugin

    # File lib/merb-core/bootloader.rb, line 42
    def after(klass)
      move_klass(klass, 1)
      nil
    end

after_app_loads(&block) click to toggle source

Execute a block of code after the app loads.

#### Parameters

&block | A block to be added to the callbacks that will be executed after the app loads.

:api: public

    # File lib/merb-core/bootloader.rb, line 150
    def after_app_loads(&block)
      after_load_callbacks << block
    end

before(klass) click to toggle source

Execute this boot loader before the specified boot loader.

#### Parameters

klass<~to_s> | The boot loader class before which this boot loader should be run.

#### Returns

nil

:api: plugin

    # File lib/merb-core/bootloader.rb, line 57
    def before(klass)
      move_klass(klass, 0)
      nil
    end

before_app_loads(&block) click to toggle source

Execute a block of code before the app loads but after dependencies load.

#### Parameters

&block | A block to be added to the callbacks that will be executed before the app loads.

:api: public

    # File lib/merb-core/bootloader.rb, line 162
    def before_app_loads(&block)
      before_load_callbacks << block
    end

before_master_shutdown(&block) click to toggle source

Execute a block of code before master process is shut down. Only makes sense on platforms where Merb server can use forking.

#### Parameters

&block | A block to be added to the callbacks that will be executed before master process is shut down.

:api: public

    # File lib/merb-core/bootloader.rb, line 175
    def before_master_shutdown(&block)
      before_master_shutdown_callbacks << block
    end

before_worker_shutdown(&block) click to toggle source

Execute a block of code before worker process is shut down. Only makes sense on platforms where Merb server can use forking.

#### Parameters

&block | A block to be added to the callbacks that will be executed before worker process is shut down.

:api: public

    # File lib/merb-core/bootloader.rb, line 188
    def before_worker_shutdown(&block)
      before_worker_shutdown_callbacks << block
    end

default_framework() click to toggle source

Set up the default framework

#### Returns

nil

:api: plugin @overridable

    # File lib/merb-core/bootloader.rb, line 125
    def default_framework
      ]view model helper controller mailer part].each do |component|
        Merb.push_path(component.to_sym, Merb.root_path("app/#{component}s"))
      end
      Merb.push_path(:application,  Merb.root_path("app" / "controllers" / "application.rb"))
      Merb.push_path(:config,       Merb.root_path("config"), nil)
      Merb.push_path(:router,       Merb.dir_for(:config), (Merb::Config[:router_file] || "router.rb"))
      Merb.push_path(:lib,          Merb.root_path("lib"), nil)
      Merb.push_path(:merb_session, Merb.root_path("merb" / "session"))
      Merb.push_path(:log,          Merb.log_path, nil)
      Merb.push_path(:public,       Merb.root_path("public"), nil)
      Merb.push_path(:stylesheet,   Merb.dir_for(:public) / "stylesheets", nil)
      Merb.push_path(:javascript,   Merb.dir_for(:public) / "javascripts", nil)
      Merb.push_path(:image,        Merb.dir_for(:public) / "images", nil)
      nil
    end

finished?(bootloader) click to toggle source

Determines whether or not a specific bootloader has finished yet.

#### Parameters

bootloader<String, Class> | The name of the bootloader to check.

#### Returns

Boolean | Whether or not the bootloader has finished.

:api: private

    # File lib/merb-core/bootloader.rb, line 114
    def finished?(bootloader)
      self.finished.include?(bootloader.to_s)
    end

inherited(klass) click to toggle source

Adds the inheriting class to the list of subclasses in a position specified by the before and after methods.

#### Parameters

klass<Class> | The class inheriting from Merb::BootLoader.

#### Returns

nil

:api: plugin

    # File lib/merb-core/bootloader.rb, line 27
    def inherited(klass)
      subclasses << klass.to_s
      super
    end

move_klass(klass, where) click to toggle source

Move a class that is inside the bootloader to some place in the Array, relative to another class.

#### Parameters

klass<~to_s> | The klass to move the bootloader relative to
where<Integer> | 0 means insert it before; 1 means insert it after

#### Returns

nil

:api: private

    # File lib/merb-core/bootloader.rb, line 75
    def move_klass(klass, where)
      index = Merb::BootLoader.subclasses.index(klass.to_s)
      if index
        Merb::BootLoader.subclasses.delete(self.to_s)
        Merb::BootLoader.subclasses.insert(index + where, self.to_s)
      end
      nil
    end

run() click to toggle source

Runs all boot loader classes by calling their run methods.

#### Returns

nil

:api: plugin

    # File lib/merb-core/bootloader.rb, line 90
    def run
      Merb.started = true
      subklasses = subclasses.dup
      until subclasses.empty?
        time = Time.now.to_i
        bootloader = subclasses.shift
        Merb.logger.debug!("Loading: #{bootloader}") if Merb.verbose_logging?
        Object.full_const_get(bootloader).run
        Merb.logger.debug!("It took: #{Time.now.to_i - time}") if Merb.verbose_logging?
        self.finished << bootloader
      end
      self.subclasses = subklasses
      nil
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.