Permalink
Browse files

Update blog generator to use Rails 3.1 base

Seeds will now follow Rails 3.1 conventions
  • Loading branch information...
1 parent 8cd4a28 commit 5a958007c5c4b3ef4af001464d75c4c00adfe870 Jamie Winsor committed Oct 28, 2011
View
2 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)
View
0 db/seeds/refinerycms_blog.rb → db/seeds.rb
File renamed without changes.
View
10 lib/generators/blog_generator.rb
@@ -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
View
16 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
View
3 lib/refinerycms-blog.rb
@@ -3,9 +3,10 @@
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'

0 comments on commit 5a95800

Please sign in to comment.