Skip to content
Browse files

Update Rakefile

update Rakefile to not fail when using ruby 1.8 where force_encoding is not valid
  • Loading branch information...
1 parent 6cbb338 commit 9781d4e981577b1c16acb8f611855e68ed61740e @rgc rgc committed Sep 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 Rakefile
View
3 Rakefile
@@ -43,7 +43,8 @@ task :process do
require 'iconv'
converter = Iconv.new('UTF-8', 'ISO-8859-1')
Dir["vendor/assets/javascripts/tinymce/**/*.js"].each do |file|
- contents = converter.iconv(File.read(file)).force_encoding('UTF-8')
+ contents = converter.iconv(File.read(file))
+ contents = contents.force_encoding('UTF-8') if contents.respond_to?(:force_encoding)
File.open(file, 'w') { |f| f.write(contents) }
end
end

0 comments on commit 9781d4e

Please sign in to comment.
Something went wrong with that request. Please try again.