Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: ae47bb8bcb
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (19 sloc) 0.764 kb
require 'rake'
require 'bundler/gem_tasks'
desc "Update the gem with the latest files"
task :update do
# Copy the js file and require jQuery
js_content = File.read "../jquery/iphone-style-checkboxes.js"
f = File.new("vendor/assets/javascripts/ios-checkboxes.js", "w")
f.write("//= require jquery\n\n#{js_content}")
f.close
# Copy the images
cp_r "../images/", "vendor/assets/"
# Copy CSS and make sure it references the images via assets pipeline
css_content = File.read "../style.css"
pattern = /url\('images\/([^']+)'\)/
css_processed = css_content.gsub(pattern) {|m| "url('<%= image_path \"#{$1.sub(/\?.*/, '')}\" %>')" }
f2 = File.new("vendor/assets/stylesheets/ios-checkboxes.css.erb", "w")
f2.write(css_processed)
f2.close
end
Jump to Line
Something went wrong with that request. Please try again.