Commit graph

14675 commits

Author SHA1 Message Date
Yuta Saito
8b55aaa85c [Feature #20345] Add --target-rbconfig option to mkmf
Introduce a new mkmf option `--target-rbconfig` to specify the RbConfig
file for the deployment target platform. This option is useful for
cross-compiling Ruby extensions without faking the global top-level
`RbConfig` constant.
2024-04-02 14:24:54 +09:00
Hiroshi SHIBATA
4db7c8a24a Warn ostruct for Ruby 3.5 2024-04-02 11:22:14 +09:00
tomoya ishida
a531cac335 [ruby/reline] Refactor completion
(https://github.com/ruby/reline/pull/647)

* Refactor completion: split autocompletion and tabcompletion logic and state

* Move completion candidate listup logic from dialog proc to LineEditor

c3c09ac9c2
2024-04-01 18:12:27 +00:00
tomoya ishida
508bddc865 [ruby/reline] Align completion menu items
(https://github.com/ruby/reline/pull/613)

a622704f62
2024-04-01 16:25:26 +00:00
David Rodriguez
e2a1d0b53d [rubygems/rubygems] Improve error message when strict resolution filters out everything
1ea44b3749
2024-04-01 15:03:28 +00:00
David Rodriguez
f80bb3837c [rubygems/rubygems] Keep unfiltered versions separately
7b5cc51a96
2024-04-01 15:03:27 +00:00
David Rodriguez
bfdbdf7aae [rubygems/rubygems] No need to check for root package every time
6ca192649f
2024-04-01 15:03:27 +00:00
David Rodriguez
b6ac37c91a [rubygems/rubygems] No need for any version prioritization when building errors
We just need to filter versions belonging to the range, but don't need
anything else.

8355a225d7
2024-04-01 15:03:26 +00:00
David Rodriguez
caaafbc35e [rubygems/rubygems] Make it look more like BasicPackageSource
bb5727934c
2024-04-01 15:03:26 +00:00
David Rodriguez
d69ef1cc52 [rubygems/rubygems] Let GemVersionPromoter sort in preferred order directly
So that we don't need to reverse the Array.

aeea5e2e00
2024-04-01 15:03:25 +00:00
David Rodriguez
2b82b7d192 [rubygems/rubygems] Update docs
ac24a68486
2024-04-01 15:03:25 +00:00
David Rodriguez
0a1e36964d [rubygems/rubygems] Remove unnecessary filtering
We do that when first caching versions, and then it's no longer
necessary.

ede15847db
2024-04-01 15:03:25 +00:00
David Rodriguez
acbd91e47f [rubygems/rubygems] No need to sort twice when filling versions
13294528c4
2024-04-01 15:03:24 +00:00
David Rodriguez
d342937e01 [rubygems/rubygems] Rename method for clarity
And also so that it matches the method used by main PubGrub sample
resolver class.

0e612361b8
2024-04-01 15:03:24 +00:00
David Rodriguez
3ca0683529 [rubygems/rubygems] Fix typo
0ddf25e5aa
2024-04-01 15:03:23 +00:00
Ellen Marie Dash
174b671699 [rubygems/rubygems] [commands/rebuild] Remove unused DATE_FORMAT constant.
3c4e3fadc9
2024-03-31 02:37:13 +00:00
Ellen Marie Dash
38331c8981 [rubygems/rubygems] [gemspec_helpers] Fix Rubocop warning.
4ebf6ee5ac
2024-03-29 08:03:41 +00:00
Ellen Marie Dash
d19744fbd6 [rubygems/rubygems] [build, rebuild] Split common find_gemspec() out to GemspecHelpers.
2f80a595c4
2024-03-29 08:03:40 +00:00
Ellen Marie Dash
d916dbcb84 [rubygems/rubygems] Improve formatting of "gem rebuild --help" output.
701550f9dd
2024-03-29 08:03:40 +00:00
Ellen Marie Dash
54d90e1355 [rubygems/rubygems] [rebuild] If --diff is not passed and a rebuild fails, suggest passing --diff.
7caadd182c
2024-03-29 08:03:39 +00:00
Ellen Marie Dash
dfe83df03e [rubygems/rubygems] [rebuild_command] Bail early if the RubyGems version doesn't match.
a691170dc7
2024-03-29 08:03:39 +00:00
Ellen Marie Dash
88d7be46b5 [rubygems/rubygems] [rebuild_command] Use Gem.* helpers.
8644ce7193
2024-03-29 08:03:39 +00:00
Ellen Marie Dash
fe096f64e8 [rubygems/rubygems] [rebuild_command] Clean up help text.
4446389f2e
2024-03-29 08:03:38 +00:00
Ellen Marie Dash
54e0b8073b [rubygems/rubygems] [rebuild_command] Use temporary directory instead of the working directory.
f2e4e5b56f
2024-03-29 08:03:38 +00:00
Ellen Marie Dash
a28087affc [rubygems/rubygems] [rebuild_command] Add --diff flag to try using diffoscope.
3e9545193a
2024-03-29 08:03:38 +00:00
Ellen Marie Dash
cd12dfd388 [rubygems/rubygems] [rebuild_command] Avoid leaking files.
3b88553d0d
2024-03-29 08:03:37 +00:00
Ellen Marie Dash
e5def27fbf [rubygems/rubygems] Add "gem rebuild" command.
6d661573f0
2024-03-29 08:03:37 +00:00
Kevin Newton
fcc06fa82a [ruby/prism] CLI -x flag
2068e3c30a
2024-03-28 12:04:35 -04:00
Jake Zimmerman
97b2cc3435 Allow FormatError to take either String or Gem for source
Most of the calls to `FormatError.new` pass `@gem` for the second argument, which has a `path` method.

But in one case—on package.rb:691 in `verify_gz`, the `source` argument is a `String`.

So if there's ever a GZip decode error when attempting to read the contents of the `data.tar.gz` file, instead of reporting the underlying GZip error (which might be something like "unexpected end of file"), we would report instead a NoMethodError coming from package.rb

```
Exception while verifying sorbet-0.5.11301.gem
ERROR:  While executing gem ... (NoMethodError)
    undefined method `path' for "data.tar.gz":String

        @path = source.path
                      ^^^^^
```

There are two ways to fix this:

1. Make `FormatError#initialize` aware of the fact that `source` might sometimes be a `String`
2. Make the call to `FormatError.new` in `verify_gz` pass `@gem` instead of `entry.full_name`.

I've chosen 1 because I think it's more useful to see "unexpected end of file in data.tar.gz" instead of "unexpected end of file in sorbet-0.5.11301.gem." The end of file **is actually** in data.tar.gz, not in the gem file itself, which was decoded successfully.
2024-03-28 15:54:33 +00:00
Hiroshi SHIBATA
7630a89a4b Use www.rfc-editor.org for RFC text.
We use the following site for that now:

* https://tools.ietf.org/ or http
* https://datatracker.ietf.org or http

Today, IETF said the official site of RFC is www.rfc-editor.org.

FYI: https://authors.ietf.org/en/references-in-rfcxml

I replaced them to www.rfc-editor.org.
2024-03-28 11:44:45 +09:00
Cody Cutrer
44b5c912da [rubygems/rubygems] Allow installing plugins from path via CLI
Also bring the man page up to date.

a849bd6947
2024-03-27 11:34:46 +00:00
Hiroshi SHIBATA
e51435177e
Update vendored resolv to 0.4.0 2024-03-27 12:17:58 +09:00
Kevin Newton
240fb3957b [ruby/prism] Freeze internal parts, again
50372fee5c
2024-03-26 12:11:09 -04:00
Hiroshi SHIBATA
8cfa8e87b2 [ruby/irb] Fix a typo (https://github.com/ruby/irb/pull/912)
2057248e40
2024-03-26 11:30:33 +00:00
David Rodriguez
06d5d4f1d0 [rubygems/rubygems] Fix resolver bug where ActivationRequest objects were not properly compared
They were delegating their `#hash` value to a class not overriding that
method, and so were returning inconsistent results.

723e4ee0fc
2024-03-25 19:45:51 +00:00
Cody Cutrer
552647175e [rubygems/rubygems] Improve validation of bundle plugin install options
Ensure only one source type is specified, and ensure options that
are only relevant to git sources are only specified with git.

58b043215e
2024-03-25 14:25:46 +00:00
Koichi ITO
56a2fad2a4 [ruby/prism] Fix incorrect paring when using invalid regexp options
Fixes https://github.com/ruby/prism/pull/2617.

There was an issue with the lexer as follows.
The following are valid regexp options:

```console
$ bundle exec ruby -Ilib -rprism -ve 'p Prism.lex("/x/io").value.map {|token| token[0].type }'
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22]
[:REGEXP_BEGIN, :STRING_CONTENT, :REGEXP_END, :EOF]
```

The following are invalid regexp options. Unnecessary the `IDENTIFIER` token is appearing:

```console
$ bundle exec ruby -Ilib -rprism -ve 'p Prism.lex("/x/az").value.map {|token| token[0].type }'
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22]
[:REGEXP_BEGIN, :STRING_CONTENT, :REGEXP_END, :IDENTIFIER, :EOF]
```

As a behavior of Ruby, when given `A` to `Z` and `a` to `z`, they act as invalid regexp options. e.g.,

```console
$ ruby -e '/regexp/az'
-e:1: unknown regexp options - az
/regexp/az
-e: compile error (SyntaxError)
```

Thus, it should probably not be construed as `IDENTIFIER` token.

Therefore, `pm_byte_table` has been adapted to accept those invalid regexp option values.
Whether it is a valid regexp option or not is checked by `pm_regular_expression_flags_create`.
For invalid regexp options, `PM_ERR_REGEXP_UNKNOWN_OPTIONS` is added to diagnostics.

d2a6096fcf
2024-03-25 12:16:32 +00:00
Justin Collins
f5a2f55aca [ruby/prism] Use Sexp#line_max not Sexp#max_line
for RubyParser translation

a37169621a
2024-03-25 12:13:52 +00:00
Mari Imaizumi
daf1d7bfef [ruby/reline] Bump version to v0.5.0
(https://github.com/ruby/reline/pull/664)

1d6569600c
2024-03-25 12:13:31 +00:00
tomoya ishida
f53209f023 [ruby/irb] Cache RDoc::RI::Driver.new
(https://github.com/ruby/irb/pull/911)

* Cache RDoc::RI::Driver.new to improve performance and to avoid flaky test

* Insert sleep to fix flaky rendering test that renders document dialog

da84e6cb56
2024-03-25 11:48:11 +00:00
Stan Lo
5f334b67d2 [ruby/reline] Remove useless tests
(https://github.com/ruby/reline/pull/665)

The pasting tests hadn't been working since as early as v0.2.0. Since
what it tried to cover is already gone for such a long time, I think it's
better to write new ones if needed then to keep them around.

And since these tests are gone, the helper methods for just them are also gone.

0eedf0e4a0
2024-03-25 11:06:39 +00:00
Jean Boussier
219d7cc1aa lib/bundled_gems.rb: dynamically ignore Kernel.require decorators
Followup: https://github.com/ruby/ruby/pull/10347

This avoid directly referencing bootsnap and zeitwerk, and also
handle other gems that may decorate `require`.
2024-03-25 18:17:09 +09:00
Hiroshi SHIBATA
675dcf9153
Partly Revert "Show the chilled status of a String [ci skip]"
This reverts commit e720a6b485.
2024-03-25 15:04:56 +09:00
Nobuyoshi Nakada
e720a6b485
Show the chilled status of a String [ci skip] 2024-03-25 14:33:20 +09:00
Hiroshi SHIBATA
6b1691ebe8 Remove rubylibdir from bootsnap 2024-03-25 14:33:03 +09:00
Xavier Noria
d6e9367edb Skip Bootsnap and Zeitwerk in bundled gems warning 2024-03-25 14:33:03 +09:00
Nobuyoshi Nakada
5e4b4d6674 [rubygems/rubygems] Remove typo name
It is more 2 years since #5109, probably enough time to warn.

1e9433e77f
2024-03-24 15:27:00 +00:00
tomoya ishida
74593613ea [ruby/reline] Disable dialog proc if TERM=dumb
(https://github.com/ruby/reline/pull/663)

4928e06a24
2024-03-24 13:04:33 +00:00
tomoya ishida
b0eda83ee0 [ruby/reline] Add mode_string to prompt calculation dependencies
(https://github.com/ruby/reline/pull/658)

* Add mode_string to prompt calculation dependencies

* Update vi show-mode-in-prompt test

a0cee06ec5
2024-03-24 10:47:22 +00:00
tomoya ishida
3adaba0e81 [ruby/reline] Do not send color reset sequence when GeneralIO is
used
(https://github.com/ruby/reline/pull/661)

3719702808
2024-03-23 23:00:21 +00:00