Commit graph

14659 commits

Author SHA1 Message Date
David Rodríguez
e21e5bc814 [rubygems/rubygems] Fix gem rdoc not working with newer versions of rdoc
369f9b9311
2025-03-10 12:43:36 +09:00
Tara Bass
4323674fe4 [rubygems/rubygems] Don't treat a git-sourced gem install as complete if only the '.git' directory is present. This recovers cases where a git-sourced install can be left in a partially installed state.
d132b7008d
2025-03-10 12:43:36 +09:00
Sean Collins
71e340881f [rubygems/rubygems] Switch inject to use shorthand hash syntax
ba5a62fd04
2025-03-10 12:43:36 +09:00
Sean Collins
8acf0d7bcc [rubygems/rubygems] Use shorthand hash syntax for bundle add
9691097036
2025-03-10 12:43:36 +09:00
Nobuyoshi Nakada
cdf36d6bfd [ruby/optparse] Allow non-string enum list #79
Command line arguments are strings, convert enum list elements to
strings to match.

c5ec052efc
2025-03-09 14:32:17 +00:00
Nobuyoshi Nakada
0c73328aff [ruby/optparse] Use \A instead of ^ as the beginning of string
a3f1029815
2025-03-09 14:09:16 +00:00
Nobuyoshi Nakada
49199445f5 [ruby/optparse] [DOC] Manage rdoc options only in .rdoc_options file
Make `rdoc .` and `rake rdoc` consistent.

61b4ea0704
2025-03-09 14:03:55 +00:00
Michael Chui
fdf1076ef9 [rubygems/rubygems] docs(bundle-exec): recommend non-deprecated methods
3b4934fb69
2025-03-03 15:52:35 +09:00
Mateo
a98c3d229e [rubygems/rubygems] docs(bundle-config): hint default group when using only option
c258e45b44
2025-03-03 15:52:35 +09:00
Josef Šimánek
29e3ee0568 [rubygems/rubygems] Bring man pages up to date
591d2c0503
2025-03-03 15:52:35 +09:00
Hiroshi SHIBATA
e4c5531b4c [rubygems/rubygems] Update vendored uri to 1.0.3
176dc7421c
2025-03-03 15:52:35 +09:00
Martin Emde
19bdcc8f0c
[rubygems/rubygems] Retry gracefully on blank partial response in compact index
fafb9ae090
2025-02-28 12:34:57 +09:00
Hiroshi SHIBATA
9cf5d20e5f
[ruby/cgi] Bump up v0.4.2
ab84b7fe66
2025-02-27 13:32:32 +09:00
Hiroshi SHIBATA
cdc55c2452
[ruby/cgi] Bump up 0.4.2.beta2
8e6fb1041b
2025-02-27 13:32:32 +09:00
Martin Emde
61060d349d
[rubygems/rubygems] Remove MD5 digesting of compact index responses
It has been over a year since the release, so let's stop MD5ing everything

29ef4ca30b
2025-02-27 13:32:32 +09:00
David Rodríguez
3e78a2f58e
[rubygems/rubygems] Improve error message when on read-only filesystems
If we fail to write the lockfile, give a better error.

81a08d6eda
2025-02-27 13:32:32 +09:00
yuuji.yaginuma
75f07afd18 [ruby/uri] Use a fully qualified name in warning messages
Currently, some warning messages don't contain a `URI` like the following.

```ruby
warning: URI::ABS_URI is obsolete. Use RFC2396_PARSER.regexp[:ABS_URI] explicitly.
```

But, without `URI` prefix, the suggested value doesn't work.
So I think we should use a fully qualified name to avoid confusion.

428eb10e44
2025-02-27 04:32:27 +00:00
Yuji Yaginuma
31bd669f67 [ruby/uri] Fix the mention to removed URI.escape/URI::Escape
This was removed by #9.

