middleman/middleman-core/fixtures/v4-extension-callbacks/config.rb

43 lines
914 B
Ruby
Raw Normal View History

class ExtensionOne < ::Middleman::Extension
2014-01-01 03:21:30 +01:00
helpers do
def extension_two_was_activated
extensions[:extension_one].extension_two_was_activated
end
end
attr_reader :extension_two_was_activated
def initialize(app, options_hash={})
super
after_extension_activated :extension_two do
2014-01-01 03:21:30 +01:00
@extension_two_was_activated = true
end
end
end
Middleman::Extensions.register :extension_one, ExtensionOne
class ExtensionTwo < ::Middleman::Extension
2014-01-01 03:21:30 +01:00
helpers do
def extension_one_was_activated
extensions[:extension_two].extension_one_was_activated
end
end
attr_reader :extension_one_was_activated
def initialize(app, options_hash={})
super
after_extension_activated :extension_one do
2014-01-01 03:21:30 +01:00
@extension_one_was_activated = true
end
end
end
Middleman::Extensions.register :extension_two, ExtensionTwo
activate :extension_one
activate :extension_two