hooks for after config
This commit is contained in:
parent
553be5762c
commit
8a81a7be1c
|
@ -34,6 +34,7 @@ module Middleman::CoreExtensions::Features
|
|||
class << self
|
||||
def registered(app)
|
||||
app.set :default_features, []
|
||||
app.define_hook :after_configuration
|
||||
app.extend ClassMethods
|
||||
end
|
||||
alias :included :registered
|
||||
|
@ -63,16 +64,6 @@ module Middleman::CoreExtensions::Features
|
|||
register feature
|
||||
end
|
||||
|
||||
# Add a block/proc to be run after features have been setup
|
||||
def after_configuration(&block)
|
||||
@run_after_features ||= []
|
||||
@run_after_features << block
|
||||
end
|
||||
|
||||
def run_after_features
|
||||
@run_after_features || []
|
||||
end
|
||||
|
||||
# Load features before starting server
|
||||
def new
|
||||
# Check for and evaluate local configuration
|
||||
|
@ -88,7 +79,7 @@ module Middleman::CoreExtensions::Features
|
|||
activate ext
|
||||
end
|
||||
|
||||
run_after_features.each { |block| class_eval(&block) }
|
||||
run_hook :after_configuration
|
||||
|
||||
if logging?
|
||||
extensions.each do |ext|
|
||||
|
|
|
@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|||
s.add_dependency("sprockets-sass", ["~> 0.3.0"])
|
||||
s.add_dependency("padrino-core", ["~> 0.10.5"])
|
||||
s.add_dependency("padrino-helpers", ["~> 0.10.5"])
|
||||
s.add_dependency("hooks")
|
||||
s.add_dependency("hooks", ["~> 0.2.0"])
|
||||
|
||||
s.add_dependency("eventmachine", ["1.0.0.beta.4.1"])
|
||||
s.add_dependency("win32-process", ["~> 0.6.5"])
|
||||
|
|
|
@ -38,7 +38,7 @@ Gem::Specification.new do |s|
|
|||
s.add_dependency("sprockets-sass", ["~> 0.3.0"])
|
||||
s.add_dependency("padrino-core", ["~> 0.10.5"])
|
||||
s.add_dependency("padrino-helpers", ["~> 0.10.5"])
|
||||
s.add_dependency("hooks")
|
||||
s.add_dependency("hooks", ["~> 0.2.0"])
|
||||
|
||||
s.add_dependency("guard", ["~> 0.8.8"])
|
||||
s.add_dependency("eventmachine", ["1.0.0.beta.4"])
|
||||
|
|
Loading…
Reference in a new issue