diff options
author | Philip Arndt <parndt@gmail.com> | 2010-09-03 23:32:07 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2010-09-03 23:32:07 +1200 |
commit | a2f655b55eb30a900020e8aff9601ed0606ce58f (patch) | |
tree | d57cf7aef6ae36a4751144587fab7fe2e508d491 /generators/refinery_blog | |
parent | c4222bfdf5733d1552a2ecf4468d89cf89a583b1 (diff) | |
download | refinerycms-blog-a2f655b55eb30a900020e8aff9601ed0606ce58f.tar.gz refinerycms-blog-a2f655b55eb30a900020e8aff9601ed0606ce58f.tar.bz2 refinerycms-blog-a2f655b55eb30a900020e8aff9601ed0606ce58f.zip |
Hello rails3 support.
Diffstat (limited to 'generators/refinery_blog')
-rw-r--r-- | generators/refinery_blog/refinery_blog_generator.rb | 28 | ||||
-rw-r--r-- | generators/refinery_blog/templates/db/migrate/migration.rb (renamed from generators/refinery_blog/templates/migration.rb) | 0 | ||||
-rw-r--r-- | generators/refinery_blog/templates/db/seeds/seed.rb (renamed from generators/refinery_blog/templates/seed.rb) | 0 |
3 files changed, 13 insertions, 15 deletions
diff --git a/generators/refinery_blog/refinery_blog_generator.rb b/generators/refinery_blog/refinery_blog_generator.rb index 2bf39d8..076f709 100644 --- a/generators/refinery_blog/refinery_blog_generator.rb +++ b/generators/refinery_blog/refinery_blog_generator.rb @@ -12,24 +12,22 @@ class RefineryBlogGenerator < Rails::Generator::NamedBase def manifest record do |m| - if Rails.version < '3.0.0' - matches = Dir[ - File.expand_path('../../../public/images/**/*', __FILE__), - File.expand_path('../../../public/stylesheets/**/*', __FILE__), - File.expand_path('../../../public/javascripts/**/*', __FILE__), - ] - matches.reject{|d| !File.directory?(d)}.each do |dir| - m.directory((%w(public) | dir.split('public/').last.split('/')).join('/')) - end - matches.reject{|f| File.directory?(f)}.each do |image| - path = (%w(public) | image.split('public/').last.split('/'))[0...-1].join('/') - m.template "../../../#{path}/#{image.split('/').last}", "#{path}/#{image.split('/').last}" - end + matches = Dir[ + File.expand_path('../../../public/images/**/*', __FILE__), + File.expand_path('../../../public/stylesheets/**/*', __FILE__), + File.expand_path('../../../public/javascripts/**/*', __FILE__), + ] + matches.reject{|d| !File.directory?(d)}.each do |dir| + m.directory((%w(public) | dir.split('public/').last.split('/')).join('/')) + end + matches.reject{|f| File.directory?(f)}.each do |image| + path = (%w(public) | image.split('public/').last.split('/'))[0...-1].join('/') + m.template "../../../#{path}/#{image.split('/').last}", "#{path}/#{image.split('/').last}" end - m.template('seed.rb', 'db/seeds/refinerycms_blog.rb') + m.template('db/seeds/seed.rb', 'db/seeds/refinerycms_blog.rb') - m.migration_template('migration.rb', 'db/migrate', + m.migration_template('db/migrate/migration.rb', 'db/migrate', :migration_file_name => 'create_blog_structure', :assigns => { :migration_name => 'CreateBlogStructure', diff --git a/generators/refinery_blog/templates/migration.rb b/generators/refinery_blog/templates/db/migrate/migration.rb index 5ba29c6..5ba29c6 100644 --- a/generators/refinery_blog/templates/migration.rb +++ b/generators/refinery_blog/templates/db/migrate/migration.rb diff --git a/generators/refinery_blog/templates/seed.rb b/generators/refinery_blog/templates/db/seeds/seed.rb index 228fc7b..228fc7b 100644 --- a/generators/refinery_blog/templates/seed.rb +++ b/generators/refinery_blog/templates/db/seeds/seed.rb |