ruby-changes:72829
From: David <ko1@a...>
Date: Fri, 5 Aug 2022 16:37:13 +0900 (JST)
Subject: [ruby-changes:72829] f310ac1cb2 (master): [rubygems/rubygems] Include backtrace with crashes by default
https://git.ruby-lang.org/ruby.git/commit/?id=f310ac1cb2 From f310ac1cb2964f635f582862763b2155aacf2c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Wed, 3 Aug 2022 10:47:40 +0200 Subject: [rubygems/rubygems] Include backtrace with crashes by default https://github.com/rubygems/rubygems/commit/3cc3bfd371 --- lib/rubygems/config_file.rb | 2 +- test/rubygems/test_gem_config_file.rb | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index d711a51bd0..8d64b58cb9 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -39,7 +39,7 @@ require "rbconfig" https://github.com/ruby/ruby/blob/trunk/lib/rubygems/config_file.rb#L39 class Gem::ConfigFile include Gem::UserInteraction - DEFAULT_BACKTRACE = false + DEFAULT_BACKTRACE = true DEFAULT_BULK_THRESHOLD = 1000 DEFAULT_VERBOSITY = true DEFAULT_UPDATE_SOURCES = true diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb index fbc7c85757..e23773a133 100644 --- a/test/rubygems/test_gem_config_file.rb +++ b/test/rubygems/test_gem_config_file.rb @@ -35,7 +35,7 @@ class TestGemConfigFile < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L35 def test_initialize assert_equal @temp_conf, @cfg.config_file_name - assert_equal false, @cfg.backtrace + assert_equal true, @cfg.backtrace assert_equal true, @cfg.update_sources assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold assert_equal true, @cfg.verbose @@ -239,6 +239,12 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L239 end def test_handle_arguments_backtrace + File.open @temp_conf, "w" do |fp| + fp.puts ":backtrace: false" + end + + util_config_file %W[--config-file=#{@temp_conf}] + assert_equal false, @cfg.backtrace args = %w[--backtrace] @@ -275,6 +281,12 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L281 end def test_handle_arguments_traceback + File.open @temp_conf, "w" do |fp| + fp.puts ":backtrace: false" + end + + util_config_file %W[--config-file=#{@temp_conf}] + assert_equal false, @cfg.backtrace args = %w[--traceback] @@ -288,7 +300,7 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L300 assert_equal @temp_conf, @cfg.config_file_name File.open @temp_conf, "w" do |fp| - fp.puts ":backtrace: true" + fp.puts ":backtrace: false" fp.puts ":update_sources: false" fp.puts ":bulk_threshold: 10" fp.puts ":verbose: false" @@ -300,7 +312,7 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L312 util_config_file args - assert_equal false, @cfg.backtrace + assert_equal true, @cfg.backtrace assert_equal true, @cfg.update_sources assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold assert_equal true, @cfg.verbose @@ -386,7 +398,7 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L398 end def test_write - @cfg.backtrace = true + @cfg.backtrace = false @cfg.update_sources = false @cfg.bulk_threshold = 10 @cfg.verbose = false @@ -398,7 +410,7 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L410 util_config_file # These should not be written out to the config file. - assert_equal false, @cfg.backtrace, "backtrace" + assert_equal true, @cfg.backtrace, "backtrace" assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold, "bulk_threshold" assert_equal true, @cfg.update_sources, "update_sources" -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/