lutter/gem2rpm — Issue #8: [distro.rb] skip directories
Author: vbatts
Created: 2012-02-10 17:03:08+00:00
State: open

My Error:
$ gem2rpm --help
/usr/lib/ruby/gems/1.8/gems/gem2rpm-0.8.0/lib/gem2rpm/distro.rb:12:in `readline': Is a directory - /etc/lsb-release.d (Errno::EISDIR)
from /usr/lib/ruby/gems/1.8/gems/gem2rpm-0.8.0/lib/gem2rpm/distro.rb:12:in `nature'
from /usr/lib/ruby/gems/1.8/gems/gem2rpm-0.8.0/lib/gem2rpm/distro.rb:11:in `each'
from /usr/lib/ruby/gems/1.8/gems/gem2rpm-0.8.0/lib/gem2rpm/distro.rb:11:in `nature'
from /usr/lib/ruby/gems/1.8/gems/gem2rpm-0.8.0/lib/gem2rpm.rb:78
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.8/gems/gem2rpm-0.8.0/bin/gem2rpm:6
from /usr/bin/gem2rpm:19:in `load'
from /usr/bin/gem2rpm:19

My workaround diff:
--- /usr/lib/ruby/gems/1.8/gems/gem2rpm-0.8.0/lib/gem2rpm/distro.rb.bak	2012-02-10 11:54:27.036297526 -0500
+++ /usr/lib/ruby/gems/1.8/gems/gem2rpm-0.8.0/lib/gem2rpm/distro.rb	2012-02-10 11:54:54.659198627 -0500
@@ -9,6 +9,7 @@
versions = []

release_files.each do |file|
+ next if not FileTest.file? file
/\d+/ =~ File.open(file).readline
versions << Regexp.last_match.to_s.to_i if Regexp.last_match
end