aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamie Winsor <jamie@enmasse.com>2011-10-27 18:12:32 -0700
committerJamie Winsor <jamie@enmasse.com>2011-10-27 18:12:32 -0700
commit5a958007c5c4b3ef4af001464d75c4c00adfe870 (patch)
treea0aa41f3bd78230d5d3438bef0049ea767a8526d
parent8cd4a282d8f1173f4d8df496c2dd2b61ad892292 (diff)
downloadrefinerycms-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
-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'