Beef up Rails::Railtie::Configuration docs
This commit is contained in:
parent
f3666040a0
commit
6c309f04c9
|
@ -31,26 +31,34 @@ module Rails
|
||||||
app_generators(&block)
|
app_generators(&block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# First configurable block to run. Called before any initializers are run.
|
||||||
def before_configuration(&block)
|
def before_configuration(&block)
|
||||||
ActiveSupport.on_load(:before_configuration, :yield => true, &block)
|
ActiveSupport.on_load(:before_configuration, :yield => true, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Third configurable block to run. Does not run if config.cache_classes
|
||||||
|
# set to false.
|
||||||
def before_eager_load(&block)
|
def before_eager_load(&block)
|
||||||
ActiveSupport.on_load(:before_eager_load, :yield => true, &block)
|
ActiveSupport.on_load(:before_eager_load, :yield => true, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Second configurable block to run. Called before frameworks initialize.
|
||||||
def before_initialize(&block)
|
def before_initialize(&block)
|
||||||
ActiveSupport.on_load(:before_initialize, :yield => true, &block)
|
ActiveSupport.on_load(:before_initialize, :yield => true, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Last configurable block to run. Called after frameworks initialize.
|
||||||
def after_initialize(&block)
|
def after_initialize(&block)
|
||||||
ActiveSupport.on_load(:after_initialize, :yield => true, &block)
|
ActiveSupport.on_load(:after_initialize, :yield => true, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Array of callbacks defined by #to_prepare.
|
||||||
def to_prepare_blocks
|
def to_prepare_blocks
|
||||||
@@to_prepare_blocks ||= []
|
@@to_prepare_blocks ||= []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Defines generic callbacks to run before #after_initialize. Useful for
|
||||||
|
# Rails::Railtie subclasses.
|
||||||
def to_prepare(&blk)
|
def to_prepare(&blk)
|
||||||
to_prepare_blocks << blk if blk
|
to_prepare_blocks << blk if blk
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue