Commit graph

14675 commits

Author SHA1 Message Date
David Rodríguez
3cff46c521 [rubygems/rubygems] Remove unnecessary error handling
These gems always define their main namespace and I don't think that
will ever change.

6663cbed53
2025-01-31 14:34:28 +09:00
Edouard CHIN
2ed30c9944 [rubygems/rubygems] Consolidate the platform into a single list:
- Similar change than 29a1be0008,
  keep a single source of truth where we store the platform.

  The only change worth highlighing is the platform "maglev".
  It was not part of the supported platform of dependencies,
  so calling `gem 'foo', plaftorm: 'maglev'` would not work.
  However, it was supposed to according to 45ec86e2e5.
  That's why it was possible to do `Bundler.current_ruby.maglev?` or
  `Bundler.current_ruby.maglev_30?`.

  I didn't change the current behaviour and maglev is not supported,
  though I kept the `*maglev` methods as I believe CurrentRuby is
  public API.

29e219ebcf
2025-01-31 14:34:26 +09:00
Edouard CHIN
dc7c665105 [rubygems/rubygems] Consolidated the Ruby version list:
- We keep 2 list of supported ruby versions and each time a new ruby
  version is released we need to maintain both list. Forgetting
  to update one would prevent users from adding gem for a specific
  plaftorm (i.e. 7cd19d824d and 5462322f8f).

  Extracted the list from the Dependency class and moved it to the
  CurrentRuby class (which I believe was originally added for that
  reason).

a91edd6c1f
2025-01-31 14:34:25 +09:00
Edouard CHIN
57fec1e85f [rubygems/rubygems] Add ruby_34 and ruby_35 as valid platform:
- Fix https://github.com/rubygems/rubygems/pull/8427
- Similar to 7cd19d824d.
  Tweaked a bit the test supposed to prevent this error by checking
  whether the dep respond to these methods.

62012eaeb6
2025-01-31 14:34:24 +09:00
Yusuke Endoh
e01b4ca1c8 [ruby/error_highlight] Ensure first_line and last_line are set
Fixes https://github.com/ruby/error_highlight/pull/58

9ddc1f31a9
2025-01-29 08:51:42 +00:00
Nobuyoshi Nakada
53f0ebf938
Ignore vendor folder for documentation just once 2025-01-28 15:37:55 +09:00
Akshay Birajdar
b48febf27f [rubygems/rubygems] Remove respond_to? check for Thread#name=
Since bundler now requires 3.3.1, we no longer need to do respond_to?
check before setting thread name.

bfc37fc7db
2025-01-28 15:31:58 +09:00
David Rodríguez
9b2ebfc729 [rubygems/rubygems] Fix bug report template incorrectly showing up
If a gem has an internal error, that should not make `bundle console`
print the bug report template.

7432a9a084
2025-01-28 15:31:57 +09:00
David Rodríguez
83b4de8520 [rubygems/rubygems] Remove unnecessary check
At this point, `dep.autorequire` is always nil.

0fb2b0a70a
2025-01-28 15:31:57 +09:00
David Rodríguez
0e985e13fe [rubygems/rubygems] Remove unnecessary initialization
This local variable is initialized later on in this file.

5c15dbd210
2025-01-28 15:31:56 +09:00
David Rodríguez
6460777cde [rubygems/rubygems] Retry namespaced require using retry
It's simpler.

76f1e3bf05
2025-01-28 15:31:55 +09:00
David Rodríguez
7ae6aa0efc [rubygems/rubygems] Handle all Bundle.require exceptions at the same level
a5519f4f79
2025-01-28 15:31:55 +09:00
David Rodríguez
d157aa7a97 [rubygems/rubygems] Remove dead code
LoadError is not a RuntimeError.

4c67549722
2025-01-28 15:31:54 +09:00
David Rodríguez
f6e7f5337b [rubygems/rubygems] Remove unnecessary @autorequire initialization
It's initialized again later on.

c3ddc81659
2025-01-28 15:31:53 +09:00
David Rodríguez
d8394461fd [rubygems/rubygems] Support installing arm native gems on Windows
96496e3f53

Co-authored-by: Johnny Shields <johnny.shields@gmail.com>
2025-01-28 15:31:53 +09:00
David Rodríguez
4788880104 [rubygems/rubygems] Reuse platform constants
We need to move platform monkeypatching to happen earlier because
otherwise `Bundler::GemHelpers` will use the constants before they have
actually been defined.

086c3438dc
2025-01-28 15:31:52 +09:00
David Rodríguez
0603c1c68f [rubygems/rubygems] Define Bundler::SpecSet#to_s
For better debuggability.

21d252fa7a
2025-01-28 15:31:51 +09:00
David Rodríguez
c28ce7604f [rubygems/rubygems] Remove unnecessary mapping
I don't think any supported platform has these names, so the mapping
should be unnecessary.

6b1bdfc8a8
2025-01-28 15:31:47 +09:00
Hiroshi SHIBATA
be1d0fcdb0 Added force_activate feature again 2025-01-24 15:46:46 +09:00
Hiroshi SHIBATA
68095ffc16 irb and reline are now bundled gems, we don't need to skip workaround for them 2025-01-24 15:46:46 +09:00
Hiroshi SHIBATA
0fdc9b9fd1 Migrate irb and reline to the bundled gems 2025-01-24 15:46:46 +09:00
Nobuyoshi Nakada
881924f259 [ruby/uri] [DOC] Make documentation 100%
fe7aa3dac2
2025-01-24 01:45:08 +00:00
Olle Jonsson
a1ba394626 [ruby/weakref] weakref.gemspec: Drop gemspec config on executables
This gem does not expose any executables.

819471ce35
2025-01-23 00:24:44 +00:00
tomoya ishida
6821b05749 [ruby/irb] Bump version to 1.15.1
(https://github.com/ruby/irb/pull/1070)

df37b074e3
2025-01-22 23:08:34 +09:00
tomoya ishida
c066453118 [ruby/irb] Fix pager preview with escape sequence and newlines
(https://github.com/ruby/irb/pull/1069)

a139562a07
2025-01-22 23:08:34 +09:00
Stan Lo
9ce642c282 [ruby/irb] Update documentation about the new copy command
(https://github.com/ruby/irb/pull/1067)

6194111611
2025-01-22 23:08:34 +09:00
tomoya ishida
7813edbe19 [ruby/irb] Show a quick preview of inspect result before pager
launch
(https://github.com/ruby/irb/pull/1040)

* Quickly show inspect preview even if pretty_print takes too much time

* Show a message "Inspecting..." while generating pretty_print content

* Update inspecting message

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Update rendering test for preparing inspect message

* Don't show preview if pretty_print does not take time

---------

03c36586e6

Co-authored-by: Stan Lo <stan001212@gmail.com>
2025-01-22 23:08:34 +09:00
Prajjwal Singh
c6e8ee4514 [ruby/irb] Add copy command (https://github.com/ruby/irb/pull/1044)
Closes https://github.com/ruby/irb/pull/753

a24ac53d48
2025-01-22 23:08:34 +09:00
Stan Lo
abed4ea810 [ruby/irb] Bump version to v1.15.0
(https://github.com/ruby/irb/pull/1066)

d3531d8fc0
2025-01-21 16:24:12 +00:00
Charles Oliver Nutter
b1d5d1666e [ruby/resolv] Check for Windows in JRuby-compatible way
de95f557b0
2025-01-21 08:03:42 +00:00
Nobuyoshi Nakada
d3bd8df2b8 [ruby/resolv] Use port number 0 for ephemeral port if save
On platforms where ephemeral port randomization is implemented, the
same randomization is not needed in the ruby library layer.

Fixes https://github.com/ruby/resolv/pull/63.

45e1b563c0
2025-01-21 07:58:34 +00:00
wanabe
e5f81e511f [ruby/error_highlight] Use $stderr instead of STDERR for Ractor
a221a4b0eb
2025-01-21 03:32:15 +00:00
Earlopain
769cccba56 [ruby/prism] Fix parser translator scope issues for implicit hash values
`builder.pair_label` is no good since it makes use of variables that the parser gem encountered.
Since the prism translator doesn't keep proper track of that information, the following code interprets
the implicit value as a local variable, even though it is not in scope:

```rb
def foo
  bar = 123
end

{ bar: }
```

bbeb5b083a
2025-01-20 18:03:13 +00:00
David Rodríguez
1c8fc25b88 [rubygems/rubygems] Fix broken link in bundle issue output
0909f07f30
2025-01-20 13:50:29 +09:00
David Rodríguez
ee7b74799c [rubygems/rubygems] Fix --prefer-local not respecting default gems
3df86cd9c6
2025-01-20 13:50:27 +09:00
David Rodríguez
976cee57b1 [rubygems/rubygems] Don't fallback to evaluating YAML gemspecs as Ruby code
ca0a7ff8cd
2025-01-20 13:50:25 +09:00
kaiba
fe03cc22e6 [ruby/reline] Fix typo: marco -> macro
(https://github.com/ruby/reline/pull/806)

2111172302
2025-01-16 13:02:45 +00:00
David Rodríguez
e7de621b5a [rubygems/rubygems] Revert RubyGems plugins getting loaded on Bundler.require
These changes were included when adding bundler plugin hooks for
`Bundler.require`, but they seem completely unrelated to that feature,
and have caused several issues.

8d56551dcf
2025-01-16 19:41:12 +09:00
Michael Rykov
3638f67069 [rubygems/rubygems] fix @licenses array unmarshalling
12f3e78c95
2025-01-16 19:41:11 +09:00
tomoya ishida
e5ad894959 [ruby/irb] Colorize backref token bold green like global variables
(https://github.com/ruby/irb/pull/1065)

0b60a5be1d
2025-01-15 17:57:46 +00:00
Hiroshi SHIBATA
86d871d29c Migrate rdoc as bundled gems 2025-01-15 16:52:56 +09:00
wanabe
272a8c3c3f [ruby/erb] Make @scanner_map of ERB::Compiler::Scanner ractor-shareable
- Freeze on assignment
- Recreate Hash on registration

12d69fc2b3
2025-01-15 04:07:43 +00:00
wanabe
96b5cde28b [ruby/erb] Make ERB::NOT_GIVEN ractor-shareable
348777b5bf
2025-01-15 04:07:43 +00:00
Earlopain
56242ba495 Better handle regexp in the parser translator
Turns out, it was already almost correct. If you disregard \c and \M style escapes, only a single character is allowed to be escaped in a regex so most tests passed already.

There was also a mistake where the wrong value was constructed for the ast, this is now fixed.
One test fails because of this, but I'm fairly sure it is because of a parser bug. For `/\“/`, the backslash is supposed to be removed because it is a multibyte character. But tbh,
I don't entirely understand all the rules.

Fixes more than half of the remaining ast differences for rubocop tests
2025-01-14 20:33:11 +00:00
Kevin Newton
51d3d6ac8c [ruby/prism] Support forwarding flags on scopes
When parent scopes around an eval are forwarding parameters (like
*, **, &, or ...) we need to know that information when we are in
the parser. As such, we need to support passing that information
into the scopes option. In order to do this, unfortunately we need
a bunch of changes.

The scopes option was previously an array of array of strings.
These corresponded to the names of the locals in the parent scopes.
We still support this, but now additionally support passing in a
Prism::Scope instance at each index in the array. This Prism::Scope
class holds both the names of the locals as well as an array of
forwarding parameter names (symbols corresponding to the forwarding
parameters). There is convenience function on the Prism module that
creates a Prism::Scope object using Prism.scope.

In JavaScript, we now additionally support an object much the same
as the Ruby side. In Java, we now have a ParsingOptions.Scope class
that holds that information. In the dump APIs, these objects in all
3 languages will add an additional byte for the forwarding flags in
the middle of the scopes serialization.

All of this is in service of properly parsing the following code:

```ruby
def foo(*) = eval("bar(*)")
```

21abb6b7c4
2025-01-14 20:31:38 +00:00
Justin Collins
d0c493df7d [ruby/prism] Fix block parameters and it for RubyParser
7a93a307ac
2025-01-14 15:33:02 +00:00
Kevin Newton
da93c9ae29 [ruby/prism] Refactor serializer
8ab2532f09
2025-01-14 15:32:41 +00:00
Kevin Newton
713f31872a [ruby/prism] Freeze AST option
To make it so that you can pass `freeze: true` to Prism parse
methods and get back a deeply-frozen AST that is Ractor-
shareable.

8e6a93b2d2
2025-01-14 15:32:39 +00:00
Nobuyoshi Nakada
4daa5ebb77
[DOC] About create_makefile
Describe two features that were missing from the documentation:

- yields configuration part if a block is given.
- "depend" file will be included.
2025-01-14 15:34:17 +09:00
David Rodríguez
1fae0d7256 Use ronn-ng again for documentation generation
We switched to nronn because ronn-ng felt abandoned, but it seems
it has activity again, so switch back.
2025-01-14 12:24:37 +09:00