Sha256: 4b9661f5dc6c76dcb3bed34776297c70fb83c4bcff47b789355492fc5035eac3
Contents?: true
Size: 883 Bytes
Versions: 6
Compression:
Stored size: 883 Bytes
Contents
namespace :themes do desc "Creates the cached theme folder" task :create_cache => :environment do for theme in ThemesForRails.available_themes theme_name = File.basename(theme) theme_dir = ThemesForRails.config.themes_dir theme_base = "#{Rails.public_path}/#{theme_dir}/#{theme_name}" puts "Creating #{theme_base}" FileUtils.mkdir_p "#{theme_base}" FileUtils.cp_r Dir["#{theme}/{images,stylesheets,javascripts}"], theme_base, :verbose => true end end desc "Removes the cached (public) theme folders" task :remove_cache => :environment do theme_dir = ThemesForRails.config.themes_dir puts "Removing #{Rails.public_path}/#{theme_dir}" FileUtils.rm_r "#{Rails.public_path}/#{theme_dir}", :force => true end desc "Updates the cached (public) theme folders" task :update_cache => [:remove_cache, :create_cache] end
Version data entries
6 entries across 6 versions & 2 rubygems