[rubygems/rubygems] Use SystemExit#status
as exit_code
No reasons to manage separately. https://github.com/rubygems/rubygems/commit/8ede5c886e
This commit is contained in:
parent
55c771c302
commit
a4e890b93e
@ -221,14 +221,12 @@ class Gem::SystemExitException < SystemExit
|
|||||||
##
|
##
|
||||||
# The exit code for the process
|
# The exit code for the process
|
||||||
|
|
||||||
attr_accessor :exit_code
|
alias exit_code status
|
||||||
|
|
||||||
##
|
##
|
||||||
# Creates a new SystemExitException with the given +exit_code+
|
# Creates a new SystemExitException with the given +exit_code+
|
||||||
|
|
||||||
def initialize(exit_code)
|
def initialize(exit_code)
|
||||||
@exit_code = exit_code
|
|
||||||
|
|
||||||
super exit_code, "Exiting RubyGems with exit_code #{exit_code}"
|
super exit_code, "Exiting RubyGems with exit_code #{exit_code}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -8,4 +8,10 @@ class TestExit < Gem::TestCase
|
|||||||
system(*ruby_with_rubygems_in_load_path, "-e", "raise Gem::SystemExitException.new(2)")
|
system(*ruby_with_rubygems_in_load_path, "-e", "raise Gem::SystemExitException.new(2)")
|
||||||
assert_equal 2, $?.exitstatus
|
assert_equal 2, $?.exitstatus
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_status
|
||||||
|
exc = Gem::SystemExitException.new(42)
|
||||||
|
assert_equal 42, exc.status
|
||||||
|
assert_equal 42, exc.exit_code
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user