[macruby-changes] [5224] MacRuby/trunk/lib/rubygems/package/tar_writer.rb

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 8 19:21:29 PST 2011


Revision: 5224
          http://trac.macosforge.org/projects/ruby/changeset/5224
Author:   lsansonetti at apple.com
Date:     2011-02-08 19:21:27 -0800 (Tue, 08 Feb 2011)
Log Message:
-----------
fix a bug in rubygems when building gems where tarball data was handled as UTF-8 instead of binary

Modified Paths:
--------------
    MacRuby/trunk/lib/rubygems/package/tar_writer.rb

Modified: MacRuby/trunk/lib/rubygems/package/tar_writer.rb
===================================================================
--- MacRuby/trunk/lib/rubygems/package/tar_writer.rb	2011-02-09 02:29:50 UTC (rev 5223)
+++ MacRuby/trunk/lib/rubygems/package/tar_writer.rb	2011-02-09 03:21:27 UTC (rev 5224)
@@ -40,6 +40,9 @@
     # number of bytes will be more than #limit
 
     def write(data)
+      # XXX MACRUBY mainly because our File.open won't honor 'b'.
+      data = data.force_encoding('BINARY')
+
       if data.size + @written > @limit
         raise FileOverflow, "You tried to feed more data than fits in the file."
       end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110208/d245971e/attachment-0001.html>


More information about the macruby-changes mailing list