[DRE-commits] [gem2deb] 01/02: metadata: resist gemspec.bindir not being a String

Antonio Terceiro terceiro at moszumanska.debian.org
Wed Feb 17 10:09:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository gem2deb.

commit dfad19e9827091ce5a63552896fa8a95f3a9b5a2
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Wed Feb 17 08:00:30 2016 -0200

    metadata: resist gemspec.bindir not being a String
    
    Closes: #814973
---
 debian/changelog           | 6 ++++++
 lib/gem2deb/metadata.rb    | 2 +-
 test/unit/metadata_test.rb | 5 +++++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 5fbf87d..6528d9d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+gem2deb (0.26.1) UNRELEASED; urgency=medium
+
+  * metadata: resist gemspec.bindir not being a String (Closes: #814973)
+
+ -- Antonio Terceiro <terceiro at debian.org>  Wed, 17 Feb 2016 07:54:59 -0200
+
 gem2deb (0.26) unstable; urgency=medium
 
   * dh_ruby:
diff --git a/lib/gem2deb/metadata.rb b/lib/gem2deb/metadata.rb
index 5f41952..fdf230f 100644
--- a/lib/gem2deb/metadata.rb
+++ b/lib/gem2deb/metadata.rb
@@ -79,7 +79,7 @@ module Gem2Deb
     end
 
     def bindir
-      gemspec ? gemspec.bindir : 'bin'
+      (gemspec && gemspec.bindir.is_a?(String)) ? gemspec.bindir : 'bin'
     end
 
     def executables
diff --git a/test/unit/metadata_test.rb b/test/unit/metadata_test.rb
index ae0163b..3f6c882 100644
--- a/test/unit/metadata_test.rb
+++ b/test/unit/metadata_test.rb
@@ -111,6 +111,11 @@ class MetaDataTest < Gem2DebTestCase
       assert_equal 'programs', @metadata.bindir
     end
 
+    should 'resist bindir being false' do
+      @gemspec.stubs(:bindir).returns(false)
+      assert_equal 'bin', @metadata.bindir
+    end
+
     should 'use whatever programs the gemspec says' do
       @gemspec.stubs(:executables).returns(%w(foo bar))
       assert_equal ['foo', 'bar'], @metadata.executables

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gem2deb.git



More information about the Pkg-ruby-extras-commits mailing list