aboutsummaryrefslogtreecommitdiffstats
path: root/generators
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-08-18 16:52:22 +1200
committerPhilip Arndt <parndt@gmail.com>2010-08-18 16:52:22 +1200
commit75b8f120473a4025a47078feb1a208b9e39f1b1b (patch)
tree108676de862be97c3ff09793677c2d8154330d35 /generators
parent6086ac36adf6f54a5d2957ffdf101e251edd553c (diff)
downloadrefinerycms-blog-75b8f120473a4025a47078feb1a208b9e39f1b1b.tar.gz
refinerycms-blog-75b8f120473a4025a47078feb1a208b9e39f1b1b.tar.bz2
refinerycms-blog-75b8f120473a4025a47078feb1a208b9e39f1b1b.zip
Added asset copying to the generator script for those systems that can't cope with rails3 coolness.
Diffstat (limited to 'generators')
-rw-r--r--generators/refinery_blog/refinery_blog_generator.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/generators/refinery_blog/refinery_blog_generator.rb b/generators/refinery_blog/refinery_blog_generator.rb
index 304ea39..137ecab 100644
--- a/generators/refinery_blog/refinery_blog_generator.rb
+++ b/generators/refinery_blog/refinery_blog_generator.rb
@@ -12,6 +12,17 @@ class RefineryBlogGenerator < Rails::Generator::NamedBase
def manifest
record do |m|
+ if Rails.version < 3
+ matches = Dir[File.expand_path('../../../public/images/**/*', __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
+ end
+
m.template('seed.rb', 'db/seeds/refinerycms_blog.rb')
m.migration_template('migration.rb', 'db/migrate',