fec924238f
2025-02-27 04:30:23 +00:00
Hiroshi SHIBATA
237ab21f25 [ruby/cgi] Escape/unescape unclosed tags as well
cd1eb08076

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-02-26 07:34:04 +00:00
Hiroshi SHIBATA
fc60a04de9 [ruby/cgi] Use String#concat instead of String#+ for reducing cpu usage
9907b76dad

Co-authored-by: "Yusuke Endoh" <mame@ruby-lang.org>
2025-02-26 07:34:03 +00:00
Hiroshi SHIBATA
eac8b1197f [ruby/uri] Bump up v1.0.3
3213f4a0f8
2025-02-26 07:12:53 +00:00
Hiroshi SHIBATA
b407b6b5b2 [ruby/uri] Fix merger of URI with authority component
https://hackerone.com/reports/2957667

2789182478

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-02-26 07:08:45 +00:00
Hiroshi SHIBATA
57dcb4bb9b [ruby/uri] Truncate userinfo with URI#join, URI#merge and URI#+
3675494839
2025-02-26 07:08:44 +00:00
Hiroshi SHIBATA
ae0853b5f5 [ruby/cgi] Bump up 0.4.2.beta1
3f5b4ed9e9
2025-02-26 06:20:36 +00:00
Koichi ITO
6efd15a128 [ruby/prism] Restore a comment for Prism::Translation::Parser#initialize
This restores the missing method comments in https://github.com/ruby/prism/pull/3479.

78b8f67dee
2025-02-25 22:18:02 +00:00
Earlopain
044570fd76 [ruby/prism] Fix merge mishap
Caused by https://github.com/ruby/prism/pull/3478 and https://github.com/ruby/prism/pull/3443

I also made the builder reference more explicit to clearly distinquish
between `::Parser` and `Prism::Translation::Parser`

d52aaa75b6
2025-02-25 17:11:39 +00:00
Earlopain
790b3858e8 [ruby/prism] Add a custom builder class for the parser translator
I want to add new node types to the parser translator, for example `itblock`. The bulk of the work is already done by prism itself. In the `parser`
builder, this would be a 5-line change at most but we don't control that here.

Instead, we can add our own builder and either overwrite the few methods we need,
or just inline the complete builder. I'm not sure yet which would be better.

`rubocop-ast` uses its own builder for `parser`. For this to correctly work, it must explicitly choose to extend the
prism builder and use it, same as it currently chooses to use a different parser when prism is used.

I'd like to enforce that the builder for prism extends its custom one since it will lead to
some pretty weird issues otherwise. But first, I'd like to change `rubocop-ast` to make use of this.

b080e608a8
2025-02-25 15:44:56 +00:00
Koichi ITO
2c3d2415d1 [ruby/prism] Support custom parser in Prism::Translation::Parser
Follow-up to https://github.com/Shopify/ruby-lsp/pull/1849.

This is an extension of `Prism::Translation::Parser` to implement https://github.com/Shopify/ruby-lsp/pull/1849.
It is based on the comments in https://github.com/Shopify/ruby-lsp/pull/1849#pullrequestreview-1966020868,
but also adds a default argument for delegation to `Parser::Base` super class.

Using this API, https://github.com/rubocop/rubocop-ast/pull/359 has been implemented in RuboCop AST.
As detailed in https://github.com/rubocop/rubocop-ast/pull/359, this change is expected to improve performance by 1.3x
for some source code.
Achieving a 1.3x speedup with such this simple modification is a significant improvement for Ruby LSP and its users.

925725291c
2025-02-25 15:41:29 +00:00
David Rodríguez
158e4cc4ec [rubygems/rubygems] Improve log message about adding a new platform
This message is printed when running `bundle lock --add-platform`. This
command affects the lockfile, not the gemfile, and I think it's better
to use "You are adding" rather than "You added", because the addition is
happening during the current invocation (as opposed to other log
messages that talk about a change made to the Gemfile prior to running
the command).

