1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/rubygems
David Rodríguez 8e5fe13c08 [rubygems/rubygems] Delay fileutils loading to fix some warnings
If the following conditions are met:

* You have a default version of fileutils and a higher version of
fileutils installed as a regular gem. This case is common on ruby 2.6.

* You use a bundler generated binstub on a gem setup with a `Gemfile`
using the `gemspec` DSL.

Then `fileutils` redefinition warnings happen because of the following:

The gist of a bundler generated binstub is:

```ruby
require "bundler/setup"
load Gem.bin_path("rake", "rake")
```

First configure bundler, then load the requested gem.

When `require "bundler/setup"` is called under the previously mentioned
setup, `ext_conf_builder.rb` ends up being required because of the new
validation that gemspecs with rake extensions depend on `rake`. And that
loads the latest version of `fileutils` because of using "rubygems
monkeypatched require" that auto-chooses the latest version of default
gems.

After that, when `Gem.bin_path` gets called, `ext_conf_builder.rb` gets
required again, but this time already using "bundler's unmonkeypatched
require" which means the default version is chosen and thus the
redefinition warning happens.

The solution as usual is to lazily load `fileutils`.

https://github.com/rubygems/rubygems/commit/08d64e5f06
2020-06-05 07:32:42 +09:00
..
commands [rubygems/rubygems] Remove old gauntlet_rubygems file on rubygems upgrade 2020-05-08 14:13:29 +09:00
core_ext [rubygems/rubygems] Simplify nested require exceptions 2020-05-08 14:13:29 +09:00
ext [rubygems/rubygems] Delay fileutils loading to fix some warnings 2020-06-05 07:32:42 +09:00
package [rubygems/rubygems] Allow spaces in file headers during octal check 2020-05-08 14:13:29 +09:00
request
request_set
resolver [rubygems/rubygems] Remove misleading comment 2020-03-30 12:49:34 +09:00
security [rubygems/rubygems] Remove ruby 1.8 leftovers 2020-03-30 12:49:24 +09:00
source [rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygems 2020-03-30 12:42:10 +09:00
ssl_certs
util [rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygems 2020-03-30 12:42:10 +09:00
available_set.rb
basic_specification.rb [rubygems/rubygems] Fix platform comparison bug in #contains_requirable_file? 2020-05-08 07:38:50 +09:00
bundler_version_finder.rb Sync rubygems with current master (#2889) 2020-03-24 15:39:24 +09:00
command.rb [rubygems/rubygems] Specify explicit separator not to be affected by $; 2020-05-08 14:13:29 +09:00
command_manager.rb
compatibility.rb
config_file.rb Support XDG_* (#2174) 2020-04-23 19:16:06 +09:00
defaults.rb Support XDG_* (#2174) 2020-04-23 19:16:06 +09:00
dependency.rb
dependency_installer.rb [rubygems/rubygems] Rename version horizon deprecation methods 2020-05-08 07:38:50 +09:00
dependency_list.rb
deprecate.rb [rubygems/rubygems] Revert deprecation of deprecate method for now. 2020-05-08 07:38:50 +09:00
doctor.rb
errors.rb [rubygems/rubygems] Make MissingSpecError accept an extra error message 2020-05-08 14:13:29 +09:00
exceptions.rb
ext.rb
gem_runner.rb
gemcutter_utilities.rb Support XDG_* (#2174) 2020-04-23 19:16:06 +09:00
indexer.rb [rubygems/rubygems] Remove unnecessary code 2020-05-08 14:13:29 +09:00
install_default_message.rb
install_message.rb
install_update_options.rb [rubygems/rubygems] Enable Style/ExtraSpacing and auto-correct 2020-03-30 12:48:23 +09:00
installer.rb Revert a commit miss in "Fixed potential memory leak" 2020-05-22 21:24:51 +09:00
installer_test_case.rb [rubygems/rubygems] Fix symlink RubyGems test problems for non-admin user. 2020-05-08 14:13:29 +09:00
installer_uninstaller_utils.rb Sync rubygems with current master (#2889) 2020-03-24 15:39:24 +09:00
local_remote_options.rb
mock_gem_ui.rb
name_tuple.rb
package.rb Merge the current master branch of rubygems/rubygems. 2020-02-01 11:14:57 +09:00
package_task.rb [rubygems/rubygems] Make rake package log messages to stdout by default 2020-06-05 07:32:42 +09:00
path_support.rb
platform.rb [rubygems/rubygems] Enable Style/ExtraSpacing and auto-correct 2020-03-30 12:48:23 +09:00
psych_additions.rb
psych_tree.rb
query_utils.rb
rdoc.rb
remote_fetcher.rb [rubygems/rubygems] Enable Style/ExtraSpacing and auto-correct 2020-03-30 12:48:23 +09:00
request.rb
request_set.rb
requirement.rb
resolver.rb
s3_uri_signer.rb
safe_yaml.rb [rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygems 2020-03-30 12:42:10 +09:00
security.rb
security_option.rb
server.rb [rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygems 2020-03-30 12:42:10 +09:00
source.rb
source_list.rb
spec_fetcher.rb Sync rubygems with current master (#2889) 2020-03-24 15:39:24 +09:00
specification.rb [rubygems/rubygems] Revert adding loaded specs to Gem::Specification.stubs and Gem::Specification.stubs_for 2020-05-08 14:13:29 +09:00
specification_policy.rb Normalize heredoc case in rubygems code base 2020-05-08 07:38:50 +09:00
stub_specification.rb
syck_hack.rb
test_case.rb Revert "[rubygems/rubygems] Remove unneeded global teardown" 2020-05-08 14:13:29 +09:00
test_utilities.rb [rubygems/rubygems] Enable Style/ExtraSpacing and auto-correct 2020-03-30 12:48:23 +09:00
text.rb
uninstaller.rb Sync rubygems with current master (#2889) 2020-03-24 15:39:24 +09:00
uri_formatter.rb
uri_parser.rb
uri_parsing.rb
user_interaction.rb
util.rb [rubygems/rubygems] Improve gzip errors logging 2020-05-08 14:13:29 +09:00
validator.rb
version.rb [rubygems/rubygems] Enable Style/ExtraSpacing and auto-correct 2020-03-30 12:48:23 +09:00
version_option.rb