diff options
author | Jamie Winsor <jamie@enmasse.com> | 2011-10-27 18:12:32 -0700 |
---|---|---|
committer | Jamie Winsor <jamie@enmasse.com> | 2011-10-27 18:12:32 -0700 |
commit | 5a958007c5c4b3ef4af001464d75c4c00adfe870 (patch) | |
tree | a0aa41f3bd78230d5d3438bef0049ea767a8526d /lib | |
parent | 8cd4a282d8f1173f4d8df496c2dd2b61ad892292 (diff) | |
download | refinerycms-blog-5a958007c5c4b3ef4af001464d75c4c00adfe870.tar.gz refinerycms-blog-5a958007c5c4b3ef4af001464d75c4c00adfe870.tar.bz2 refinerycms-blog-5a958007c5c4b3ef4af001464d75c4c00adfe870.zip |
Update blog generator to use Rails 3.1 base
Seeds will now follow Rails 3.1 conventions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/generators/blog_generator.rb | 10 | ||||
-rw-r--r-- | lib/generators/refinery/blog/blog_generator.rb | 16 | ||||
-rw-r--r-- | lib/refinerycms-blog.rb | 3 |
3 files changed, 18 insertions, 11 deletions
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' |