Skip to content
Browse files

Print an extra message when --debug is set

Many people file bugs against RubyGems because they don't know what
--debug (and $DEBUG) do to ruby.  Now we print a message that will
hopefully make it a bit more clear.
  • Loading branch information...
1 parent 858c2b0 commit 0edd6985ef54d6d5844ab5613004d4b21fb23ffe @drbrain drbrain committed Feb 5, 2014
Showing with 7 additions and 1 deletion.
  1. +2 −0 lib/rubygems/config_file.rb
  2. +5 −1 test/rubygems/test_gem_config_file.rb
View
2 lib/rubygems/config_file.rb
@@ -383,6 +383,8 @@ def handle_arguments(arg_list)
@backtrace = true
when /^--debug$/ then
$DEBUG = true
+
+ warn 'NOTE: Debugging mode prints all exceptions even when rescued'
else
@args << arg
end
View
6 test/rubygems/test_gem_config_file.rb
@@ -238,7 +238,11 @@ def test_handle_arguments_debug
args = %w[--debug]
- @cfg.handle_arguments args
+ _, err = capture_io do
+ @cfg.handle_arguments args
+ end
+
+ assert_match 'NOTE', err
assert_equal true, $DEBUG
ensure

0 comments on commit 0edd698

Please sign in to comment.
Something went wrong with that request. Please try again.