summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
AgeCommit message (Collapse)Author
2020-06-05[rubygems/rubygems] Refactor `Gem.load_path_insert_index`David Rodríguez
https://github.com/rubygems/rubygems/commit/ae95885dff Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix performance regression in `require`David Rodríguez
Our check for `-I` paths should not go through all activated gems. https://github.com/rubygems/rubygems/commit/00d98eb8a3 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Remove explicit `psych` activationDavid Rodríguez
We don't need to explictly activate `psych` since `require` will take care of that automatically. We don't need to care about a minimum version either since the oldest ruby we support at the moment ships with a `psych` version higher than 2.0.0. https://github.com/rubygems/rubygems/commit/1ccf0912a1 Notes: Merged: https://github.com/ruby/ruby/pull/3184
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-08Normalize heredoc case in rubygems code baseDavid Rodríguez
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] Update minitest version in `Gem.install` docsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/aec3887d9c Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-04-23Support XDG_* (#2174)Hiroshi SHIBATA
* Support XDG_CONFIG_HOME for gemrc. * Support XDG_DATA_HOME for .gem * Added test for XDG_DATA_HOME * Do not reuse environmental variable. * Unify .rdoc path to RDoc.home. * Support XDG_DATA_HOME for .rdoc * Ignore exists? * Extracted config_home path * Use XDG_CONFIG_HOME for default credential path * Fixed inconsistency location. * Fixed the broken tests. * Support XDG_CONFIG_HOME for irbrc * Introduce Gem.cache_home as XDG_CACHE_HOME * Use Gem.cache_home instead of Gem.config_home for the credential file of RubyGems. * Initialized the old configurations * Fixed test failure related the configuration initialization * restore XDG_DATA_HOME * Fixed the broken examples of bundler with XDG_* * Do not modify environmental variable on test file * Use XDG_DATA_HOME insted of XDG_CACHE_HOME for credential file * stub out Gem.data_home * Move dir accessor to defaults.rb file * Use XDG_DATA_HOME for signed gem features * Use XDG_DATA_HOME for spec cache * Do not rely on Gem.user_home * Gem.user_home is always exists. Don't need to use FileUitls.mkdir_p * Bump support version to RubyGems 3.2.0+ * Removed the needless fallback configuration * Fixed the inconsistency methods that are find_config_file and config_file * Use Gem.configuration.credentials_path instead of hard-coded path * gem_path is always provided * Removed the duplicated code of find_home * Also removed the duplicated code of user_home * use Gem::UNTAINT instead of untaint for surpressing the warnings * Use File.directory * Restore XDG_DATA_HOME * Use File.write Notes: Merged-By: hsbt <hsbt@ruby-lang.org>
2020-03-30[rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygemsDavid Rodríguez
So it matches the style used by bundler. https://github.com/rubygems/rubygems/commit/ab0580fd65
2020-03-24Sync rubygems with current master (#2889)David Rodríguez
Notes: Merged-By: hsbt <hsbt@ruby-lang.org>
2020-02-01Merge the current master branch of rubygems/rubygems.Hiroshi SHIBATA
Just started to develop RubyGems 3.2.0.
2019-12-20Merge RubyGems 3.1.2Hiroshi SHIBATA
2019-12-16Merge RubyGems 3.1.1 and update the NEWS entry for RubyGemsHiroshi SHIBATA
2019-12-15Prepare to release rubygems-3.1.0Hiroshi SHIBATA
2019-12-13Prepare to release RubyGems 3.1.0 final version.Hiroshi SHIBATA
2019-11-13Merge released version of RubyGems 3.1.0.pre3Hiroshi SHIBATA
2019-11-12lib/rubygems.rb: Suppress "Resolving dependencies..."Yusuke Endoh
And suppress "Leaked file descriptor" again.
2019-11-11Merge RubyGems 3.1.0.pre3Hiroshi SHIBATA
* Fix gem pristine not accounting for user installed gems. Pull request #2914 by Luis Sagastume. * Refactor keyword argument test for Ruby 2.7. Pull request #2947 by SHIBATA Hiroshi. * Fix errors at frozen Gem::Version. Pull request #2949 by Nobuyoshi Nakada. * Remove taint usage on Ruby 2.7+. Pull request #2951 by Jeremy Evans. * Check Manifest.txt is up to date. Pull request #2953 by David Rodríguez. * Clarify symlink conditionals in tests. Pull request #2962 by David Rodríguez. * Update command line parsing to work under ps. Pull request #2966 by David Rodríguez. * Properly test `Gem::Specifications.stub_for`. Pull request #2970 by David Rodríguez. * Fix Gem::LOADED_SPECS_MUTEX handling for recursive locking. Pull request #2985 by MSP-Greg. Notes: Merged: https://github.com/ruby/ruby/pull/2666
2019-10-15[rubygems/rubygems] Bump version to 3.1.0.pre2Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/a7a673ce22
2019-09-26[rubygems/rubygems] Set SOURCE_DATE_EPOCH env var if not provided.Ellen Marie Dash
Fixes #2290. 1. `Gem::Specification.date` returns SOURCE_DATE_EPOCH when defined, 2. this commit makes RubyGems set it _persistently_ when not provided. This combination means that you can build a gem, check the build time, and use that value to generate a new build -- and then verify they're the same. https://github.com/rubygems/rubygems/commit/d830d53f59
2019-08-30Fix keyword argument separation issues in libJeremy Evans
Mostly requires adding ** in either calls or method definitions. Notes: Merged: https://github.com/ruby/ruby/pull/2395
2019-08-17[rubygems/rubygems] Don't unregister default specificationsDavid Rodríguez
I think this should be more efficient? https://github.com/rubygems/rubygems/commit/a1de78104f
2019-08-17[rubygems/rubygems] Fix removing unresolved default spec files from mapDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7964917bbc
2019-08-17[rubygems/rubygems] Little refactorDavid Rodríguez
There's already a method called `suffix_pattern`, that's different from this local variable. So, move the local variable to a `suffix_regexp` that clearly differenciates from `suffix_pattern`. https://github.com/rubygems/rubygems/commit/4ec69c48b9
2019-08-05[rubygems/rubygems] Use the standard RUBY_ENGINE_VERSION instead of ↵Benoit Daloze
JRUBY_VERSION * RUBY_ENGINE and RUBY_ENGINE_VERSION are defined on every modern Ruby. * There is no such constant as TRUFFLERUBY_VERSION or RBX_VERSION. https://github.com/rubygems/rubygems/commit/431d0aefdd
2019-08-05[rubygems/rubygems] Remove FIXME commentbronzdoc
https://github.com/rubygems/rubygems/commit/5a1d3d618d
2019-07-31[rubygems/rubygems] Remove missleading comment, no reason to move Gem.host ↵bronzdoc
to Gem::Util https://github.com/rubygems/rubygems/commit/e12c98aa72
2019-06-06Revert "Stop `circular require` warning"Kazuhiro NISHIYAMA
This reverts commit c2a9c350249588677cf68b506539093504927eac. It cannot stop `circular require` warning.
2019-06-06Stop `circular require` warningKazuhiro NISHIYAMA
2019-06-06lib/rubygems.rb: Stop "Leaked file descriptor" warningYusuke Endoh
Bundler.setup changes Gem::DefaultUserInteraction.ui and does not close it. This change makes sure that it is closed.
2019-06-01Merge rubygems master from upstream.Hiroshi SHIBATA
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
2019-05-25Show documents when completionaycabta
2019-04-28Update rubygems with latest upstream changesDavid Rodríguez
Closes: https://github.com/ruby/ruby/pull/2154
2019-04-23Revert "IRB is improved with Reline and RDoc, take 2"Nobuyoshi Nakada
Accidentally merged when 89271d4a3733bc5e70e9c56b4bd12f277e699c42 "Adjusted indents".
2019-04-23IRB is improved with Reline and RDoc, take 2aycabta
2019-04-21Revert "IRB is improved with Reline and RDoc"aycabta
This reverts commit 7f273ac6d0f05208b5b228da95205e20c0e8286c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20IRB is improved with Reline and RDocaycabta
Reline is a readline stdlib compatible library. It also supports multiline input. IRB is improved with Reline and supports multiline. Besides, supports showing documents when completed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-02Merge rubygems/rubygems from upstream.hsbt
The current master branch is https://github.com/rubygems/rubygems/commit/97b264f0fa248c864b6ee9a23d3ff1cdd217dddb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-14Merge RubyGems master@9be7858f7f17eae3058204f3c03e4b798ba18b9chsbt
This version contains the some style changes by RuboCop. * https://github.com/rubygems/rubygems/commit/9d810be0ede925fb2e3af535848582c3f8e0e72f * https://github.com/rubygems/rubygems/commit/61ea98a727fb1b76b6fac52d74107ee4b02aaef2 * https://github.com/rubygems/rubygems/commit/795893dce3c5f8540804fc08144cc6a90f086b13 * https://github.com/rubygems/rubygems/commit/9be7858f7f17eae3058204f3c03e4b798ba18b9c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-22Merge rubygems master targeted RubyGems 3.1.0.hsbt
https://github.com/rubygems/rubygems/commit/1172320540c8c33c59fc1db5191b021c3b2db487 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-01Merge rubygems-3.0.2.hsbt
https://blog.rubygems.org/2019/01/01/3.0.2-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-23Merge RubyGems 3.0.1 from rubygems/rubygems.hsbt
It fixed the issues of RubyGems 3.0.0. https://blog.rubygems.org/2018/12/23/3.0.1-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-19Merge RubyGems 3.0.0 from upstream.hsbt
https://blog.rubygems.org/2018/12/19/3.0.0-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-01Merge rubygems-3.0.0.beta3.hsbt
* [GSoC] Multi-factor feature for RubyGems https://github.com/rubygems/rubygems/pull/2369 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-21Merge master branch from rubygems/rubygems upstream.hsbt
* Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-03Merge rubygems-3.0.0.beta2.hsbt
* It enabled `USE_BUNDLER_FOR_GEMDEPS` for using gemdeps of rubygems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22Merge rubygems master branch from github.com/rubygems/rubygems.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-24Check whether to skip every framenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-24revert r64817: kernel_warn.rb: skip kernel_require.rbnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e