lib/ggem/git_repo.rb in ggem-1.9.5 vs lib/ggem/git_repo.rb in ggem-1.10.0
- old
+ new
@@ -2,10 +2,11 @@
require "pathname"
require "scmd"
module GGem; end
+
class GGem::GitRepo
NotFoundError = Class.new(ArgumentError)
CmdError = Class.new(RuntimeError)
attr_reader :path
@@ -46,10 +47,10 @@
def run_cmd(cmd_string)
cmd_string = "cd #{@path} && #{cmd_string}"
cmd = Scmd.new(cmd_string)
cmd.run
- if !cmd.success?
+ unless cmd.success?
raise CmdError, "#{cmd_string}\n" \
"#{cmd.stderr.empty? ? cmd.stdout : cmd.stderr}"
end
[cmd_string, cmd.exitstatus, cmd.stdout]
end