Commit graph

14659 commits

Author SHA1 Message Date
Noah Gibbs
5b7baa0486 [ruby/prism] More different block-call syntaxes, support more types of method calls
40cf114a24
2024-02-07 19:42:13 +00:00
Noah Gibbs
73d222e1ef [ruby/prism] Support &. calls and calling with blocks, test with fixtures
e346fa583a
2024-02-07 19:42:13 +00:00
Noah Gibbs
b1310940e3 [ruby/prism] RipperCompat: support more kinds of method calls and operators.
Add tests. Start parsing some simpler fixture code.

997f4191d8
2024-02-07 19:42:13 +00:00
Kevin Newton
fcc8df622a
Bump prism version 2024-02-07 13:36:06 -05:00
Stan Lo
0b7f516834 [ruby/irb] Bump version to v1.11.2
(https://github.com/ruby/irb/pull/865)

afe1f459cc
2024-02-07 16:57:33 +00:00
Kevin Newton
aad3c36bdf [ruby/prism] Support for Ruby 2.7
1a15b70a8e
2024-02-07 16:54:34 +00:00
Stan Lo
5f4245e74b [ruby/irb] Polish tracer integration and tests
(https://github.com/ruby/irb/pull/864)

* Remove useless ivar

* Simplify tracer test setup

* Treat tracer like a normal development dependency

* Only require ext/tracer when value is truthy

* Make tracer integration skip IRB traces

a97a4129a7
2024-02-07 14:59:10 +00:00
Kevin Newton
164c18af7b [ruby/prism] Correct handle recover parameters on tokenize for parser translation
63979de21d
2024-02-07 14:44:36 +00:00
Kim Emmanuel
0edf5a714b [rubygems/rubygems] #to_spec must fallback for prereleases always
6302798a32
2024-02-07 05:46:50 +00:00
Kim Emmanuel
5ddf4f5c95 [rubygems/rubygems] fix Gem::Dependency#to_spec returning nil when prerelease is the only available version
a7dcc7214b
2024-02-07 05:46:49 +00:00
Kevin Newton
2dba441397 [ruby/prism] Even more ripper compat
47a602dc1c
2024-02-07 03:21:02 +00:00
Noah Gibbs
e34505c631 [ruby/prism] More visitors and tests for RipperCompat
Part of issue #2354

cb28edae34
2024-02-07 01:49:54 +00:00
eileencodes
936c0ab5e8 [ruby/prism] Implement file parsing error handling
This PR implements proper file parsing error handling. Previously
`file_options` would call `pm_string_mapped_init` which would print an
error from `perror`. However this wouldn't raise a proper Ruby error so
it was just a string output. I've done the following:

- Raise an error from `rb_syserr_fail` with the filepath in
`file_options`.
- No longer return `Qnil` if `file_options` returns false (because now
it will raise)
- Update `file_options` to return `static void` instead of `static
bool`.
- Update `file_options` and `profile_file` to check the type so when
passing `nil` we see a `TypeError`.
- Delete `perror` from `pm_string_mapped_init`
- Update `FFI` backend to raise appropriate errors when calling
`pm_string_mapped_init`.
- Add tests for `dump_file`, `lex_file`, `parse_file`,
`parse_file_comments`, `parse_lex_file`, and `parse_file_success?`
when a file doesn't exist and for `nil`.
- Updates the `bin/parse` script to no longer raise it's own
`ArgumentError` now that we raise a proper error.

Fixes: ruby/prism#2207

b2f7494ff5
2024-02-06 20:49:33 +00:00
Nuno Silva
300dee1fe8 [ruby/irb] Fix usage of tracer gem and add tests
(https://github.com/ruby/irb/pull/857)

The new tests are skipped when ruby below 3.1, as it was a default gem on it, and in a version we do not support.

This also move definition of `use_tracer` to module Context instead of monkey patch.

08834fbd5f
2024-02-06 16:46:50 +00:00
David Rodriguez
ca7a48110f [rubygems/rubygems] Revert "Simplify how extensions are built"
This reverts commit 0b8faf1e39.

7528e0f1ce
2024-02-05 18:17:24 +00:00
Kevin Newton
0b5be2f9e9 Sync to latest prism 2024-02-05 11:07:07 -05:00
Stan Lo
5d646fa136 [ruby/irb] Require pathname (https://github.com/ruby/irb/pull/860)
0ab96ed426
2024-02-02 22:25:33 +00:00
Ignacio Chiazzo Cardarello
aa780a678e [ruby/irb] Add a warning for when the history path doesn't exist
(https://github.com/ruby/irb/pull/852)

* Add a warning for when the history path doesn't exist

* warn when the directory does not exist

* added test for when the history_file does not exist

* Update lib/irb/history.rb

---------

9e6fa67212

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-02-02 21:58:22 +00:00
Mike Dalessio
31e4300ea7 [rubygems/rubygems] feat: Gem::Specification#initialize_copy deep-copies requirements
to avoid accidentally mutating the original's state when doing:

```ruby
spec2 = spec.dup
spec2.required_rubygems_version.concat([">= 3.3.22"])
```

see https://github.com/rake-compiler/rake-compiler/pull/236 for a
real-world use case that would be made simpler with this behavior.

c1d52389f0
2024-02-02 21:38:04 +00:00
Mike Dalessio
66a6f2b15a [rubygems/rubygems] feat: Gem::Requirement#initialize_copy deep-copies @requirements
to avoid accidentally mutating the original's state when doing:

```ruby
req2 = req.dup
req2.concat([">= 3.3.22"])
```

see https://github.com/rake-compiler/rake-compiler/pull/236 for a
real-world use case that would be made simpler with this behavior.

8e0c03144e
2024-02-02 21:38:04 +00:00
Kevin Newton
d2f004cf6a [ruby/prism] Fix hash pairs in patterns
b7ab29daa0
2024-02-02 21:16:04 +00:00
Vitaliy Serov
0bcad50c8c [rubygems/rubygems] Fix var name and also update other places
f72a7989cd
2024-02-02 19:26:58 +00:00
Vitaliy Serov
064f251571 [rubygems/rubygems] Change gem login message to clear up that username can be also used
2bf6163eaf
2024-02-02 19:26:57 +00:00
Kevin Newton
420a6349ec [ruby/prism] Small fixes for the parser translator
4327051c86
2024-02-02 13:36:23 -05:00
Kevin Newton
e9f1324464 Sync to latest prism 2024-02-01 12:52:16 -05:00
Stan Lo
ef427123ad [ruby/irb] Add rubocop with a few basic styling rules
(https://github.com/ruby/irb/pull/849)

* Use rubocop to enforce a few styling rules

* Add a CI job for linting

4f60cd88bb
2024-02-01 17:46:02 +00:00
Stan Lo
f36c61d27f [ruby/irb] Reset history counter even when @loaded_history_lines is
not defined
(https://github.com/ruby/irb/pull/853)

The issue (https://github.com/ruby/debug/issues/1064) is caused by a
combination of factors:

1. When user starts an IRB session without a history file, the
   `@loaded_history_lines` ivar is not defined.
2. If the user then starts the `irb:rdbg` session, the history counter
   is not set, because the `@loaded_history_lines` is not defined.
3. Because `irb:rdbg` saves the history before passing Ruby expression
   to the debugger, it saves the history with duplicated lines. The number
   grows in exponential order.
4. When the user exits the `irb:rdbg` session, the history file could be
   bloated with duplicated lines.

This commit fixes the issue by resetting the history counter even when
`@loaded_history_lines` is not defined.

4afc98c258
2024-02-01 16:19:07 +00:00
Nuno Silva
1236a74023 [ruby/irb] Skip re-setup when creating a child session
(https://github.com/ruby/irb/pull/850)

06b2d00dd3
2024-02-01 12:12:06 +00:00
David Rodriguez
95c9711d6e [rubygems/rubygems] Fix musl platform not being added to the lockfile
235f7b4266
2024-01-31 19:07:39 +00:00
Hiroshi SHIBATA
3de2ab7fdb [ruby/yaml] Make PStore support as optional
da421ce46f
2024-01-31 05:56:39 +00:00
Kevin Newton
731367d0ab [ruby/prism] Fix up CI
224ea85565
2024-01-30 18:45:19 +00:00
Aaron Patterson
8e708e4a07 Update forwarding locals for prism 2024-01-30 13:19:06 -05:00
tomoya ishida
fd44b42fb3 [ruby/irb] Fix undef and alias indent
(https://github.com/ruby/irb/pull/838)

a641746b18
2024-01-30 12:55:47 +00:00
Hiroshi SHIBATA
2f54422d03 [rubygems/rubygems] Update namespace Gem::Resolver::Molinillo to Gem::Molinillo
6c4caf3ab0
2024-01-30 09:26:54 +00:00
Hiroshi SHIBATA
b31995d882 [rubygems/rubygems] Rename molinillo wrapper file to vendored_molinillo.rb
d7c15f6fd7
2024-01-30 09:26:54 +00:00
Hiroshi SHIBATA
03246171cc
Move molinillo under the vendor directory 2024-01-30 14:07:51 +09:00
Hiroshi SHIBATA
dfa8e696f2
Move tsort under the vendor directory 2024-01-30 14:07:18 +09:00
Hiroshi SHIBATA
881e76cef3
Move timeout under the vendor directory 2024-01-30 14:06:38 +09:00
Hiroshi SHIBATA
04dbdc81d1
Move net-http under the vendor directory 2024-01-30 14:05:59 +09:00
Hiroshi SHIBATA
6933aee9eb
Move net-protocol under the vendor directory 2024-01-30 14:05:07 +09:00
Hiroshi SHIBATA
898090ada1
Move optparse under the vendor directory 2024-01-30 14:03:52 +09:00
Hiroshi SHIBATA
5a0302d222
Move resolv under the vendor directory 2024-01-30 14:01:59 +09:00
Willian Tenfen W
d42330d702 [rubygems/rubygems] Improve gem login scope selection
26c7abe5f6
2024-01-29 17:22:01 +00:00
Kevin Newton
e050097beb [ruby/prism] Raise diagnostics for parser
102b4a16f5
2024-01-29 16:09:47 +00:00
Masato Ohba
933ede5d76 [rubygems/rubygems] Remove travis_removal_info
`travis_removal_info` is added by https://github.com/rubygems/rubygems/pull/6150. According to the comment, it's supposed to be removed at bundler v2.5.0 but it hasn't.

e18797d43f
2024-01-29 05:39:13 +00:00
David Rodríguez
e99951edfa [rubygems/rubygems] Simplify how extensions are built
0b8faf1e39
2024-01-29 12:20:44 +09:00
David Rodríguez
1991c6d7a0 [rubygems/rubygems] Remove now unnecessary elseif
d05b9e659b

Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
2024-01-29 12:19:32 +09:00
David Rodríguez
355480dec6 [rubygems/rubygems] Properly restore empty env vars
e0d68a8688
2024-01-29 12:19:31 +09:00
Hiroshi SHIBATA
2956d3a511
Removed duplicated license file 2024-01-29 12:18:26 +09:00
David Rodríguez
f3123f8af2 [rubygems/rubygems] Use rubygems vendored uri from Bundler when available
5d6a8f2fb4
2024-01-29 12:15:10 +09:00