Permalink
Browse files

more compatible file write

  • Loading branch information...
1 parent c7d79be commit 8c4c5b01f076941bdaf0f3ed431b175e4a68d153 @tdreyno committed Nov 13, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 rails/Rakefile
View
@@ -5,7 +5,9 @@ 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"
- File.write("vendor/assets/javascripts/ios-checkboxes.js", "//= require jquery\n\n#{js_content}")
+ 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/"
@@ -14,5 +16,7 @@ task :update do
css_content = File.read "../style.css"
pattern = /url\('images\/([^']+)'\)/
css_processed = css_content.gsub(pattern) {|m| "url('<%= image_path \"#{$1.sub(/\?.*/, '')}\" %>')" }
- File.write("vendor/assets/stylesheets/ios-checkboxes.css.erb", css_processed)
+ f2 = File.new("vendor/assets/stylesheets/ios-checkboxes.css.erb", "w")
+ f2.write(css_processed)
+ f2.close
end

0 comments on commit 8c4c5b0

Please sign in to comment.