aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Rakefile2
-rw-r--r--db/seeds.rb (renamed from db/seeds/refinerycms_blog.rb)0
-rw-r--r--lib/generators/blog_generator.rb10
-rw-r--r--lib/generators/refinery/blog/blog_generator.rb16
-rw-r--r--lib/refinerycms-blog.rb3
5 files changed, 19 insertions, 12 deletions
diff --git a/Rakefile b/Rakefile
index 5adcafe..8fb342e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -5,7 +5,7 @@ rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
-ENGINE_ROOT = File.dirname(__FILE__)
+ENGINE_PATH = File.dirname(__FILE__)
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
if File.exists?(APP_RAKEFILE)
diff --git a/db/seeds/refinerycms_blog.rb b/db/seeds.rb
index 19c4370..19c4370 100644
--- a/db/seeds/refinerycms_blog.rb
+++ b/db/seeds.rb
diff --git a/lib/generators/blog_generator.rb b/lib/generators/blog_generator.rb
deleted file mode 100644
index 8b09bb7..0000000
--- a/lib/generators/blog_generator.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'refinery/generators'
-
-module ::Refinery
- class BlogGenerator < ::Refinery::Generators::EngineInstaller
-
- source_root File.expand_path('../../../', __FILE__)
- engine_name "refinerycms-blog"
-
- end
-end
diff --git a/lib/generators/refinery/blog/blog_generator.rb b/lib/generators/refinery/blog/blog_generator.rb
new file mode 100644
index 0000000..34f6cd2
--- /dev/null
+++ b/lib/generators/refinery/blog/blog_generator.rb
@@ -0,0 +1,16 @@
+module Refinery
+ class BlogGenerator < Rails::Generators::Base
+ source_root File.expand_path('../templates', __FILE__)
+
+ def append_load_seed_data
+ append_file 'db/seeds.rb', :verbose => true do
+ <<-EOH
+
+# Added by RefineryCMS Blog engine
+Refinery::Blog::Engine.load_seed
+ EOH
+ end
+ end
+
+ end
+end
diff --git a/lib/refinerycms-blog.rb b/lib/refinerycms-blog.rb
index 135b3e1..88b8afc 100644
--- a/lib/refinerycms-blog.rb
+++ b/lib/refinerycms-blog.rb
@@ -3,9 +3,10 @@ require 'bundler'
Bundler.require
require 'filters_spam'
-require File.expand_path('../generators/blog_generator', __FILE__)
module Refinery
+ autoload :BlogGenerator, 'generators/refinery/blog/blog_generator'
+
module Blog
autoload :Version, 'refinery/blog/version'
autoload :Tab, 'refinery/blog/tabs'