From 14daff297b2c3f2937ef6cf3e72b663903eec97a Mon Sep 17 00:00:00 2001 From: Jamie Winsor Date: Thu, 27 Oct 2011 19:36:54 -0700 Subject: Refactor require layout to match other engines --- lib/refinery/blog.rb | 29 +++++++++++++++++++++++++++++ lib/refinery/blog/engine.rb | 3 ++- lib/refinerycms-blog.rb | 32 +------------------------------- 3 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 lib/refinery/blog.rb (limited to 'lib') diff --git a/lib/refinery/blog.rb b/lib/refinery/blog.rb new file mode 100644 index 0000000..af39967 --- /dev/null +++ b/lib/refinery/blog.rb @@ -0,0 +1,29 @@ +require 'refinerycms-core' +require 'filters_spam' +require 'rails_autolink' + +module Refinery + autoload :BlogGenerator, 'generators/refinery/blog/blog_generator' + + module Blog + require 'refinery/blog/engine' if defined?(Rails) + + autoload :Version, 'refinery/blog/version' + autoload :Tab, 'refinery/blog/tabs' + + class << self + attr_accessor :root + def root + @root ||= Pathname.new(File.expand_path('../../', __FILE__)) + end + + def version + ::Refinery::Blog::Version.to_s + end + + def factory_paths + @factory_paths ||= [ File.expand_path("../../spec/factories", __FILE__) ] + end + end + end +end diff --git a/lib/refinery/blog/engine.rb b/lib/refinery/blog/engine.rb index 8ca1f0a..078b97f 100644 --- a/lib/refinery/blog/engine.rb +++ b/lib/refinery/blog/engine.rb @@ -1,4 +1,5 @@ -require 'rails_autolink' +require 'refinerycms-blog' +require 'rails' module Refinery module Blog diff --git a/lib/refinerycms-blog.rb b/lib/refinerycms-blog.rb index 88b8afc..e08f070 100644 --- a/lib/refinerycms-blog.rb +++ b/lib/refinerycms-blog.rb @@ -1,31 +1 @@ -require 'rubygems' -require 'bundler' -Bundler.require - -require 'filters_spam' - -module Refinery - autoload :BlogGenerator, 'generators/refinery/blog/blog_generator' - - module Blog - autoload :Version, 'refinery/blog/version' - autoload :Tab, 'refinery/blog/tabs' - - class << self - attr_accessor :root - def root - @root ||= Pathname.new(File.expand_path('../../', __FILE__)) - end - - def version - ::Refinery::Blog::Version.to_s - end - - def factory_paths - @factory_paths ||= [ File.expand_path("../../spec/factories", __FILE__) ] - end - end - end -end - -require 'refinery/blog/engine' if defined?(Rails) +require 'refinery/blog' -- cgit v1.2.3