[DRE-commits] [gem2deb] 01/02: dh_ruby --gem-install: don't install spec.test_files

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Feb 14 15:48:29 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 045657d8c6e9f75c6fbc0108837fbe4bad49d330
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun Feb 14 13:29:14 2016 -0200

    dh_ruby --gem-install: don't install spec.test_files
---
 debian/changelog                                  | 3 +++
 lib/gem2deb/gem_installer.rb                      | 3 +++
 test/sample/install_as_gem/install_as_gem.gemspec | 1 +
 3 files changed, 7 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index bc32177..b235551 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ gem2deb (0.25.2) UNRELEASED; urgency=medium
     build with precedence over metadata already installed in the system. Fixes
     building packages on non-clean systems where the package you are building
     may have a version already installed.
+  * dh_ruby --gem-install:
+    - handle not installing test files when they are explicitly listed in the
+      gemspec under `spec.test_files = ...`.
 
  -- Antonio Terceiro <terceiro at debian.org>  Thu, 28 Jan 2016 10:17:02 -0200
 
diff --git a/lib/gem2deb/gem_installer.rb b/lib/gem2deb/gem_installer.rb
index e770032..5184dbc 100644
--- a/lib/gem2deb/gem_installer.rb
+++ b/lib/gem2deb/gem_installer.rb
@@ -45,6 +45,9 @@ module Gem2Deb
 
         gemspec_data = load_gemspec_data!
 
+        # don't install any test files
+        gemspec_data.test_files = []
+
         # remove unwanted files and directories
         gemspec_data.files.reject! do |entry|
           !INSTALL_WHITELIST.include?(entry.split('/').first)
diff --git a/test/sample/install_as_gem/install_as_gem.gemspec b/test/sample/install_as_gem/install_as_gem.gemspec
index fd56979..538d703 100644
--- a/test/sample/install_as_gem/install_as_gem.gemspec
+++ b/test/sample/install_as_gem/install_as_gem.gemspec
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
   s.description = %q{Simple gem to test the gem2deb gem installer}
 
   s.files = Dir['**/*']
+  s.test_files = Dir['test/**/*'] + Dir['spec/**/*']
   s.executables = Dir['bin/*'].map { |f| File.basename(f) }
   s.extensions = 'ext/extconf.rb'
 end

-- 
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