summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext
AgeCommit message (Collapse)Author
2025-07-14[rubygems/rubygems] Avoid more warnings when using RubyGems with old BundlerDavid Rodríguez
We were only avoiding them when the RUBYGEMS_GEMDEPS variable is used. Avoid the warnings in general, whenever the entrypoint to Bundler is `require`. https://github.com/rubygems/rubygems/commit/8683faef36
2024-10-04[rubygems/rubygems] Update required_ruby_version to 3.1Samuel Giddins
3.0 has been EOL since march, drop support for it before the 3.4 release is cut Signed-off-by: Samuel Giddins <segiddins@segiddins.me> https://github.com/rubygems/rubygems/commit/fc1f03b06a
2024-01-22Reapply "[rubygems/rubygems] Fix activation conflicts when circularly ↵Hiroshi SHIBATA
requiring a gem" This reverts commit 04cf66765a8a9d48baea6d9aee266dc9aa21df27.
2024-01-22Reapply "[rubygems/rubygems] Fix `require` of a default gem when unresolved ↵Hiroshi SHIBATA
gems depend on it" This reverts commit 54552b89e73fc616ba47c1c87d33625af99cbce9.
2024-01-19Revert "[rubygems/rubygems] Fix `require` of a default gem when unresolved ↵Hiroshi SHIBATA
gems depend on it" This reverts commit f1f5f22d22a149f20e019728b1ab35593d29d81a.
2024-01-19Revert "[rubygems/rubygems] Fix activation conflicts when circularly ↵Hiroshi SHIBATA
requiring a gem" This reverts commit db44088c2a92040879386aa5f268db4c858e4e5b. https://github.com/ruby/ruby/actions/runs/7578672002/job/20641640821 https://github.com/ruby/ruby/actions/runs/7578672002/job/20641641212 https://github.com/ruby/ruby/actions/runs/7578672002/job/20641642031
2024-01-19[rubygems/rubygems] Fix activation conflicts when circularly requiring a gemDavid Rodríguez
If a gem is required circular, and there are unresolved specs depending on it, we may end up in an activation conflict. The solution is to not try to activate unresolved gems when requiring a default gem, regardless of it having already been activated or not. https://github.com/rubygems/rubygems/commit/3b2b8f4e3e
2024-01-19[rubygems/rubygems] Fix `require` of a default gem when unresolved gems ↵David Rodríguez
depend on it The following conditions must be met: * A default gem is required. * A previous require left some gems unresolved, and those dependencies themselves depend on the default gem. In this case, rubygems require will first activate the default version of the gem, then try to activate another unresolved version of the default gem that conflicts with the first activation. The solution is, if we are in the middle of requiring a default gem, skip this step, because we have already activated it successfully. https://github.com/rubygems/rubygems/commit/8cd5608db5 Co-authored-by: Stan Hu <stanhu@gmail.com>
2024-01-19[rubygems/rubygems] Add a comment to explain default gem activationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/291128268f
2023-11-13[rubygems/rubygems] Remove now unnecessary dupsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/56ce2a6445
2023-11-13[rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in RubyGemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/10c26a483d
2023-07-30[rubygems/rubygems] Use the dedicated method to convert file pathNobuyoshi Nakada
The dedicated method `File.path` to deal with pathname-like objects has been provided since ruby 1.9.0. Also adds a test for rubygems/rubygems#6837. https://github.com/rubygems/rubygems/commit/258c6eda80
2023-07-28Warn default gems which will be gemified in futureNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8126
2023-07-25[rubygems/rubygems] Simplify double loopNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/630dc02112
2023-07-25[rubygems/rubygems] Use `Monitor#synchronize` to ensure to exitNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/b424353239
2023-03-23util/rubocop -A --only Layout/EmptyLineAfterMagicCommentHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23util/rubocop -A --only Style/FrozenStringLiteralCommentHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] Enabled Style/RedundantReturn copHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/05cc97bdf8 Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Style/NextHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/e5868e92f7 Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Lint/RescueExceptionHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/e8a5db50af Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Lint/EmptyExpressionHiroshi SHIBATA
Thread.report_on_exception is always defined after Ruby 2.4 or later. https://github.com/rubygems/rubygems/commit/274da54f38 Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-17util/rubocop -A --only Style/SymbolProcHiroshi SHIBATA
2023-03-17[rubygems/rubygems] util/rubocop -A --only Style/ClassCheckHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/1c3356a872
2023-03-17[rubygems/rubygems] util/rubocop -A --only Style/StringLiteralsInInterpolationHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/cb554f6eb7
2023-03-17[rubygems/rubygems] util/rubocop -A --only Style/AliasHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/fba6e94de9
2023-03-17[rubygems/rubygems] util/rubocop -A --only Layout/EmptyLinesAroundModuleBodyHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/48c88466b7
2023-03-17[rubygems/rubygems] util/rubocop -A --only Performance/DoubleStartEndWithHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/893da27e7c
2023-03-17[rubygems/rubygems] Remove ensure part in requireDavid Rodríguez
I've seen this error sometimes but never found it helpful, since the culprit has never been thread/monitor related, so it just adds noise. Right now I'm seeing an issue in CI where we seem to be crashing during ensure and showing a weird backtrace: ``` #<Thread:0x000055821d7a73b8 /home/runner/work/rubygems/rubygems/lib/rubygems/request_set.rb:167 run> terminated with exception (report_on_exception is true): /home/runner/work/rubygems/rubygems/lib/rubygems/platform.rb:141:in `==': undefined local variable or method `to_a' for false:FalseClass (NameError) Did you mean? to_s from /home/runner/work/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb:168:in `!=' from /home/runner/work/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb:168:in `require' from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:441:in `block in ensure_subdirectories' from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:437:in `each' from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:437:in `ensure_subdirectories' from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:413:in `ensure_gem_subdirectories' from /home/runner/work/rubygems/rubygems/lib/rubygems/resolver/specification.rb:110:in `download' from /home/runner/work/rubygems/rubygems/lib/rubygems/request_set.rb:173:in `block (2 levels) in install' ``` Let's get this out of the picture in case that helps clarify the culprit. https://github.com/rubygems/rubygems/commit/87ce40b70e
2023-01-31[rubygems/rubygems] Allow disabling RubyGems require decorationsDavid Rodríguez
Currently Bundler needs to do cumbersome operations to revert custom RubyGems require on a `bundler/setup` context. This causes issues when third party gems also monkeypatch require, since Bundler will also undo those decorations. This commit allows it to use the simpler approach of properly telling RubyGems that it needs to default to built-in require without any extra magic. https://github.com/rubygems/rubygems/commit/1df5009e14 Co-authored-by: Xavier Noria <fxn@hashref.com> Notes: Merged: https://github.com/ruby/ruby/pull/7203
2023-01-08[rubygems/rubygems] [DOC] Remove internal document about `Kernel` monkey patchNobuyoshi Nakada
https://bugs.ruby-lang.org/issues/19285 https://github.com/rubygems/rubygems/commit/1e22219ed4
2023-01-08[rubygems/rubygems] `LoadError#path` on the caught exception does not need ↵Nobuyoshi Nakada
to protect https://github.com/rubygems/rubygems/commit/a31f5d1a18
2023-01-08[rubygems/rubygems] Let RDoc parse the doc of `Kernel#require`Nobuyoshi Nakada
Since RDoc does not parse string literals as documents, `eval` the entire file instead of embedding in a here-document. On the contrary, as `gem_original_require` alias is an implementation detail but not for users, it should not be documented. https://github.com/rubygems/rubygems/commit/cad4cf16cf
2022-12-12Merge RubyGems/Bundler masterHiroshi SHIBATA
from https://github.com/rubygems/rubygems/commit/bfb0ae69776069155d2092702bfbb5a12617d85a Notes: Merged: https://github.com/ruby/ruby/pull/6906
2022-10-22[rubygems/rubygems] Allow upcoming JRuby to pass keywords for Kernel#warnThomas E. Enebo
jruby-head (which will be JRuby 9.4.0.0) can now properly process the keywords to Kernel#warn. I cannot think of any capability based test for this so I constrained it using a version guard. Only JRuby will ever hit the version guard. https://github.com/rubygems/rubygems/commit/cd468c7e0f
2022-08-09Merge rubygems/bundler HEAD.Hiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/dfbb5a38114640e0d8d616861607f3de73ee0199 Notes: Merged: https://github.com/ruby/ruby/pull/6224
2022-07-22RubyGems: Enable Style/StringLiterals copTakuya Noguchi
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-06-24Sync RubyGems & Bundler with upstream repoDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/6054
2021-07-07Sync RubyGems and Bundler with upstreamHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4634
2021-03-08Sync latest development version of bundler & rubygemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4143
2020-12-08Merge prepare version of RubyGems 3.2.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3864
2020-09-23Revert "Manually merged from https://github.com/rubygems/rubygems/pull/2636"Hiroshi SHIBATA
31a6eaabc165d8a222e176f2c809d90622d88ec2 is obsoleted with https://github.com/rubygems/rubygems/pull/3820
2020-09-23Manually merged from https://github.com/rubygems/rubygems/pull/2636Hiroshi SHIBATA
Enable Style/EmptyLinesAroundClassBody rubocop cop.
2020-07-31[rubygems/rubygems] Fix Kernel#warn override to handle backtrace location ↵Jeremy Evans
with nil path It's very unlikely to hit this case, but it is possible, as Thread::Backtrace::Location#path can return nil if the location is a cfunc with no previous iseq. See location_path in vm_backtrace.c in Ruby. https://github.com/rubygems/rubygems/commit/511935645a Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31[rubygems/rubygems] Ignore internal frames in RubyGems' Kernel#warnBenoit Daloze
* See https://github.com/oracle/truffleruby/issues/2046 * `<internal:` is a common prefix also used by core Ruby files in CRuby. * test_no_kernel_require_in_*warn_with_uplevel already test this. * Unfortunately just skipping `<internal:` in the Ruby implementation is not enough, because RubyGems' #warn would not skip the `<internal:` require (TruffleRuby defines #require in Ruby), and the Ruby implementation's #warn would not skip RubyGems's #require. The #caller_locations(0) look like this: warnee.rb:1:in `<top (required)>' # where #warn is called <internal:core> core/kernel.rb:234:in `gem_original_require' # not skipped by RubyGems' warn, skipped by the Ruby impl rubygems/core_ext/kernel_require.rb:54:in `require' # not skipped by the Ruby impl's warn, what would be shown without this fix warn.rb:1:in `<main>' # what would be correct warn.rb is require "warnee" warnee.rb is puts caller_locations(0), nil warn "oops", uplevel: 1 https://github.com/rubygems/rubygems/commit/7c838f7419 Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31Enforce no empty lines around class body in rubygemsDavid Rodríguez
To normalize the code style with `bundler`. Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-06-15Use space inside block braces everywhereDavid Rodríguez
To make rubygems code style consistent with bundler. Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-05[rubygems/rubygems] Use LoadError#path to figure out the argument passed to ↵Yuki Nishijima
'require' https://github.com/rubygems/rubygems/commit/5995394ec4 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Remove direct reference to PRDavid Rodríguez
The code is quite different now, so I think the link might be even confusing. If you want to know more, use git history. https://github.com/rubygems/rubygems/commit/db872c7a18 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix `$LOADED_FEATURES` cache sometimes not respectedDavid Rodríguez
In the cases where the initial manually `-I` path resolution succeeded, we were passing a full path to the original require effectively skipping the `$LOADED_FEATURES` cache. With this change, we _only_ do the resolution when a matching requirable path is found in a default gem. In that case, we skip activation of the default gem if we detect that the required file will be picked up for a `-I` path. https://github.com/rubygems/rubygems/commit/22ad5717c3 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Extract a local outside the loopDavid Rodríguez
https://github.com/rubygems/rubygems/commit/da1492e9d7 Notes: Merged: https://github.com/ruby/ruby/pull/3184