extension覚書
extension が new されるのは
Middleman::CoreExtensions::Extensions::ClassMethods::register
bin/middleman
Middleman::Cli::Base.start
super (Thor)
Middleman::Cli::Console.console
require 'middleman-core'
autoload :Application 'middleman-core/application'
register Middleman::CoreExtensions::Request
register.....Middleman::Extensions::register defined in 'middleman-core/extensions'
registered[name.to_sym] = namespace
require 'middleman-core/extensions'
@app = Middleman::Application.server.inst
intract_with(@app)
IRB.irb nil, context
hook
defined at Middleman::CoreExtensions::Extensions::registered(app)
- :initialized
- :instance_available
- :after_configuration
- :before_configuration
- :build_config
- :development_config
run at Middleman::CoreExtensions::Extensions::InstanceMethods::initialize
InstanceMethods は Application に include されるので、 結局 app.initialize の時に呼ばれることになる。
- run :initialized
- (activate :sprocket)
- run :before_configuration
- (load ‘config.rb’)
- run :build_config if build?
- run :development_config if specified
- run :instance_available
- (reload I18n)
- run :after_configuration
Application
defined at Middleman::Application
- :before # Before request hook
- :ready # Ready (all loading and parsing of extensions complete) hook
- :before_build # Runs before the build is started
- :after_build # Runs after the build is finished
ready
Middleman::CoreExtensions::Request::ClassMethods::inst()
before
Middleman::CoreExtensions::Request::InstanceMethods::process_start(env, req, res)