[DRE-commits] [gemwatch] 01/01: run: more modern error handling
Antonio Terceiro
terceiro at moszumanska.debian.org
Thu Aug 6 17:47:51 UTC 2015
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository gemwatch.
commit 8d57e9ab0fbeaaf76b264e6ea75fd9b7f756f435
Author: Antonio Terceiro <terceiro at debian.org>
Date: Thu Aug 6 14:47:31 2015 -0300
run: more modern error handling
---
gemwatch.rb | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/gemwatch.rb b/gemwatch.rb
index 8cdef97..9b7746f 100644
--- a/gemwatch.rb
+++ b/gemwatch.rb
@@ -86,9 +86,11 @@ class GemWatch::Gem
File.basename(uri)
end
def run(*cmd)
- system(*cmd)
- if $? && ($? >> 8) > 0
- raise GemWatch::Gem::CommandFailed, "[#{cmd} failed!]"
+ subprocess = IO.popen(*cmd, :err => :out)
+ output = subprocess.read
+ subprocess.close
+ if $? && $?.exitstatus > 0
+ raise GemWatch::Gem::CommandFailed, "#{cmd} failed!\n" + output
end
end
def download(uri)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gemwatch.git
More information about the Pkg-ruby-extras-commits
mailing list