[DRE-commits] [gem2deb] 06/06: Gem2Deb#run: always print command lines being executed

Antonio Terceiro terceiro at moszumanska.debian.org
Sat Dec 20 15:10:29 UTC 2014


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

terceiro pushed a commit to branch master
in repository gem2deb.

commit b08bc1399bf435e1b40ab6426c387965510427dd
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sat Dec 20 13:07:18 2014 -0200

    Gem2Deb#run: always print command lines being executed
---
 debian/changelog    | 2 ++
 lib/gem2deb.rb      | 8 +++++++-
 test/test_helper.rb | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 91cb233..b1a450f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ gem2deb (0.11) UNRELEASED; urgency=medium
       test control data that uses gem2deb-test-runner will be used.
   * improved "usage: " banner in several of the provided programs
   * SetupRbInstaller: always use the system copy of setup.rb
+  * Gem2Deb#run: always print command lines being executed. This makes build
+    logs much more detailed, what is a good thing.
 
  -- Antonio Terceiro <terceiro at debian.org>  Wed, 15 Oct 2014 16:16:04 -0300
 
diff --git a/lib/gem2deb.rb b/lib/gem2deb.rb
index 548c882..12f84a6 100644
--- a/lib/gem2deb.rb
+++ b/lib/gem2deb.rb
@@ -21,6 +21,10 @@ require 'ruby_debian_dev'
 
 module Gem2Deb
 
+  class << self
+    attr_accessor :verbose
+  end
+
   class CommandFailed < Exception
   end
 
@@ -40,7 +44,7 @@ module Gem2Deb
   LIBDIR = File.expand_path(File.dirname(__FILE__))
 
   def run(*argv)
-    puts(_format_cmdline(argv)) if $VERBOSE
+    puts(_format_cmdline(argv)) if Gem2Deb.verbose
     system(*argv)
     if $?.exitstatus != 0
       raise Gem2Deb::CommandFailed, _format_cmdline(argv)
@@ -54,4 +58,6 @@ module Gem2Deb
   end
 end
 
+Gem2Deb.verbose = true
+
 require 'gem2deb/version'
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 9ec462b..1cbe137 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -6,6 +6,7 @@ require 'tmpdir'
 require 'tempfile'
 
 require 'gem2deb'
+Gem2Deb.verbose = false
 
 Gem2DebTestCase = Test::Unit::TestCase
 class Gem2DebTestCase

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