Sha256: a5eaf3f8894c3307e3a4c710e79473ba099115c0a6853cbeb8b0bcc0d90adb80

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

desc "Creates the cached (public) theme folders"
task :theme_create_cache do
  for theme in Dir.glob("#{RAILS_ROOT}/themes/*")
    theme_name = theme.split( File::Separator )[-1]
    puts "Creating #{RAILS_ROOT}/public/themes/#{theme_name}"
    
    FileUtils.mkdir_p "#{RAILS_ROOT}/public/themes/#{theme_name}"
        
    FileUtils.cp_r "#{theme}/images", "#{RAILS_ROOT}/public/themes/#{theme_name}/images", :verbose => true
    FileUtils.cp_r "#{theme}/stylesheets", "#{RAILS_ROOT}/public/themes/#{theme_name}/stylesheets", :verbose => true
    FileUtils.cp_r "#{theme}/javascript", "#{RAILS_ROOT}/public/themes/#{theme_name}/javascript", :verbose => true
    FileUtils.cp_r "#{theme}/preview.png", "#{RAILS_ROOT}/public/themes/#{theme_name}/preview.png", :verbose => true
  end
end

desc "Removes the cached (public) theme folders"
task :theme_remove_cache do
  puts "Creating #{RAILS_ROOT}/public/themes/#{theme_name}"
  FileUtils.rm_r Dir.glob("#{RAILS_ROOT}/public/themes/*")
  FileUtils.rm_r "#{RAILS_ROOT}/public/themes", :force => true
end

desc "Updates the cached (public) theme folders"
task :theme_update_cache => [:theme_remove_cache, :theme_create_cache]

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
theme_generator-1.2.1 templates/themes.rake
theme_generator-1.2.0 templates/themes.rake