aba1e55f5b
2025-02-25 15:36:46 +09:00
David Rodríguez
5284719273 [rubygems/rubygems] Refactor handling platform removals
And make it consistent with platform additions.

64342ae404
2025-02-25 15:36:46 +09:00
David Rodríguez
8b952e6489 [rubygems/rubygems] Improve log message when resolving due to local platform not in lockfile
Current it says "you added a new platform to your gemfile", but that's
not actually the case here.

1e39527a38
2025-02-25 15:36:46 +09:00
Edouard CHIN
71f0c37473 [rubygems/rubygems] Modify bundle doctor to not report issue when files aren't writable:
- ### Problem

  Running `bundle doctor` warn about files that aren't writable.
  This makes the output of `bundle doctor` very verbose for something
  I believe isn't really an issue.

  ### Context

  Rubygems keeps the files original permission at the time the gem
  is packaged.
  Many gem maintainers have decided that the permissions of the files
  in their bundled would be 0444, this includes amongst others:
  minitest, selenium, brakeman...

  Any git gems that had a 0444 permissions at some point in its git
  history would also be reported (as bundle doctor look in the
  `cache/bundler/git/<gem>/object` path).

  While it completely make sense to report when files aren't readable,
  maybe it's worth questioning the usefulness of reporting files
  that can't be written and what problem this causes to the user
  (if any).

  ### Solution

  Removed the check for unwritable file.

  ### Side note

  I also tweaked the "No issues ..." message logic as it was doing
  the opposite (reporting an issue when there is none and vice versa).
  This wasn't caught in tests because as a stub on `Bundler.ui.info`
  was missing.

