summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
AgeCommit message (Collapse)Author
2023-03-23util/rubocop -A --only Layout/EmptyLineAfterMagicCommentHiroshi 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 Lint/RescueExceptionHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/e8a5db50af Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-17util/rubocop -A --only Style/RedundantSelfHiroshi SHIBATA
2023-03-17util/rubocop -A --only Style/SymbolProcHiroshi SHIBATA
2023-03-17[rubygems/rubygems] util/rubocop -A --only Style/RedundantBeginHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/b595d3cf0f
2023-03-17[rubygems/rubygems] util/rubocop -A --only Style/DoubleNegationHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/01c2b5542f
2023-03-17[rubygems/rubygems] util/rubocop -A --only Style/YodaConditionHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3594945391
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 Layout/MultilineArrayBraceLayoutHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/f4f45ab27e
2023-03-17[rubygems/rubygems] Removed RUBY_PATCHLEVEL and modify condition for ↵Hiroshi SHIBATA
ruby_version https://github.com/rubygems/rubygems/commit/b420e287a3
2023-03-13[rubygems/rubygems] Removed `Gem.datadir`.Hiroshi SHIBATA
https://github.com/rubygems/rubygems/pull/2216 is imcomplete to remove this method. https://github.com/rubygems/rubygems/commit/34ef915d12
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-10Merge RubyGems and Bundler masterHiroshi SHIBATA
from https://github.com/rubygems/rubygems/commit/0635c1423db5d7c461d53bf0c3329bca75de7609 Notes: Merged: https://github.com/ruby/ruby/pull/7094
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-26Merge RubyGems/Bundler masterHiroshi SHIBATA
from https://github.com/rubygems/rubygems/commit/72fd3dd2096af16d797ad0cd8e0d2a8869e240b3 Notes: Merged: https://github.com/ruby/ruby/pull/7025
2022-12-25Update Bundler to 2.4.1 & and RubyGems to 3.4.1David Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/7020
2022-12-24Merge RubyGems-3.4.0 and Bundler-2.4.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6987
2022-12-02[rubygems/rubygems] Delete partial file and re-raise on Errno::ENOSPC.Ellen Marie Dash
Add test for not leaving empty files if ENOSPC is raised during 'gem install' https://github.com/rubygems/rubygems/commit/8e0e20f079
2022-12-02[rubygems/rubygems] require bundler/setup only when Bundler is not definedYusuke Endoh
... to prevent "circular require" when `--disable-gems` is used. This is a simplified case of https://github.com/ruby/ruby/commit/e5a0abc5dedfd011986b16e8f8cf5cda476984c9 ``` $ bundle exec ruby -we 'system("ruby", "-w", "--disable-gems", "-e", "")' <internal:/home/mame/work/ruby/local/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: <internal:/home/mame/work/ruby/local/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: loading in progress, circular require considered harmful - /home/mame/work/ruby/local/lib/ruby/3.2.0+3/bundler/setup.rb ``` When bundler/setup is require'ed under --disable-gems mode, it loads rubygems by `require "rubygems" unless defined?(Gem)` in https://github.com/rubygems/rubygems/blob/0b1f682a6d65e57b86ba4853cba23cac361c769d/bundler/lib/bundler/rubygems_integration.rb#L3 In this case, require'ing bundler/setup from rubygems.rb is circular. This change makes rubygems.rb to require "bundler/setup" only when `Bundler` is not defined. https://github.com/rubygems/rubygems/commit/b4608dee5e
2022-11-10[rubygems/rubygems] Load "bundler/setup" in lib/rubygems.rbYusuke Endoh
Ruby interpreter loads some special gems at startup: did_you_mean, error_highlight, and syntax_suggest. These gems are loaded before `bundler/setup` is loaded by `RUBYOPT=-rbundler/setup`. So, the versions of the gems are not controllable by Gemfile. This change will `require "bundler/setup"` in rubygems.rb (i.e., before the special gems are loaded). Now `bundle exec` sets an environment variable `BUNDLER_SETUP`, and rubygems requires the variable if defined. See also: https://bugs.ruby-lang.org/issues/19089 https://github.com/rubygems/rubygems/commit/963cb65a2d
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-08-03Merge rubygems/bundler HEADHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/8331e63263081a6aa690d8025d2957f30c4e814a Notes: Merged: https://github.com/ruby/ruby/pull/6209
2022-07-22RubyGems: Enable Style/StringLiterals copTakuya Noguchi
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-07-18[rubygems/rubygems] Move fileutils require to be even more lazyDavid Rodríguez
If directories are already created (the common case), fileutils won't be required at all. https://github.com/rubygems/rubygems/commit/63a9b94fc9
2022-06-27[rubygems/rubygems] Improve error message when `operating_system.rb` fails ↵David Rodríguez
to load Show an absolute path instead of an unhelpful relative path. https://github.com/rubygems/rubygems/commit/f1eed36e2f
2022-06-24Sync RubyGems & Bundler with upstream repoDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/6054
2022-06-06[rubygems/rubygems] Unify loading `Gem::Requirement`David Rodríguez
It was being explicitly required from `Gem::Specification` but also a strange autoload was set for it at `Gem::Version`. The autoload was non standard because it should've been done in the `Gem` module, not in `Gem::Specification`, since that's where the constant is expected to get defined. Doing this might get deprecated in the future, and it was not being effective anyways due to the explicit require. Unify everything with an `autoload` at the right place. https://github.com/rubygems/rubygems/commit/174ea3e24c
2022-05-20Merge RubyGems and Bundler HEADHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/125415593ead9ab69a9f0bb5392c9d7ec61b1f51
2022-04-28Merge ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3f7d0352e84b29d4a2d4cd93b31e5ebdb5f79cc6 Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28Merge rubygems master 1e4eda741d732ca1bd7031aef0a16c7348adf7a5Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-14[rubygems/rubygems] Fix formatting in docsPeter Zhu
rdoc uses + for typewriter font rather than backticks. https://github.com/rubygems/rubygems/commit/be320f1e0c
2022-03-15[rubygems/rubygems] Fix a typoKazuhiro NISHIYAMA
https://github.com/rubygems/rubygems/commit/3e06a91435
2022-01-20[rubygems/rubygems] Rename `Gem.open_with_flock` to `Gem.open_file`David Rodríguez
Since it only uses `flock` on Windows. https://github.com/rubygems/rubygems/commit/b877de4d9c
2022-01-20[rubygems/rubygems] Restrict `flock` to WindowsDavid Rodríguez
It was introduced to fix some race conditions there, but it doesn't seem necessary on other systems and it's actually causing issues there. https://github.com/rubygems/rubygems/commit/27b682c812
2022-01-19Merge rubygems/rubygems HEAD.Hiroshi SHIBATA
Picked at 12aeef6ba9a3be0022be9934c1a3e4c46a03ed3a Notes: Merged: https://github.com/ruby/ruby/pull/5462
2021-12-27Track RubyGems 3.4.0dev and Bundler 2.4.0devHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5350
2021-12-27[rubygems/rubygems] Make SpecificationPolicy autoload constantMasataka Pocke Kuwabara
It reduces memory usage about 204kb (1.4%). https://github.com/rubygems/rubygems/commit/b7d4b8c8a6 Notes: Merged: https://github.com/ruby/ruby/pull/5350
2021-12-25Merge RubyGems-3.3.3 and Bundler-2.3.3Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5342
2021-12-24[rubygems/rubygems] Do not use IO#flock on SolarisYusuke Endoh
`io.flock(File::LOCK_EX)` fails on Solaris when the io is opened as read-only. Due to this issue, `make install` of the ruby package failed on Solaris. https://github.com/rubygems/rubygems/commit/5905d17ab2
2021-12-24Merge RubyGems-3.3.2 and Bundler-2.3.2Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5334
2021-12-23Merge RubyGems-3.3.1 and Bundler-2.3.1Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5325
2021-12-21Merge RubyGems-3.3.0 and Bundler-2.3.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5317
2021-12-15[rubygems/rubygems] Pass `:bimode` explicitly to `File.open`David Rodríguez
The `File::BINARY` flag is apparently ignored due to a ruby bug, and thus writing can cause encoding issues. https://github.com/rubygems/rubygems/commit/db4efbebf2
2021-12-15Merge RubyGems and Bundler masterHiroshi SHIBATA
Merge from https://github.com/rubygems/rubygems/commit/793ad95ecb40e84a1dcb4cb60f2686843ed90de5 Notes: Merged: https://github.com/ruby/ruby/pull/5265
2021-12-10[rubygems/rubygems] Properly fetch Gem#latest_spec_for with multiple sourcesKevin Logan
https://github.com/rubygems/rubygems/commit/a93ec63df3
2021-12-01Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbdHiroshi SHIBATA
2021-11-30[rubygems/rubygems] Fix race condition when reading & writing gemspecs ↵David Rodríguez
concurrently When bundler parallel installer installs gems concurrently, one can get confusing warnings like the following: ``` "[/home/runner/work/rubygems/rubygems/bundler/tmp/2/gems/system/specifications/zeitwerk-2.4.2.gemspec] isn't a Gem::Specification (NilClass instead). ``` I've got these warnings several times in the past, but I never managed to reproduce them, and never look deeply into the root cause, but this time a got a cause that reproduced quite frequently, so I looked into it. The problem is one thread reading a gemspec while another thread is writing it. The write of the gemspec was not protected, so `Gem::Specification.load` could end up seeing a truncated gemspec and thus throw this warning. The fix involve two changes: * Change the methods that write gemspecs to use `Gem.binary_write` which is protected by a lock. * Fix `Gem.binary_write` to create the file lock at file creation time, not when the file already exists after. The realworld user problem caused by this issue happens in bundler, but I'm fixing it in rubygems first, and then I'll backport to bundler whatever needs backporting to fix the issue on the bundler side. https://github.com/rubygems/rubygems/commit/a672e7555c
2021-08-31[rubygems/rubygems] Prefer `require_relative` to `require` for internal requiresDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c74fc58695 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Replace StandardError with ExceptionDaniel Niknam
We think it's unlikely that `rubygems/defaults/operating_system` could be shipped with a SyntaxError so StandardError could be better choice to prevent "false positives" errors. https://github.com/rubygems/rubygems/commit/1f73e784dd Notes: Merged: https://github.com/ruby/ruby/pull/4789