summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-08-31[rubygems/rubygems] Replacing clone with dupDaniel Niknam
https://github.com/rubygems/rubygems/commit/30f5b3c027 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove returning self for `Gem::PrintableUri#parse_uri`Daniel Niknam
https://github.com/rubygems/rubygems/commit/25c99d7f9d Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove @credential_redacted instance variableDaniel Niknam
https://github.com/rubygems/rubygems/commit/c3bb52eb5c Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Bring back the empty line that was removed previously by ↵Daniel Niknam
mistake https://github.com/rubygems/rubygems/commit/ffb480ca7a Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove unused methodDaniel Niknam
https://github.com/rubygems/rubygems/commit/3a8486794e Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove `ruby/uri` requirementDaniel Niknam
For the purpose of this class, we need to make sure the return object by `Gem::UriParser.parse_uri` method will have the following method: - user - user= - password - password= So we can remove the the `uri` dependency and just look for the methods to exist. https://github.com/rubygems/rubygems/commit/241e093597 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Refactor `Gem::RemoteFetcher::FetchError.build` back to ↵Daniel Niknam
its initialize method https://github.com/rubygems/rubygems/commit/21dcdd2dc5 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove defensive guardsDaniel Niknam
https://github.com/rubygems/rubygems/commit/dba130cd80 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Rename `Gem::PrintableUri#parsed_uri?` to ↵Daniel Niknam
`Gem::PrintableUri#valid_uri?` https://github.com/rubygems/rubygems/commit/a5177709c9 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove trailing `if`Daniel Niknam
https://github.com/rubygems/rubygems/commit/5b6b649bba Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Refactor `Gem::RemoteFetcher::FetchError` initializer to ↵Daniel Niknam
`build` method The `initialize` method is already doing a lot and by adding the `Gem::PrintableUri` to redact sensitive information, things are getting complicated and hard to read here. For the start, I have refactored the `initialize` method into a class method called `build`. https://github.com/rubygems/rubygems/commit/4312e8fdf5 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Using `Gem::PrintableUri` in `Gem::Request` classDaniel Niknam
The `@uri` variable could be a source URI with a credential. Using `Gem::PrintableUri` to make sure we are redacting sensitive information from it when logging on verbose mode. https://github.com/rubygems/rubygems/commit/f566787211 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Using `Gem::PrintableUri` in ↵Daniel Niknam
`Gem::Commands::InstallCommand` class The `x.source.uri` could be a source URI with a credential. Using `Gem::PrintableUri` to make sure we are redacting sensitive information from it. https://github.com/rubygems/rubygems/commit/8755ee0aaa Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Introduce `Gem::PrintableUri` that would redact URIs to ↵Daniel Niknam
be used on outputs We need to redact URI credential in several places and copy pasting the code into each part of it is not ideal. This class is responsible for parsing URI strings and redacting credential from it. Also, it will handle URI object in the same manner. We will be reusing this class whenever we need to print/display a URI to users. URI with the following format will be redacted: - Token: `http://my-secure-token@example.com` => `http://REDACTED@example.com` - Username & Password: `http://my-username:my-secure-password@example.com` => `http://my-username:REDACTED@example.com` - x-oauth-basic: `http://my-secure-token:x-oauth-basic@example.com` => `http://REDACTED:x-oauth-basic@example.com` https://github.com/rubygems/rubygems/commit/f1e45d3a89 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Pass second argument to Array#split to ensure only two ↵Matt Larraz
values returned https://github.com/rubygems/rubygems/commit/601b5553bb Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Fix `bundle plugin install` misdetection of installed ↵David Rodríguez
versions https://github.com/rubygems/rubygems/commit/9c88db949d Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Move `Bundler.rubygems.clear_paths` to a better placeDavid Rodríguez
Since it clears both home and path. https://github.com/rubygems/rubygems/commit/fadf5e03ea Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Bundle path is already expandedDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a296052670 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Normalize setting `GEM_PATH`David Rodríguez
https://github.com/rubygems/rubygems/commit/4188ebd568 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove more unused codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/986e889a79 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove unnecessary lineDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a7023c6c21 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Make plugin installation idempotentDavid Rodríguez
The error had not be caught be specs because `bundle install` was returning a zero exit code when plugin installation errors happened. So I fixed that issue too. https://github.com/rubygems/rubygems/commit/90cde87856 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Move some logic to a `save_plugin` methodDavid Rodríguez
https://github.com/rubygems/rubygems/commit/9620bee2a5 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Correctly redact credentials when using x-oauth-basicMatt Larraz
https://github.com/rubygems/rubygems/commit/290b6ab078 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Refactor Ruby platform priority condition to its own methodDaniel Niknam
The `Gem::Platform::RUBY ? -1 : 1` has been used multiple times in different places and could be refactored to a method (DRY). https://github.com/rubygems/rubygems/commit/9d43ca8f0c Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Pick the last founded gems when fetching metadataDaniel Niknam
https://github.com/rubygems/rubygems/commit/e3d150d822 Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> Notes: Merged: https://github.com/ruby/ruby/pull/4789
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] Fix `bundle check` showing duplicated gemsDavid Rodríguez
If the lockfile contains multiple platforms, `bundle check` would show duplicated missing gems. https://github.com/rubygems/rubygems/commit/6ac5931783 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Explicitly set `allow_cached` to false when setting ↵David Rodríguez
local mode https://github.com/rubygems/rubygems/commit/1b8139e9d3 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Restore working `bundle check` behaviourDavid Rodríguez
As part of a recent bug fix where bundler was accidentally hitting the network when not supposed to, I made some refactoring, and the commit I'm reverting here (https://github.com/rubygems/rubygems/commit/d74830d00bb541883377992f56818620a78930b0) was some cleanup that those refactorings allowed according to "past me". That was completely wrong, `bundle check` should never consider cached gems, only installed gems, so the code that was removed was necessary. https://github.com/rubygems/rubygems/commit/5483e98305 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove MacOS specific extra GEM_PATHDavid Rodríguez
They should properly configure `GEM_PATH` instead. https://github.com/rubygems/rubygems/commit/3bd9ae33ca Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove MacOS specific gem layoutDavid Rodríguez
MacOS should properly configure Ruby. They should not expect us to maintain a different layout just for them. https://github.com/rubygems/rubygems/commit/ecad900925 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
2021-08-31[rubygems/rubygems] Reword the messageDaniel Niknam
For errors that could happened while loading `rubygems/defaults/operating_system` https://github.com/rubygems/rubygems/commit/6e1e2141f8 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Bring `--jobs` documentation up to dateDavid Rodríguez
https://github.com/rubygems/rubygems/commit/58da501e5d Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] See if parallel installation on Windows works better nowDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0822e1c260 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Enhance error handling when loading the ↵Daniel Niknam
rubygems/defaults/operating_system file When loading `rubygems/defaults/operating_system` - we want to keep it silent if the raised exception is a LoadError - we want to print a message in other cases and ask users to report the issue to their OS support. Ruby 3 comes with special error handling for loading `rubygems` and it will show a warning when LoadError exception raised for requiring 'rubygem'. Because of that, we decided to leave the LoadError scenario as it is. Reference: https://github.com/ruby/ruby/blob/d1998d8767affe58be0bd09ec536dae9198a7fbd/gem_prelude.rb#L1-L5 https://github.com/rubygems/rubygems/commit/0a97e12fe1 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Also load user installed rubygems pluginsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/82960c262f Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Respect `BUNDLE_USER_HOME` for global config locationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/58fc31442f Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove `RUBYGEMS_GEMDEPS` warningDavid Rodríguez
When setting the `RUBYGEMS_GEMDEPS` environment variable to allow skipping `bundle exec`, `bundler` will print a warning about potential incompatibility. Initially the `RUBYGEMS_GEMDEPS` variable used a completely different (re)implementation of `bundler` functionality. That implementation was not battle tested and could potentially differ in behaviour from what `bundler` does. That's why print a warning. However, these days, all `rubygems` does when `RUBYGEMS_GEMDEPS` is set is to require `bundler/setup`, so there's no risk of any incompatibility, since that's just plain `bundler`. https://github.com/rubygems/rubygems/commit/bbddc27016 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Recommend `bundle install` rather than `gem install -g`David Rodríguez
https://github.com/rubygems/rubygems/commit/4028cbc408 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Get a CI matrix configured in default Github Actions ↵David Rodríguez
generated config Even if it only has one entry at the moment, it makes it easier to add new entries by doing it this way. https://github.com/rubygems/rubygems/commit/46232fe265 Co-authored-by: NeimadTL <damientalbot26@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Avoid double CI runs in default Github Actions generated ↵David Rodríguez
config Otherwise CI will run once for every pull request update and once for every push. The disavantage is that people working on a non default branch without creating pull requests won't get CI run at all. I think the advantages are greater than the disadvantages, it's also my personal workflow, and it's something desired enough so that someone opened an issue about it. So let's do it! https://github.com/rubygems/rubygems/commit/924d916a73 Co-authored-by: NeimadTL <damientalbot26@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Don't use gemdeps on bundler binstubDavid Rodríguez
https://github.com/rubygems/rubygems/commit/320fdc1513 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Simplify rescue of bundler errorsDavid Rodríguez
As far as I understand, this block should only be run when `bundler/setup` fails. The only other case where these errors could be run is when bundler itself is required. If bundler itself fails to be required or activated (like in old rubies where it was not a default gem, for example), the raw error is much more helpful than this message. So we can move the rescue after bundler is succesfully required, and that simplifies the list of exceptions that we need to track to just `Bundler::Error`. https://github.com/rubygems/rubygems/commit/3663c11e93 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Move list of exceptions to the `rescue` clauseDavid Rodríguez
Instead of having to match classes and re-raise in the exception body. https://github.com/rubygems/rubygems/commit/5edf74b781 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Use `Gem.use_gemdeps` only from binstubsDavid Rodríguez
The previous behavior was to automatically require `bundler/setup` everytime `rubygems` was required, which I think was too much. https://github.com/rubygems/rubygems/commit/b25379a295 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Take advantage of `target` being a `Pathname`David Rodríguez
https://github.com/rubygems/rubygems/commit/c31b8cd232 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Fix git repo initialization on a path with spacesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a2d6e10192 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove bad TODODavid Rodríguez
The commented out code causes failing tests because it's not correct. https://github.com/rubygems/rubygems/commit/38f0eca91a Notes: Merged: https://github.com/ruby/ruby/pull/4789