diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index d61b8cb5ce..886bd66953 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -47,7 +47,7 @@ class Gem::ConfigFile DEFAULT_CONCURRENT_DOWNLOADS = 8 DEFAULT_CERT_EXPIRATION_LENGTH_DAYS = 365 DEFAULT_IPV4_FALLBACK_ENABLED = false - DEFAULT_INSTALL_EXTENSION_IN_LIB = false + DEFAULT_INSTALL_EXTENSION_IN_LIB = true ## # For Ruby packagers to set configuration defaults. Set in diff --git a/lib/rubygems/ext/cargo_builder.rb b/lib/rubygems/ext/cargo_builder.rb index 3e5f398c2d..c4feb26798 100644 --- a/lib/rubygems/ext/cargo_builder.rb +++ b/lib/rubygems/ext/cargo_builder.rb @@ -47,7 +47,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder nesting = extension_nesting(extension) - if !Gem.configuration.install_extension_in_lib && lib_dir + if Gem.configuration.install_extension_in_lib && lib_dir nested_lib_dir = File.join(lib_dir, nesting) FileUtils.mkdir_p nested_lib_dir FileUtils.cp_r dlext_path, nested_lib_dir, remove_destination: true diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb index 0b75a010db..de487484df 100644 --- a/lib/rubygems/ext/ext_conf_builder.rb +++ b/lib/rubygems/ext/ext_conf_builder.rb @@ -43,7 +43,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder full_tmp_dest = File.join(extension_dir, tmp_dest_relative) - if !Gem.configuration.install_extension_in_lib && lib_dir + if Gem.configuration.install_extension_in_lib && lib_dir FileUtils.mkdir_p lib_dir entries = Dir.entries(full_tmp_dest) - %w[. ..] entries = entries.map {|entry| File.join full_tmp_dest, entry } diff --git a/test/rubygems/test_gem_ext_builder.rb b/test/rubygems/test_gem_ext_builder.rb index 7c5556862b..d5812da2aa 100644 --- a/test/rubygems/test_gem_ext_builder.rb +++ b/test/rubygems/test_gem_ext_builder.rb @@ -162,7 +162,7 @@ install: extension_in_lib(false) do @orig_install_extension_in_lib = Gem.configuration.install_extension_in_lib - Gem.configuration.install_extension_in_lib = true + Gem.configuration.install_extension_in_lib = false @spec.extensions << "ext/extconf.rb"