Sha256: 039c12e5012a95be989a369fae3ddb2a94965cddd8cd0fe066b17c488574bb91
Contents?: true
Size: 1.06 KB
Versions: 1
Compression:
Stored size: 1.06 KB
Contents
namespace :jquery_ui_themes do namespace :import do desc 'Import jQuery themeroller theme' task :themeroller, [:path, :name] => :environment do |t, args| abort 'Please specify a path to the file to import' if args[:path].blank? abort 'Please specify a name' if args[:name].blank? require 'fileutils' begin css_file = File.open(File.expand_path(args[:path]), 'r') rescue abort ('Import file not found!') end FileUtils.mkdir_p(File.expand_path('./app/assets/stylesheets/jquery-ui/')) FileUtils.mkdir_p(File.expand_path('./app/assets/images/jquery-ui/' + args[:name])) css = File.read(css_file) File.open(File.expand_path("./app/assets/stylesheets/jquery-ui/#{args[:name]}.css.scss"), "w") do |file| file.puts css.gsub(/url\(images\/(.*)\)/, 'url(image-path(\'jquery-ui/' + args[:name] + '/\1\'))') end FileUtils.cp_r(File.dirname(css_file) + '/images/.', File.expand_path('./app/assets/images/jquery-ui/' + args[:name])) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jquery-ui-themes-0.0.4 | lib/tasks/jquery-ui-themes_tasks.rake |