aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems
Commit message (Collapse)AuthorAgeFilesLines
* [rubygems/rubygems] Revert "Merge pull request #7148 from ↵David Rodríguez2023-12-081-1/+1
| | | | | | | | | Paul-Bob/improvement/include_response_body_on_fetch_http_error" This reverts commit https://github.com/rubygems/rubygems/commit/e5a4fd9eb617, reversing changes made to https://github.com/rubygems/rubygems/commit/c5a5363b0c98. https://github.com/rubygems/rubygems/commit/e21c45c4c3
* [rubygems/rubygems] Extract generate_index command to ↵Samuel Giddins2023-12-084-504/+41
| | | | | | | | | | | | | | | | rubygems-generate_index gem So generate_index can be implemented with dependencies, such as the compact index Took this approach from feedback in https://github.com/rubygems/rubygems/pull/6853 Running `gem generate_index` by default will use an installed rubygems-generate_index, or install and then use the command from the gem Apply suggestions from code review https://github.com/rubygems/rubygems/commit/fc1cb9bc9e Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
* [rubygems/rubygems] Use modern hashes consistentlyDavid Rodríguez2023-12-0744-338/+338
| | | | https://github.com/rubygems/rubygems/commit/bb66253f2c
* [rubygems/rubygems] Make --build-root disable auto-user-install.Ellen Marie Dash2023-12-071-8/+10
| | | | https://github.com/rubygems/rubygems/commit/6a06b0763f
* [rubygems/rubygems] Better approach to falling back to user installation ↵David Rodríguez2023-12-073-35/+9
| | | | | | when GEM_HOME not writable https://github.com/rubygems/rubygems/commit/f67bced16b
* [rubygems/rubygems] Use globals variables for standard input/outputVít Ondruch2023-12-071-4/+4
| | | | | | | | | | | Replace use of `STDIN`, `STDOUT` and `STDERR` constants by their `$stdin`, `$stdout` and `$stderr` global variable equivalents. This enables easier testing via standard means, such as `assert_output` for minitest or `expect { print 'foo' }.to output.to_stdout` for RSpec test suites. https://github.com/rubygems/rubygems/commit/a0a6fc1b76
* [rubygems/rubygems] Gem::UpdateSuggestion uses Gem::CIDetectorEric Mueller2023-12-061-14/+1
| | | | https://github.com/rubygems/rubygems/commit/e5b0458342
* [rubygems/rubygems] Introduce the Gem::CIDetectorEric Mueller2023-12-061-0/+75
| | | | | | | | | | | | | | | | | | | | | | This is based on the list in Gem::UpdateSuggestion and Bundler::Fetcher; these have similar purposes (determining whether/what CI we're executing in), and can benefit from being combined and updated (they're both slightly out of date). Noteable changes: * We'll consider ourselves to be on a CI in more cases - if CI_NAME or TASKCLUSTER_ROOT_URL are set specifically, since those represent two cases that were either overlooked or are no longer covered by the existing implementation. (Or possibly TaskCluster still does provide RUN_ID, but failed to document it) * We will notice/track a few additional services in ci_strings (cirrus, dsari, taskcluster), stop tracking 'snap' (they went under in 2017), and update buildbox to buildkite (they've been called that for 8 years, and the BUILDBOX envs have been deprecated for 3). * We'll also sort/uniq/downcase the values (all of which only matter because of the special case of CI_NAME). https://github.com/rubygems/rubygems/commit/60652b942f
* [rubygems/rubygems] Use String#unpack1 available since ruby 3.0Martin Emde2023-12-061-1/+1
| | | | https://github.com/rubygems/rubygems/commit/46258d6cb4
* [rubygems/rubygems] Instead of checking writability, try to writeDavid Rodríguez2023-12-051-1/+3
| | | | | | | | | | Checking writability is prone to errors. For example: $ mkdir -p foo/bar $ chmod -w foo $ touch foo/bar/baz # succeeds even if foo is not writable https://github.com/rubygems/rubygems/commit/6056138b6a
* [rubygems/rubygems] Prefer String#split with block in Gem::YAMLSerializer#loadMau Magnaguagno2023-12-051-1/+1
| | | | | | String#split supports a block since Ruby 2.6, avoiding intermediate array. https://github.com/rubygems/rubygems/commit/69cdf9e9d4
* [rubygems/rubygems] Only show "Defaulting to user installation" message when ↵Ellen Marie Dash2023-11-301-1/+11
| | | | | | it matters. https://github.com/rubygems/rubygems/commit/61b0947225
* [rubygems/rubygems] Fix typo missing doMau Magnaguagno2023-11-241-1/+1
| | | | https://github.com/rubygems/rubygems/commit/4eade32ad6
* [rubygems/rubygems] Prefer String#each_line in Gem::CommandMau Magnaguagno2023-11-241-4/+4
| | | | | | Replace ``String#split("\n").each`` with ``String#each_line``. https://github.com/rubygems/rubygems/commit/958744807d
* [rubygems/rubygems] improvement: include response body on fetch_http errorPaul Bob2023-11-141-1/+1
| | | | https://github.com/rubygems/rubygems/commit/de4189af35
* [rubygems/rubygems] TruffleRuby uses a bash prelude in default launchersBenoit Daloze2023-11-131-1/+2
| | | | https://github.com/rubygems/rubygems/commit/e119f4208a
* [rubygems/rubygems] This can be frozen nowDavid Rodríguez2023-11-131-2/+2
| | | | https://github.com/rubygems/rubygems/commit/d06544add2
* [rubygems/rubygems] Remove now unnecessary dupsDavid Rodríguez2023-11-138-12/+8
| | | | https://github.com/rubygems/rubygems/commit/56ce2a6445
* [rubygems/rubygems] Let RuboCop target Ruby 3.0David Rodríguez2023-11-137-17/+17
| | | | https://github.com/rubygems/rubygems/commit/70243b1d72
* [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in RubyGemsDavid Rodríguez2023-11-1316-45/+27
| | | | https://github.com/rubygems/rubygems/commit/10c26a483d
* [rubygems/rubygems] Hack to get `Gem::Specification#extensions_dir` documentedDavid Rodríguez2023-11-081-7/+15
| | | | https://github.com/rubygems/rubygems/commit/625b8293f7
* [rubygems/rubygems] Remove unnecessary rescueDavid Rodríguez2023-11-081-5/+0
| | | | https://github.com/rubygems/rubygems/commit/c0b549f943
* [rubygems/rubygems] Allow `--install-dir` to be specified together with ↵Vít Ondruch2023-11-081-8/+0
| | | | | | | | | | | | | | `--user-install` The combination of `install-dir` and `--user-install` used to be disabled for no good reason. This even makes problem on Linux distributions such as Fedora, where `--user-install` is set by default via operating_system.rb. The `--install-dir` is already prefered over the `--user-install` by the implementation, therefore just drop the check. https://github.com/rubygems/rubygems/commit/313b1c5e76
* [rubygems/rubygems] Make the user installation less exceptionalVít Ondruch2023-11-081-12/+11
| | | | | | | | | | | | | The main purpose is to put handling of user installation into the same place as e.g. handling the --build-root option handling. There is no reason why the --build-root option should not prefix also paths used for user installation. Please note that the `util_installer` in `test_generate_plugins_with_user_install` enforced the `:install_dir`, which is against what user install is about. https://github.com/rubygems/rubygems/commit/0b10cb41aa
* [rubygems/rubygems] Update SPDX license list as of 2023-10-05License Update2023-10-271-0/+48
| | | | https://github.com/rubygems/rubygems/commit/e69a43ac9f
* [rubygems/rubygems] Raise exception on unexpected EOF in marshalSamuel Giddins2023-10-251-0/+7
| | | | | | Instead of NoMethodError being raised by accidentally trying to use nil https://github.com/rubygems/rubygems/commit/ac8f812bbf
* [rubygems/rubygems] Avoid regexp match on every call to `Gem::Platform.local`Samuel Giddins2023-10-251-3/+5
| | | | | | | The result of `arch` would be ignored if `@local` is set, so wrap all the logic in `@local ||=` to short-circuit everything https://github.com/rubygems/rubygems/commit/b67d39f3e0
* [rubygems/rubygems] Handle empty arrayHiroshi SHIBATA2023-10-241-1/+6
| | | | https://github.com/rubygems/rubygems/commit/7c0afdd9af
* [rubygems/rubygems] Ignore non-tar format `.gem` files during searchdearblue2023-10-232-2/+10
| | | | | | Previously, `rake install` or `rake update` would fail if there was a non-tar format `.gem` file in the current working directory. https://github.com/rubygems/rubygems/commit/f562788f1d
* [rubygems/rubygems] Refactor to checksums stored via sourceSamuel Giddins2023-10-231-20/+0
| | | | | | | | | | | | | | | | | | | | This gets the specs passing, and handles the fact that we expect checkums to be pinned only to a particular source This also avoids reading in .gem files during lockfile generation, instead allowing us to query the source for each resolved gem to grab the checksum Finally, this opens up a route to having user-stored checksum databases, similar to how other package managers do this! Add checksums to dev lockfiles Handle full name conflicts from different original_platforms when adding checksums to store from compact index Specs passing on Bundler 3 https://github.com/rubygems/rubygems/commit/86c7084e1c
* [rubygems/rubygems] Use the server checksum, then calculate from gem on disk ↵Mercedes Bernard2023-10-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | if possible 1. Use the checksum provided by the server if provided: provides security knowing if the gem you downloaded matches the gem on the server 2. Calculate the checksum from the gem on disk: provides security knowing if the gem has changed between installs 3. In some cases, neither is possible in which case we don't put anything in the checksum and we maintain functionality as it is today Add the checksums to specs in the index if we already have them Prior to checksums, we didn't lose any information when overwriting specs in the index with stubs. But now when we overwrite EndpointSpecifications or RemoteSpecifications with more generic specs, we could lose checksum info. This manually sets checksum info so we keep it in the index. https://github.com/rubygems/rubygems/commit/de00a4f153
* [rubygems/rubygems] Gem::NameTuple equality ignores Gem::Platform/string ↵Martin Emde2023-10-211-6/+4
| | | | | | platform variation https://github.com/rubygems/rubygems/commit/49aaa46708
* [rubygems/rubygems] Allow uninstalling multiple versions of same gemKyle Stevens2023-10-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, you can install multiple versions of the same gem just fine: ``` $ gem install simplecov:0.19.0 simplecov:0.22.0 Fetching simplecov-0.19.0.gem Successfully installed simplecov-0.19.0 Parsing documentation for simplecov-0.19.0 Installing ri documentation for simplecov-0.19.0 Done installing documentation for simplecov after 0 seconds Fetching simplecov-0.22.0.gem Successfully installed simplecov-0.22.0 Parsing documentation for simplecov-0.22.0 Installing ri documentation for simplecov-0.22.0 Done installing documentation for simplecov after 0 seconds 2 gems installed ``` But to uninstall both of them, you need to run the equivalent uninstall command twice: ``` ~$ gem uninstall simplecov:0.19.0 simplecov:0.22.0 Successfully uninstalled simplecov-0.22.0 ~$ gem uninstall simplecov:0.19.0 simplecov:0.22.0 Gem 'simplecov' is not installed Successfully uninstalled simplecov-0.19.0 ``` This resolves that problem by using the gem's full name (which includes the version) when tracking which ones have already been uninstalled so when it gets to the second version listed it doesn't think it was already uninstalled. https://github.com/rubygems/rubygems/commit/d96101b753
* [rubygems/rubygems] [PathSupport] Simplify logic: If `Gem.default_dir` is ↵Ellen Marie Dash2023-10-161-5/+2
| | | | | | | | | | | writable, use it. I couldn't find a cross-platform way to check "can I create this directory?" So I removed that, and went back to the original simpler logic of "if the directory is writable, use it." https://github.com/rubygems/rubygems/commit/3aa86a56db
* [rubygems/rubygems] Remove outdated/incorrect comment.Ellen Marie Dash2023-10-161-4/+0
| | | | | | | The function is also significantly simpler than it used to be, to the point I'm not sure it needs a comment. https://github.com/rubygems/rubygems/commit/29a0551e37
* [rubygems/rubygems] Rephrase "Defaulting to user installation" message.Ellen Marie Dash2023-10-161-1/+1
| | | | | | https://github.com/rubygems/rubygems/commit/b7c531347e Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
* [rubygems/rubygems] Avoid excess Arrays when partitioning ↵Martin Emde2023-10-111-27/+13
| | | | | | Gem::Version.canonical_segments https://github.com/rubygems/rubygems/commit/338c48f935
* [lib/rubygems/path_support.rb] Rephrase commentEllen Marie Dash2023-10-111-1/+1
| | | | Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
* [rubygems/rubygems] Move "Defaulting to user installation ..." message, so ↵Ellen Marie Dash2023-10-112-3/+10
| | | | | | `--install-dir` and `--user-install` can suppress it. https://github.com/rubygems/rubygems/commit/6677fc6853
* [rubygems/rubygems] Update incorrect comments.Ellen Marie Dash2023-10-111-3/+4
| | | | https://github.com/rubygems/rubygems/commit/6b21f593f3
* [rubygems/rubygems] Simplify logic for Gem::PathSupport#home, and make ↵Ellen Marie Dash2023-10-111-16/+19
| | | | | | GEM_HOME always overide it. https://github.com/rubygems/rubygems/commit/64273fd7e3
* [rubygems/rubygems] Call check_that_user_bin_dir_is_in_path ANY time ↵Ellen Marie Dash2023-10-111-0/+7
| | | | | | | | Gem.paths.home == Gem.user_dir. (As opposed to only if `--user-install` is passed.) https://github.com/rubygems/rubygems/commit/0b42d0e869
* [rubygems/rubygems] Split out Gem::PathSupport#default_home_dir to fix ↵Ellen Marie Dash2023-10-111-7/+15
| | | | | | "bundle doctor" specs. https://github.com/rubygems/rubygems/commit/d7f3f901f1
* [rubygems/rubygems] Try a different approach for fallback to --user-install.Ellen Marie Dash2023-10-112-16/+14
| | | | https://github.com/rubygems/rubygems/commit/13e0704c40
* [rubygems/rubygems] If GEM_HOME exists + isn't writable, use --user-install.Ellen Marie Dash2023-10-111-1/+16
| | | | https://github.com/rubygems/rubygems/commit/6d20585645
* [rubygems/rubygems] Reduce allocations when parsing compact indexSamuel Giddins2023-10-081-3/+7
| | | | | | | | | | | | | | | | | | This still allocates a ton (a string for each line, plus a bunch of splits into arrays), but it helps a bit when Bundler has to go through dependency resolution. ``` ==> memprof.after.txt <== Total allocated: 194.14 MB (2317172 objects) Total retained: 60.81 MB (593164 objects) ==> memprof.before.txt <== Total allocated: 211.97 MB (2404890 objects) Total retained: 62.85 MB (640342 objects) ``` https://github.com/rubygems/rubygems/commit/c68b41b0e5
* [rubygems/rubygems] Optimize allocations in Gem::VersionSamuel Giddins2023-10-072-20/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From running in a random rails app I have locally, here are the changes 1) for `bundle lock --update --bundler` (forcing Bundler to go through dependency resolution) ``` ==> memprof.after.txt <== Total allocated: 2.98 MB (48307 objects) Total retained: 1.21 MB (16507 objects) ==> memprof.before.txt <== Total allocated: 12.62 MB (198506 objects) Total retained: 1.30 MB (23133 objects) ``` 2) for `bin/rails runner true` (essentially only bundler/setup) ``` ==> memprof.after.txt <== Total allocated: 59.50 kB (1017 objects) Total retained: 25.08 kB (362 objects) ==> memprof.before.txt <== Total allocated: 561.82 kB (8575 objects) Total retained: 27.28 kB (513 objects) ``` https://github.com/rubygems/rubygems/commit/35c8ed2cb8
* [rubygems/rubygems] Fix invalid links in documentation. - wrap ENV variables ↵Josef Šimánek2023-10-033-3/+3
| | | | | | in <code> - fix rubygems.org link - fix zenspider.com link https://github.com/rubygems/rubygems/commit/9eaac94a63
* [rubygems/rubygems] Fix typo: eglible -> eligible.Josef Šimánek2023-10-032-5/+5
| | | | https://github.com/rubygems/rubygems/commit/1e487e1337
* [rubygems/rubygems] Update suggested variable for bindirHiroshi SHIBATA2023-10-031-2/+2
| | | | https://github.com/rubygems/rubygems/commit/f9cc6fed25