9a426b9495
2025-02-25 15:36:46 +09:00
Samuel Williams
021ccbf7e8 [ruby/pp] Ensure the thread local state is always set up.
(https://github.com/ruby/pp/pull/38)

5b5d483ac2
2025-02-25 03:38:04 +00:00
Hiroshi SHIBATA
d97884a58b [ruby/cgi] Use license files same as ruby/ruby
defbdf9a30
2025-02-21 06:20:13 +00:00
David Rodríguez
ee2c7bcae5 [rubygems/rubygems] Allow noop bundle install to work on read-only or protected folders
As long as there's nothing new to install and gems are already there.

If not, give a meaningful error about what happened.

This was how things already worked until
345ec45f5a, so this commit partially
reverts that change.

794b0ecb39
2025-02-21 11:31:49 +09:00
Hiroshi SHIBATA
425cfcff85 [rubygems/rubygems] bin/rubocop -a --only Style/MultipleComparison
677e17aa2e
2025-02-21 11:31:47 +09:00
David Rodríguez
cdbadafd25 [rubygems/rubygems] Fix resolver issue due to ill-defined version ranges being created
f2f2ac9680
2025-02-21 11:31:44 +09:00
Hiroshi SHIBATA
556be73cbb [rubygems/rubygems] gem server command is extracted from rubygems core feature now
b29f8d6a37
2025-02-20 12:58:45 +09:00
David Rodríguez
63600d79dc [rubygems/rubygems] Fix lockfile platforms inconveniently added on JRuby
When working with our repository on JRuby locally, I get the following
changes when running `bin/rake setup` in all of our lockfiles

```diff
diff --git a/tool/bundler/dev_gems.rb.lock b/tool/bundler/dev_gems.rb.lock
index 74550b2a40 100644
--- a/tool/bundler/dev_gems.rb.lock
+++ b/tool/bundler/dev_gems.rb.lock
@@ -66,6 +66,7 @@ PLATFORMS
   java
   ruby
   universal-java
+  universal-java-22
   x64-mingw-ucrt
   x86-linux
   x86_64-darwin
```

This is inconvenient, so I applied the same strategy we already use on
non JRuby implementations to not add the current platform to the
lockfile if a less specific platform is already there.

812b9cd1e8
2025-02-20 12:58:44 +09:00
David Rodríguez
5d8fe7a595
[rubygems/rubygems] Make sure empty gems are not reinstalled every time
Unfortunately this requires reverting a previous enhancement of
reinstalling gems if they incorrectly ship with an empty installation
dir.

However, there's no way to distinguish this kind of bad state from a gem
that's empty for real, for example, sorbet-static-and-runtime.

This reverts commit 9720a9b980, and adds a
spec to make sure empty gems are not reinstalled every time.

7c102394af
2025-02-19 11:04:09 +09:00
David Rodríguez
507de2226b [rubygems/rubygems] Fix Bundler incorrectly downgrading direct dependencies
There's no reason to call `converge_specs` when adding additional
lower bound requirements to prevent downgrades, and it actually causes
the extra requirements to be missed sometimes.

Loop over the originally locked specs directly, adding the additional
precaution of not adding the requirement if the Gemfile dependency has
changed and it no longer matches the locked spec.

5154506912
2025-02-18 12:12:54 +09:00
David Rodríguez
c5cdabc14a [rubygems/rubygems] Don't try to skip requirements to prevent downgrades
These don't really hurt, so I'm not sure why I introduced it.

85b6b405ac
2025-02-18 12:12:52 +09:00
David Rodríguez
c77354157f [rubygems/rubygems] Fix locked gems being upgraded when locked dependencies are incorrect
Resolver had internal logic to prioritize locked versions when sorting
versions, however part of it was not being actually hit because of how
unlocking worked in the resolver: a package was allow to be unlocked
when that was explicit requested or when the list of unlocks was empty.
That did not make a lot of sense and other cases were working because
the explicit list of unlocks was getting "artificially filled".

Now we consider a package unlocked when explicitly requested (`bundle
update <package>`), or when everything is being unlocked (`bundle
install` with no lockfile or `bundle update`).

This makes things simpler and gets the edge case added as a test case
working as expected.

b8e55087f0
2025-02-18 12:12:51 +09:00
David Rodríguez
592eb02d6c [rubygems/rubygems] Refactor finding dependency changes
d8c4754d8f
2025-02-18 12:12:49 +09:00
David Rodríguez
533e894cb5 [rubygems/rubygems] Improve processing and categorizing unlock information
516430c3ec
2025-02-18 12:12:48 +09:00
David Rodríguez
c8f4df4ae9 [rubygems/rubygems] Make Bundler never instantiate development dependencies
Bundler does not really have a concept of "development dependencies",
like RubyGems has. Bundler has the more generic concept of "groups".

Under the hood, the `gemspec` DSL will put gemspec development
dependencies under a `:development` Gemfile group, but there's no reason
to instantiate these as development dependencies, they are regular
runtime dependencies, except that they belong in a group named
:development.

By never instantiating development dependencies at all, we avoid having
to introduce hacks to "undo" the type Bundler does not know about, and I
also think the error messages read better.

9a06fa5bda
2025-02-17 11:04:39 +09:00
David Rodríguez
a55a2fc6e8
[rubygems/rubygems] Reset existing specs when using Bundler::SpecSet#[]=
We have a flaky failure where to equal Bundler specs sneak into the same
SpecSet. This seems like a vector where that could happen so trying this
in case it fixes the flaky.

a33aeb3c4d
2025-02-14 16:13:27 +09:00
David Rodríguez
a64c697b22
[rubygems/rubygems] Refactor SpecSet to not need reset
55af558124
2025-02-14 16:13:27 +09:00
David Rodríguez
061d8133ce
[rubygems/rubygems] Simplify hacks to integrate with RubyGems
33d91de732
2025-02-14 16:13:27 +09:00
David Rodríguez
c94cec27f7
[rubygems/rubygems] Simplify SpecSet#sorted
a3f365bbaa
2025-02-14 16:13:27 +09:00