You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by bo...@apache.org on 2009/11/22 18:14:14 UTC

svn commit: r883103 - /buildr/trunk/lib/buildr/packaging/gems.rb

Author: boisvert
Date: Sun Nov 22 17:14:14 2009
New Revision: 883103

URL: http://svn.apache.org/viewvc?rev=883103&view=rev
Log:
Fix Gem::Package argument

Modified:
    buildr/trunk/lib/buildr/packaging/gems.rb

Modified: buildr/trunk/lib/buildr/packaging/gems.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/packaging/gems.rb?rev=883103&r1=883102&r2=883103&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/packaging/gems.rb (original)
+++ buildr/trunk/lib/buildr/packaging/gems.rb Sun Nov 22 17:14:14 2009
@@ -59,13 +59,17 @@
     def create_from(file_map)
       spec.mark_version
       spec.validate
-      Gem::Package.open(name, 'w', nil) do |pkg|
-        pkg.metadata = spec.to_yaml
-        file_map.each do |path, content|
-          next if content.nil? || File.directory?(content.to_s)
-          pkg.add_file_simple(path, File.stat(name).mode & 0777, File.size(content.to_s)) do |os|
-            File.open(content.to_s, "rb") do |file|
-              os.write file.read(4096)  until file.eof?
+      
+      File.open(name, 'w') do |io|
+        Gem::Package.open(io, 'w', nil) do |pkg|
+          pkg.metadata = spec.to_yaml
+          file_map.each do |path, content|
+            p "path #{path} content #{content}"
+            next if content.nil? || File.directory?(content.to_s)
+            pkg.add_file_simple(path, File.stat(content.to_s).mode & 0777, File.size(content.to_s)) do |os|
+              File.open(content.to_s, "rb") do |file|
+                os.write file.read(4096)  until file.eof?
+              end
             end
           end
         end