Sha256: 2e0898b7915b0fa8fbb8a8e72c53533593d960be4dba59c10f2a871a26d23ad1

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 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"
  #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

1 entries across 1 versions & 1 rubygems

Version Path
theme_generator-1.2.2 templates/themes.rake