Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Omit directories when packaging files. Fixes #413

  • Loading branch information...
commit 486ed83cc8e706069213c5d406122f4cfcca9e7f 1 parent 082a84a
@drbrain drbrain authored
View
11 History.txt
@@ -1,9 +1,10 @@
# coding: UTF-8
-=== 2.0.0.preview2.1
+=== 2.0.0.preview2.2
As a preview release, please file bugs for any problems you have with RubyGems
-at https://github.com/rubygems/rubygems/issues.
+at https://github.com/rubygems/rubygems/issues. To update to preview releases
+use gem update --system=2.0.0.preview2.2
RubyGems 2.0 includes several new features and many breaking changes. Some of
these changes will cause existing software to break. These changes are a
@@ -13,6 +14,12 @@ maintainable and improve APIs for RubyGems users.
If you are using bundler be sure to install version 1.3.0.pre. Older versions
of bundler will not work with RubyGems 2.0.
+* Bug fixes:
+ * Restored RubyGems 1.8 packaging behavior of omitting directories. Bug
+ #413 by Jeremy Kemper.
+
+=== 2.0.0.preview2.1 / 2012-12-08
+
* Minor enhancements:
* Gem::DependencyInstaller now passes build_args down to the installer.
Pull Request #412 by Sam Rawlins.
View
2  lib/rubygems/package.rb
@@ -192,6 +192,8 @@ def add_files tar # :nodoc:
@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?
View
5 test/rubygems/test_gem_package.rb
@@ -102,9 +102,10 @@ def test_add_checksums
def test_add_files
spec = Gem::Specification.new
- spec.files = 'lib/code.rb'
+ spec.files = %w[lib/code.rb lib/empty]
+
+ FileUtils.mkdir_p 'lib/empty'
- FileUtils.mkdir 'lib'
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
Please sign in to comment.
Something went wrong with that request. Please try again.