Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/zjit-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
rustup install ${{ matrix.rust_version }} --profile minimal
rustup default ${{ matrix.rust_version }}

- uses: taiki-e/install-action@13608cbb45b01feb47ef444ab1a42dc41ad56f1a # v2.79.11
- uses: taiki-e/install-action@e49978b799e49ff429d162b7a30601a569ab6538 # v2.81.1
with:
tool: nextest@0.9
if: ${{ matrix.test_task == 'zjit-check' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
ruby-version: '3.1'
bundler: none

- uses: taiki-e/install-action@13608cbb45b01feb47ef444ab1a42dc41ad56f1a # v2.79.11
- uses: taiki-e/install-action@e49978b799e49ff429d162b7a30601a569ab6538 # v2.81.1
with:
tool: nextest@0.9
if: ${{ matrix.test_task == 'zjit-check' }}
Expand Down
10 changes: 6 additions & 4 deletions gc/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,14 @@ hash_foreach_replace(st_data_t key, st_data_t value, st_data_t argp, int error)
static int
hash_replace_ref(st_data_t *key, st_data_t *value, st_data_t argp, int existing)
{
if (rb_gc_location((VALUE)*key) != (VALUE)*key) {
*key = rb_gc_location((VALUE)*key);
VALUE new_key = rb_gc_location((VALUE)*key);
if (new_key != (VALUE)*key) {
*key = new_key;
}

if (rb_gc_location((VALUE)*value) != (VALUE)*value) {
*value = rb_gc_location((VALUE)*value);
VALUE new_value = rb_gc_location((VALUE)*value);
if (new_value != (VALUE)*value) {
*value = new_value;
}

return ST_CONTINUE;
Expand Down
15 changes: 14 additions & 1 deletion lib/rubygems/config_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,22 @@
# RubyGems options use symbol keys. Valid options are:
#
# +:backtrace+:: See #backtrace
# +:sources+:: Sets Gem::sources
# +:bulk_threshold+:: See #bulk_threshold
# +:verbose+:: See #verbose
# +:update_sources+:: See #update_sources
# +:concurrent_downloads+:: See #concurrent_downloads
# +:cert_expiration_length_days+:: See #cert_expiration_length_days
# +:install_extension_in_lib+:: See #install_extension_in_lib
# +:ipv4_fallback_enabled+:: See #ipv4_fallback_enabled
# +:global_gem_cache+:: See #global_gem_cache
# +:use_psych+:: See #use_psych
# +:gemhome+:: See #home
# +:gempath+:: See #path
# +:sources+:: Sets Gem::sources
# +:disable_default_gem_server+:: See #disable_default_gem_server
# +:ssl_verify_mode+:: See #ssl_verify_mode
# +:ssl_ca_cert+:: See #ssl_ca_cert
# +:ssl_client_cert+:: See #ssl_client_cert
#
# gemrc files may exist in various locations and are read and merged in
# the following order:
Expand Down
18 changes: 16 additions & 2 deletions test/rubygems/test_gem_config_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_initialize
fp.puts ":sources:"
fp.puts " - http://more-gems.example.com"
fp.puts "install: --wrappers"
fp.puts ":gemhome: /tmp/gems"
fp.puts ":gempath:"
fp.puts "- /usr/ruby/1.8/lib/ruby/gems/1.8"
fp.puts "- /var/ruby/1.8/gem_home"
Expand All @@ -61,6 +62,7 @@ def test_initialize
fp.puts ":cert_expiration_length_days: 28"
fp.puts ":install_extension_in_lib: false"
fp.puts ":ipv4_fallback_enabled: true"
fp.puts ":use_psych: true"
end

util_config_file
Expand All @@ -70,13 +72,15 @@ def test_initialize
assert_equal false, @cfg.update_sources
assert_equal %w[http://more-gems.example.com], @cfg.sources
assert_equal "--wrappers", @cfg[:install]
assert_equal "/tmp/gems", @cfg.home
assert_equal(["/usr/ruby/1.8/lib/ruby/gems/1.8", "/var/ruby/1.8/gem_home"],
@cfg.path)
assert_equal 0, @cfg.ssl_verify_mode
assert_equal "/etc/ssl/certs", @cfg.ssl_ca_cert
assert_equal 28, @cfg.cert_expiration_length_days
assert_equal false, @cfg.install_extension_in_lib
assert_equal true, @cfg.ipv4_fallback_enabled
assert_equal true, @cfg.use_psych
end

def test_initialize_ipv4_fallback_enabled_env
Expand Down Expand Up @@ -105,17 +109,27 @@ def test_initialize_global_gem_cache_env

def test_initialize_global_gem_cache_gemrc
File.open @temp_conf, "w" do |fp|
fp.puts "global_gem_cache: true"
fp.puts ":global_gem_cache: true"
end

util_config_file %W[--config-file #{@temp_conf}]

assert_equal true, @cfg.global_gem_cache
end

def test_initialize_use_psych_env
orig_use_psych = ENV["RUBYGEMS_USE_PSYCH"]
ENV["RUBYGEMS_USE_PSYCH"] = "true"
util_config_file %W[--config-file #{@temp_conf}]

assert_equal true, @cfg.use_psych
ensure
ENV["RUBYGEMS_USE_PSYCH"] = orig_use_psych
end

def test_initialize_concurrent_downloads
File.open @temp_conf, "w" do |fp|
fp.puts "concurrent_downloads: 2"
fp.puts ":concurrent_downloads: 2"
end

util_config_file %W[--config-file #{@temp_conf}]
Expand Down