Last active
December 31, 2015 08:39
-
-
Save dcki/7961780 to your computer and use it in GitHub Desktop.
Bunny engine.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Refinery | |
module Bunny | |
class Engine < Rails::Engine | |
extend Refinery::Engine | |
isolate_namespace Refinery::Bunny | |
engine_name :refinery_bunny | |
initializer "register refinerycms_bunny plugin" do | |
Refinery::Plugin.register do |plugin| | |
plugin.name = "bunny_socks" | |
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.bunny_admin_socks_path } | |
plugin.pathname = root | |
plugin.activity = { | |
:class_name => :'refinery/bunny/sock', | |
:title => 'url' | |
} | |
plugin.menu_match = %r{refinery/bunny/socks(/.+?)?$} | |
end | |
Refinery::Plugin.register do |plugin| | |
plugin.name = "bunny_shoe_horns" | |
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.bunny_admin_shoe_horns_path } | |
plugin.pathname = root | |
plugin.activity = { | |
:class_name => :'refinery/bunny/shoe_horns', | |
:title => 'url' | |
} | |
plugin.menu_match = %r{refinery/bunny/shoe_horns(/.+?)?$} | |
end | |
if Refinery::Bunny.is_master | |
Refinery::Plugin.register do |plugin| | |
plugin.name = "bunny_hat" | |
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.bunny_admin_hat_path } | |
plugin.pathname = root | |
plugin.activity = { | |
:class_name => :'refinery/bunny/hat', | |
:title => 'url' | |
} | |
plugin.menu_match = %r{refinery/bunny/hat(/.+?)?$} | |
end | |
end | |
end | |
config.after_initialize do | |
Refinery.register_extension(Refinery::Bunny) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment