summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-05-08[rubygems/rubygems] Improve gzip errors loggingDavid Rodríguez
By default, the `Zlib::GzipFile::Error` does not include the actual data that was not in gzip format that caused the error. However, its `#inspect` method includes it. I think this can be helpful to troubleshoot errors. https://github.com/rubygems/rubygems/commit/11c8717133 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Update util.rbSamuel Williams
Remove unused module variable. https://github.com/rubygems/rubygems/commit/98135bb3d8 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove old `gauntlet_rubygems` file on rubygems upgradeDavid Rodríguez
The file was removed at https://github.com/rubygems/rubygems/commit/65b709b095b8354ac2620d1a5d7d537e539f6498, shipped with rubygems 2.6.5. https://github.com/rubygems/rubygems/commit/739159a120 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Suppress warnings coming from `jar-dependencies`David Rodríguez
This is a default gem on jruby, which ships with a rubygems plugin, which prints warnings all over the place during our tests. This plugin is unnecessary from our tests, so I disable it through the `JARS_SKIP` environment variable provided by this gem. https://github.com/rubygems/rubygems/commit/0aabbcf269 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08Remove `builder` gem requirement for `gem regenerate_index`David Rodríguez
This requirement was introduced 14 years ago in 7ce7039b390440754954df5efea619e9f57ef823, and I don't think it's necessary anymore. I made several tests introducing UTF-8 characters in gemspec files and generating indexes out of them, and couldn't find any issues. Gemspecs are read with UTF-8 encoding these days. Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Use a local temporary directoryDavid Rodríguez
To make tests more deterministic, since `Dir.tmpdir` sometimes will return the current directory dependending on the writability of other paths, and in that case since the current directory is changed by our tests, tests can fail. Force a local tmp folder instead, which will always be writable. https://github.com/rubygems/rubygems/commit/3e522bac65 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] No longer necessaryDavid Rodríguez
Fixed in https://github.com/ruby/ruby/commit/45df1c24d269f93a2bc1e7a6fe0ffcecc1193051, released with ruby 2.3 https://github.com/rubygems/rubygems/commit/f8f67f3952 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Show gemspec location when a Gem::MissingSpecError is ↵bronzdoc
raised while trying to activate a gem https://github.com/rubygems/rubygems/commit/4da54a8e8b Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Make MissingSpecError accept an extra error messagebronzdoc
https://github.com/rubygems/rubygems/commit/b23d2421df Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Fix incorrect bundler version being requiredDavid Rodríguez
In ruby 2.7.0, there's a slight change in bundler's default gemspec file where the executable folder of the bundler gem is `libexec` instead of `exe`. I made that change in https://github.com/ruby/ruby/pull/2380 to try to simplify the integration of the `bundler` gem with upstream, minimizing the number of changes that need to be made to the gemspec to adapt to the structure of ruby-core. That worked ok, expected for this issue. The new name of the folder including the executable files uncovered a bug in rubygems, which is the following: * In order to be able to use newer versions of default gems, `rubygems` ships with a customized `require` that has knowledge about which files belong to which default gem. If one of these files is required, `rubygems` will detect that and activate its gem mechanism to choose the newest version of the corresponding default gem present in the system (unless a different version has already been activated). It's this part of the custom require: https://github.com/rubygems/rubygems/blob/ea3e6f194df500b028b52b3b64decbd3df1d5ab0/lib/rubygems/core_ext/kernel_require.rb#L77-L85 * In order to do that, `rubygems` registers a map of default gems and their files when it is first required: https://github.com/rubygems/rubygems/blob/ea3e6f194df500b028b52b3b64decbd3df1d5ab0/lib/rubygems.rb#L1247-L1276 As explained in the method's header, two types of default gem specifications are supported. One of the formats is the style used by some ruby-core gemspec files, where paths inside the `spec.files` array don't include the `spec.require_paths` part. So in this "old style", if a gem ships with a `lib/bundler.rb` file, it will be registered in this array as `spec.files = ["bundler.rb"]`, not as `spec.files = ["lib/bundler.rb"]`. The `Gem.register_default_spec` method "detects" this style by making sure that none of the files in the `spec.files` array start with any of the `spec.require_paths`. * Since in ruby 2.7 the default specification file of the `bundler` gem includes a `libexec/bundle` file, this check would no longer work correctly, because even though the specification file is still "old style", it has one registered file which starts with "lib", one of the "require paths" of the gem. * This means that the gem is incorrectly detected as "new style", but since none of the paths start with "lib/", no files are actually registered, so the gem is not being considered a default gem, and thus the default version is always used with no possibility of being "upgraded". The fix of the problem is simple: check that no files start with `lib/` (or any other require paths), instead of with "lib" which doesn't exclude other potential "non requirable folder" starting with lib, like in the `bundler` case. https://github.com/rubygems/rubygems/commit/94df740c2b Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Extract logic to a local variable for later reuseDavid Rodríguez
https://github.com/rubygems/rubygems/commit/dc715888d4 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Specify explicit separator not to be affected by $;Nobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/1cea3d4dce Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Properly look for man pagesDavid Rodríguez
When bundler is installed as a default gem (either by ruby's or by rubygems' installer), bundler man pages wouldn't be properly found. https://github.com/rubygems/rubygems/commit/0831b40492 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Extract a local variableDavid Rodríguez
https://github.com/rubygems/rubygems/commit/445c9da2ac Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Install man files when bundler installed as a default gemDavid Rodríguez
https://github.com/rubygems/rubygems/commit/28d6d77d81 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Extract a `remove_file_list` helperDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8cc6087590 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Only need to call helper onceDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6ddbf5bcab Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Extract an `install_file_list` helperDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5106ea4582 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Move helper to private sectionDavid Rodríguez
https://github.com/rubygems/rubygems/commit/fb824b7a81 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Rename method to clarifyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6dc76146ad Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Prefer `tr` to `gsub` when replacing path separatorsDavid Rodríguez
This is not detected by the `Performance/StringReplacement` cop, I guess because of using constants. But still seems like a good change. Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com> https://github.com/rubygems/rubygems/commit/f862103133 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Shortcuit method earlierDavid Rodríguez
If the class variable is set, we can skip the whole thing from the beginning. Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com> https://github.com/rubygems/rubygems/commit/83abf3a3d4 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Fix incorrect `gem uninstall --all` messageDavid Rodríguez
Currently `gem uninstall --all` shows the following incorrect message after completion: ``` INFO: Uninstalled all gems in ``` Now it shows something that actually makes sense like: ``` INFO: Uninstalled all gems in /home/deivid/Code/rubygems/tmp/test_rubygems_6986/gemhome ``` https://github.com/rubygems/rubygems/commit/8fa05e8f8c Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Refactor duplicate metadata logicThomas McDonald
https://github.com/rubygems/rubygems/commit/1e5ef177ac Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unnecessary codeThomas McDonald
`@host` _could_ be `nil` at this point, but only if all the conditions above for setting `@host` were `nil`. In that case, it is guaranteed to `default_gem_server` metadata is `nil` since it's one of the branches in that condition. So this code would just be setting an already `nil` variable to `nil`. Hence, not needed. https://github.com/rubygems/rubygems/commit/e3ccff3c5c Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Simplify host switching logicThomas McDonald
This block was a branch and variable heavy way of saying use the user-provided host if available, or fall-back to the default host if none of the other options match. IMO the resultant single-if condition is clearer in intentions https://github.com/rubygems/rubygems/commit/42dbb71cfa Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Refactor ruby command line building for testsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/43819b6973 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unnecessary `@@ruby` variableDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5f20647ec1 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Simplify nested require exceptionsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7fbef2f0e3 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Fix symlink RubyGems test problems for non-admin user.Josef Šimánek
https://github.com/rubygems/rubygems/commit/75f672ff0e Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Fix race condition on bundler's parallel installerDavid Rodríguez
When installing in parallel, bundler creates several `Gem::Installer` instances that run in parallel. These installers access the `@@all` class variable of `Gem::Specification` concurrently. If a concurrent thread calls `Gem::Specification.reset` (resetting `@all` to `nil`) while another thread is running `Gem::Specification._all` or another method that expects `@@all` to be loaded and not `nil`, that can result in `Enumerable` methods being called on `nil`, resulting in crashes. I fix it by protecting the other concurrent access to the `@all` variable. https://github.com/rubygems/rubygems/commit/58b343c530 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Allow spaces in file headers during octal checkDmytro Shyrshov
https://github.com/rubygems/rubygems/commit/e9e25731d8 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08Normalize heredoc case in rubygems code baseDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08Normalize heredoc delimitersDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Fix platform comparison bug in #contains_requirable_file?Benoit Daloze
* One should not compare RUBY_ENGINE and Gem::Platform. * Introduced in https://github.com/rubygems/rubygems/pull/2672 https://github.com/rubygems/rubygems/commit/0e62c3be91 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Autoload name_tuple.rb before useOlle Jonsson
- Resolver asked Molinillo to resolve-then-activate, which led to using Gem::NameTuple before any require had been passed Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> https://github.com/rubygems/rubygems/commit/e11782b0c8 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Do not use set.Josef Šimánek
https://github.com/rubygems/rubygems/commit/1a72c8796f Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Add gem build test to check for removed methods.Josef Šimánek
https://github.com/rubygems/rubygems/commit/c07b9cf4f1 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Track removed methods calls and warn during build time.Josef Šimánek
move rubyforge_project= to removed methods https://github.com/rubygems/rubygems/commit/223f7fd470 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Deprecate rubyforge_project attribute only during build ↵Josef Šimánek
time. https://github.com/rubygems/rubygems/commit/c44eb21648 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Revert deprecation of deprecate method for now.Josef Šimánek
https://github.com/rubygems/rubygems/commit/965eee1741 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Restore and deprecate old deprecate methodbronzdoc
https://github.com/rubygems/rubygems/commit/024267fa60 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Rename version horizon deprecation methodsbronzdoc
https://github.com/rubygems/rubygems/commit/6afd914fda Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Add next_rubygems_major_version methodbronzdoc
https://github.com/rubygems/rubygems/commit/db5bb65baf Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Modify files to use new version horizon deprecationsbronzdoc
https://github.com/rubygems/rubygems/commit/4fe5bb5bf3 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Use the next major version as default for deprecationsbronzdoc
https://github.com/rubygems/rubygems/commit/b679ab27af Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Remove deprecation methods by datebronzdoc
https://github.com/rubygems/rubygems/commit/3a14635cf5 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Make the deprecate_command method recieve a Rubygems ↵bronzdoc
version instead of a date https://github.com/rubygems/rubygems/commit/bf95b1de78 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Make the deprecate method recieve a Rubygems version ↵bronzdoc
instead of a date https://github.com/rubygems/rubygems/commit/f0e098a1b7 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Removed deprecated methods for Minitest5Hiroshi SHIBATA
It was migrated on ruby core repository too. https://github.com/ruby/ruby/commit/e5db3da9d34f0a7595208863301c044b612adbed https://github.com/rubygems/rubygems/commit/848bbe3c76 Notes: Merged: https://github.com/ruby/ruby/pull/3087