[前][次][番号順一覧][スレッド一覧]

ruby-changes:26224

From: drbrain <ko1@a...>
Date: Mon, 10 Dec 2012 09:13:55 +0900 (JST)
Subject: [ruby-changes:26224] drbrain:r38281 (trunk): * lib/rubygems/package.rb: Omit directories when packaging gems like

drbrain	2012-12-10 09:13:42 +0900 (Mon, 10 Dec 2012)

  New Revision: 38281

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38281

  Log:
    * lib/rubygems/package.rb:  Omit directories when packaging gems like
      RubyGems 1.8.x
    * test/rubygems/test_gem_package.rb:  Test for above.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/package.rb
    trunk/test/rubygems/test_gem_package.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38280)
+++ ChangeLog	(revision 38281)
@@ -1,3 +1,9 @@
+Mon Dec 10 09:13:08 2012  Eric Hodel  <drbrain@s...>
+
+	* lib/rubygems/package.rb:  Omit directories when packaging gems like
+	  RubyGems 1.8.x
+	* test/rubygems/test_gem_package.rb:  Test for above.
+
 Sun Dec  9 17:36:59 2012  Shugo Maeda  <shugo@r...>
 
 	* vm_insnhelper.c (vm_call_opt_send): Kernel#send should not use
Index: lib/rubygems/package.rb
===================================================================
--- lib/rubygems/package.rb	(revision 38280)
+++ lib/rubygems/package.rb	(revision 38281)
@@ -192,6 +192,8 @@
     @spec.files.each do |file|
       stat = File.stat file
 
+      next unless stat.file?
+
       tar.add_file_simple file, stat.mode, stat.size do |dst_io|
         open file, 'rb' do |src_io|
           dst_io.write src_io.read 16384 until src_io.eof?
Index: test/rubygems/test_gem_package.rb
===================================================================
--- test/rubygems/test_gem_package.rb	(revision 38280)
+++ test/rubygems/test_gem_package.rb	(revision 38281)
@@ -102,9 +102,10 @@
 
   def test_add_files
     spec = Gem::Specification.new
-    spec.files = 'lib/code.rb'
+    spec.files = %w[lib/code.rb lib/empty]
 
-    FileUtils.mkdir 'lib'
+    FileUtils.mkdir_p 'lib/empty'
+
     open 'lib/code.rb',  'w' do |io| io.write '# lib/code.rb'  end
     open 'lib/extra.rb', 'w' do |io| io.write '# lib/extra.rb' end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]