From 56d7747f54e86993415b76c92e101608e5ea44e2 Mon Sep 17 00:00:00 2001 From: James Thompson Date: Wed, 14 Mar 2012 11:40:16 +0200 Subject: initial commit --- lib/refinery/banners.rb | 21 +++++++++++++++++++++ lib/refinery/banners/engine.rb | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 lib/refinery/banners.rb create mode 100644 lib/refinery/banners/engine.rb (limited to 'lib/refinery') diff --git a/lib/refinery/banners.rb b/lib/refinery/banners.rb new file mode 100644 index 0000000..0004091 --- /dev/null +++ b/lib/refinery/banners.rb @@ -0,0 +1,21 @@ +require 'refinerycms-core' + +module Refinery + autoload :BannersGenerator, 'generators/refinery/banners_generator' + + module Banners + require 'refinery/banners/engine' + + class << self + attr_writer :root + + def root + @root ||= Pathname.new(File.expand_path('../../../', __FILE__)) + end + + def factory_paths + @factory_paths ||= [ root.join('spec', 'factories').to_s ] + end + end + end +end diff --git a/lib/refinery/banners/engine.rb b/lib/refinery/banners/engine.rb new file mode 100644 index 0000000..0299bb8 --- /dev/null +++ b/lib/refinery/banners/engine.rb @@ -0,0 +1,32 @@ +module Refinery + module Banners + class Engine < Rails::Engine + include Refinery::Engine + isolate_namespace Refinery::Banners + + engine_name :refinery_banners + + initializer "register refinerycms_banners plugin" do + Refinery::Plugin.register do |plugin| + plugin.name = "banners" + plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.banners_admin_banners_path } + plugin.pathname = root + plugin.activity = { + :class_name => :'refinery/banners/banner', + :title => 'name' + } + + end + end + + config.to_prepare do + require 'page_extensions' + Refinery::Page.send :include, Refinery::Banners::Extensions::Page + end + + config.after_initialize do + Refinery.register_extension(Refinery::Banners) + end + end + end +end -- cgit v1.2.3