[DRE-commits] [gem2deb] 04/05: add support for checking Rubygems dependencies during build

Antonio Terceiro terceiro at moszumanska.debian.org
Sun May 17 13:00:18 UTC 2015


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

terceiro pushed a commit to branch master
in repository gem2deb.

commit 5d507cdede2fe760279ef295cbe2fda133582009
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun May 17 09:52:54 2015 -0300

    add support for checking Rubygems dependencies during build
---
 bin/gem2deb-test-runner    | 11 +++++++++++
 debian/changelog           |  1 +
 lib/gem2deb/test_runner.rb | 11 ++++++++++-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/bin/gem2deb-test-runner b/bin/gem2deb-test-runner
index 716df06..edc9ac0 100755
--- a/bin/gem2deb-test-runner
+++ b/bin/gem2deb-test-runner
@@ -94,6 +94,17 @@ Before running the tests, checks whether all dependencies of the package, as
 declared in the Rubygems metadata, are present. Makes the program exit with a
 non-zero status code (i.e. fails) if they aren't.
 
+If you want to check dependencies during the build, you can add something like
+this to debian/rules:
+
+=over
+
+export GEM2DEB_TEST_RUNNER = --check-dependencies
+
+=back
+
+=back
+
 =head1 ENVIRONMENT
 
 =over
diff --git a/debian/changelog b/debian/changelog
index d64e6e5..fb9c1bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,7 @@ gem2deb (0.17) UNRELEASED; urgency=medium
     - always print command lines used to run the tests
     - add support for passing options via the GEM2DEB_TEST_RUNNER environment
       variable
+    - add support for checking Rubygems dependencies during build
 
  -- Antonio Terceiro <terceiro at debian.org>  Sat, 16 May 2015 22:51:18 -0300
 
diff --git a/lib/gem2deb/test_runner.rb b/lib/gem2deb/test_runner.rb
index 98a390a..1b5812b 100644
--- a/lib/gem2deb/test_runner.rb
+++ b/lib/gem2deb/test_runner.rb
@@ -52,6 +52,14 @@ module Gem2Deb
       dirs
     end
 
+    def gem_path
+      if self.autopkgtest
+        ''
+      else
+        Dir.glob('debian/*/usr/share/rubygems-integration/*').join(':')
+      end
+    end
+
     def run_tests
       if check_dependencies
         do_check_dependencies
@@ -83,8 +91,9 @@ module Gem2Deb
       rubylib = load_path.join(':')
       cmd.unshift(rubyver)
 
-      puts "RUBYLIB=#{rubylib} " + cmd.shelljoin
+      puts "RUBYLIB=#{rubylib} " + "GEMPATH=#{gem_path} " +  cmd.shelljoin
 
+      ENV['GEMPATH'] = (ENV['GEMPATH'] ? ENV['GEMPATH'] + ':' : '') + gem_path
       ENV['RUBYLIB'] = (ENV['RUBYLIB'] ? ENV['RUBYLIB'] + ':' : '') + rubylib
       if autopkgtest
         move_away 'lib'

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