Update blog generator to use Rails 3.1 base
Seeds will now follow Rails 3.1 conventions
This commit is contained in:
parent
8cd4a282d8
commit
5a958007c5
5 changed files with 19 additions and 12 deletions
2
Rakefile
2
Rakefile
|
@ -5,7 +5,7 @@ rescue LoadError
|
||||||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
||||||
end
|
end
|
||||||
|
|
||||||
ENGINE_ROOT = File.dirname(__FILE__)
|
ENGINE_PATH = File.dirname(__FILE__)
|
||||||
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
||||||
|
|
||||||
if File.exists?(APP_RAKEFILE)
|
if File.exists?(APP_RAKEFILE)
|
||||||
|
|
|
@ -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
|
|
16
lib/generators/refinery/blog/blog_generator.rb
Normal file
16
lib/generators/refinery/blog/blog_generator.rb
Normal file
|
@ -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
|
|
@ -3,9 +3,10 @@ require 'bundler'
|
||||||
Bundler.require
|
Bundler.require
|
||||||
|
|
||||||
require 'filters_spam'
|
require 'filters_spam'
|
||||||
require File.expand_path('../generators/blog_generator', __FILE__)
|
|
||||||
|
|
||||||
module Refinery
|
module Refinery
|
||||||
|
autoload :BlogGenerator, 'generators/refinery/blog/blog_generator'
|
||||||
|
|
||||||
module Blog
|
module Blog
|
||||||
autoload :Version, 'refinery/blog/version'
|
autoload :Version, 'refinery/blog/version'
|
||||||
autoload :Tab, 'refinery/blog/tabs'
|
autoload :Tab, 'refinery/blog/tabs'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue