diff options
Diffstat (limited to 'lib/refinery/blog')
-rw-r--r-- | lib/refinery/blog/engine.rb | 29 | ||||
-rw-r--r-- | lib/refinery/blog/tabs.rb | 16 | ||||
-rw-r--r-- | lib/refinery/blog/version.rb | 6 |
3 files changed, 37 insertions, 14 deletions
diff --git a/lib/refinery/blog/engine.rb b/lib/refinery/blog/engine.rb new file mode 100644 index 0000000..3c829ca --- /dev/null +++ b/lib/refinery/blog/engine.rb @@ -0,0 +1,29 @@ +require 'refinerycms-blog' +require 'rails' + +module Refinery + module Blog + class Engine < Rails::Engine + include Refinery::Engine + + isolate_namespace Refinery + engine_name :refinery_blog + + initializer "register refinerycms_blog plugin", :after => :set_routes_reloader do |app| + Refinery::Plugin.register do |plugin| + plugin.pathname = root + plugin.name = "refinerycms_blog" + plugin.url = app.routes.url_helpers.refinery_admin_blog_posts_path + plugin.menu_match = /^\/refinery\/blog\/?(posts|comments|categories)?/ + plugin.activity = { + :class_name => :'refinery/blog/post' + } + end + end + + config.after_initialize do + Refinery.register_engine(Refinery::Blog) + end + end + end +end diff --git a/lib/refinery/blog/tabs.rb b/lib/refinery/blog/tabs.rb index 083d50b..519b90e 100644 --- a/lib/refinery/blog/tabs.rb +++ b/lib/refinery/blog/tabs.rb @@ -1,11 +1,5 @@ module Refinery - module Blog - attr_accessor :tabs - - def self.tabs - @tabs ||= [] - end - + module Blog class Tab attr_accessor :name, :partial @@ -18,11 +12,11 @@ module Refinery raise "A tab MUST have a partial!: #{tab.inspect}" if tab.partial.blank? end - protected + protected - def initialize - ::Refinery::Blog.tabs << self # add me to the collection of registered page tabs - end + def initialize + ::Refinery::Blog.tabs << self # add me to the collection of registered page tabs + end end end end
\ No newline at end of file diff --git a/lib/refinery/blog/version.rb b/lib/refinery/blog/version.rb index 0390414..4023000 100644 --- a/lib/refinery/blog/version.rb +++ b/lib/refinery/blog/version.rb @@ -1,9 +1,9 @@ module Refinery module Blog class Version - @major = 1 - @minor = 6 - @tiny = 2 + @major = 2 + @minor = 0 + @tiny = 0 class << self attr_reader :major, :minor, :tiny |