13162 Commits

Author SHA1 Message Date
Kevin Newton
3872e54039 [ruby/prism] Bump to v0.27.0
https://github.com/ruby/prism/commit/c9edeef91a
2024-04-26 17:01:03 -04:00
Kevin Newton
9688093124 [ruby/prism] Location#slice_lines, Node#slice_lines
https://github.com/ruby/prism/commit/9b61f6fdb3
2024-04-26 19:05:32 +00:00
Stan Lo
148518baa0 [ruby/irb] Suppress command return values
(https://github.com/ruby/irb/pull/934)

Since commands can't be chained with methods, their return values are
not intended to be used. But if IRB keeps storing command return values
as the last value, and print them, users may rely on such implicit
behaviour.

So to avoid such confusion, this commit suppresses command's
return values. It also updates some commands that currently rely on
this implicit behaviour.

https://github.com/ruby/irb/commit/fa96bea76f
2024-04-26 17:52:12 +00:00
Stan Lo
25a8b76c76 [ruby/irb] Command registration should take both strings and symbols
as names
(https://github.com/ruby/irb/pull/932)

This will save users some heads scratching when they try to register a
command with a string name and found that it doesn't work.

I also rewrote converted custom command tests into integration tests to
make test setup/cleanup easier.

https://github.com/ruby/irb/commit/a91a212dbe
2024-04-26 12:12:31 +00:00
Josh Nichols
6f4f360fc4 [rubygems/rubygems] Add auto_install support to require "bundler/setup"
We have some places that already use `bundle config auto_install true`,
ie:

7a144f3374/bundler/lib/bundler/cli.rb (L11)

This applies the same logic (copy and pasted) to happen when you
`require "bundler/setup"`.

https://github.com/rubygems/rubygems/commit/bb3c922341
2024-04-25 18:46:05 +00:00
Kevin Newton
b6489e9f62 [ruby/prism] Remove need for Natalie patches
https://github.com/ruby/prism/commit/7fc7e13476
2024-04-25 18:00:09 +00:00
tomoya ishida
4ff249363d [ruby/reline] Fix inputrc nested $if $else $endif bug
(https://github.com/ruby/reline/pull/689)

https://github.com/ruby/reline/commit/0d8aea26ec
2024-04-25 16:12:50 +00:00
David Rodriguez
5d2fb5d76b [rubygems/rubygems] Don't upcase Windows ENV when backing it up
I apparently did that to fix some issue with case insensitivity but I
didn't add a spec, and I think not upcasing should not cause issues.

https://github.com/rubygems/rubygems/commit/1b6f23275a
2024-04-25 10:35:47 +00:00
David Rodriguez
2871376510 [rubygems/rubygems] Remove unnecessary workaround
All supported rubies include the fix.

https://github.com/rubygems/rubygems/commit/9d74b699f5
2024-04-25 10:35:46 +00:00
David Rodríguez
5577f138b4 [rubygems/rubygems] Properly resolve aliases when bundle help is run
https://github.com/rubygems/rubygems/commit/5d9bf03c59
2024-04-25 10:35:02 +00:00
Eugene Kenny
67dd9af17e [Bug #20450] Remove rubyarchdir from bootsnap paths 2024-04-25 13:29:28 +09:00
Stan Lo
4349c7909f [ruby/irb] Memoize helper method instances with Singleton module
(https://github.com/ruby/irb/pull/931)

Some helpers, like Rails console's `app`, requires memoization of the
helper's ivars. To support it IRB needs to memoize helper method instances
as well.

https://github.com/ruby/irb/commit/a96c7a6668
2024-04-24 18:32:55 +00:00
Kevin Newton
6d9ba1e014 [ruby/prism] Change inspect from recursive to a queue
We would previously cause a stack overflow if we parsed a file that
was too deeply nested when we were calling inspect. Instead, we now
use a queue of commands to do it linearly so we don't.

https://github.com/ruby/prism/commit/0f21f5bfe1
2024-04-24 14:16:42 -04:00
tomoya ishida
cf24a0483e [ruby/reline] Long line performance
(https://github.com/ruby/reline/pull/688)

* Improve C-e (ed_move_to_end) performance for long line

* Reline::Unicode.split_by_width optimization for RESET_SGR

https://github.com/ruby/reline/commit/0c8d3c827a
2024-04-24 17:33:40 +00:00
Stan Lo
9bba999be7 [ruby/irb] Revert "Memoize helper method instances with Singleton module"
This reverts commit https://github.com/ruby/irb/commit/169a9a2c3097.

https://github.com/ruby/irb/commit/221b0a4928
2024-04-24 16:01:23 +00:00
Stan Lo
e5ca3d072f [ruby/irb] Memoize helper method instances with Singleton module
Some helpers, like Rails console's `app`, requires memoization of the
helper's ivars. To support it IRB needs to memoize helper method instances
as well.

https://github.com/ruby/irb/commit/169a9a2c30
2024-04-24 16:01:02 +00:00
Stan Lo
e11237904c
Sync IRB f9347b1 (#10611) 2024-04-23 21:00:56 +00:00
Kevin Newton
81433fd0f5 [ruby/prism] srange_find should only look on current line
https://github.com/ruby/prism/commit/3604aa15e7
2024-04-23 19:29:20 +00:00
Mari Imaizumi
981a8e89a3 [ruby/reline] Bump version to 0.5.3
(https://github.com/ruby/reline/pull/686)

https://github.com/ruby/reline/commit/e9d5236c74
2024-04-23 15:27:58 +00:00
tomoya ishida
53a67efc9a [ruby/reline] Separate prompt and input line in rendering
(https://github.com/ruby/reline/pull/652)

* Separate prompt and input line in rendering

Often, only one of prompt and input changes.
Split prompt+input_line to a separate rendering item will improve differential rendering performance.

* Rename method wrapped_prompt_lines to more descriptive name

https://github.com/ruby/reline/commit/16d82f1f23
2024-04-23 14:45:22 +00:00
Kevin Newton
dae5900305 [ruby/prism] Fix up rdoc
Fixes https://github.com/ruby/prism/issues/2572

https://github.com/ruby/prism/commit/a446580e75
2024-04-23 12:45:17 +00:00
Nobuyoshi Nakada
9b580ee7b6 [rubygems/rubygems] Clear temporary directory
https://github.com/rubygems/rubygems/commit/4158034d89
2024-04-21 23:47:47 +00:00
Stan Lo
f16c6ac4fd [ruby/irb] Stop using ExtendCommandBundle internally
(https://github.com/ruby/irb/pull/925)

This module was used to extend both commands and helpers when they're not
separated. Now that they are, and we have a Command module, we should move
command-related logic to the Command module and update related references.

This will make the code easier to understand and refactor in the future.

https://github.com/ruby/irb/commit/f74ec97236
2024-04-20 18:55:54 +00:00
tomoya ishida
125e1ed5f7 [ruby/irb] Remove exit command workaround, handle IRB_EXIT in
debug_readline
(https://github.com/ruby/irb/pull/923)

* Remove exit and exti! command workaround when executed outside of IRB

Command was a method. It could be executed outside of IRB.
Workaround for it is no longer needed.

* Handle IRB_EXIT in debug mode

* Add exit and exit! command in rdbg mode

https://github.com/ruby/irb/commit/0b5dd6afd0
2024-04-20 07:45:41 +00:00
Kevin Newton
23be6599a2 [ruby/prism] Split parse result based on type
https://github.com/ruby/prism/commit/17194e096d
2024-04-19 19:25:32 +00:00
Kevin Newton
c7255ca219 [ruby/prism] Fix up ruby_parser translation for dstr
https://github.com/ruby/prism/commit/b0fa4b7cd8
2024-04-19 18:05:07 +00:00
Kevin Newton
2e80ceb6ff [ruby/prism] Fix it parameters for parser translation
https://github.com/ruby/prism/commit/2f3feb8d51
2024-04-19 16:29:39 +00:00
Mari Imaizumi
604c29e8a2 [ruby/reline] Implement show-all-if-ambiguous feature
(https://github.com/ruby/reline/pull/683)

https://github.com/ruby/reline/commit/0fe4fdc794
2024-04-19 12:08:22 +00:00
Artur
e133d0c7a1 [ruby/time] Document exception thrown by Time.strptime
https://github.com/ruby/time/commit/f9d078082f
2024-04-19 10:32:04 +00:00
Hiroshi SHIBATA
7522d1bffe [rubygems/rubygems] Keep backword compatibility of Bundler.require
https://github.com/rubygems/rubygems/commit/f6f79f4c37
2024-04-19 05:18:21 +00:00
Hiroshi SHIBATA
acc326b7c4 [rubygems/rubygems] Removed needless class name
https://github.com/rubygems/rubygems/commit/a2f43d3756
2024-04-19 05:18:21 +00:00
Hiroshi SHIBATA
a95b46db06 [rubygems/rubygems] Track HEAD changes for old PR proposal
https://github.com/rubygems/rubygems/commit/e3d180620c
2024-04-19 05:18:21 +00:00
Hiroshi SHIBATA
0a14fee02f [rubygems/rubygems] Removed redundant begin
https://github.com/rubygems/rubygems/commit/a9d22e5f46
2024-04-19 05:18:20 +00:00
fatkodima
09cbbe0e3d [rubygems/rubygems] Add plugin hooks for Bundler.require
https://github.com/rubygems/rubygems/commit/b373b7ed0d
2024-04-19 05:18:20 +00:00
Kevin Newton
a51139230b [ruby/prism] Bump to v0.26.0
https://github.com/ruby/prism/commit/eadb09ef36
2024-04-18 18:36:57 +00:00
Kevin Newton
8f908a354e [ruby/prism] "Fix" transpose issue in parser compiler
https://github.com/ruby/prism/commit/593d637178
2024-04-18 18:34:42 +00:00
careworry
8e08556fa7
chore: remove repetitive words (#10573)
Signed-off-by: careworry <worrycare@outlook.com>
2024-04-18 15:32:34 +00:00
tomoya ishida
ff599aea7c [ruby/irb] Fix % escape in prompt format
(https://github.com/ruby/irb/pull/927)

https://github.com/ruby/irb/commit/08eee25d28
2024-04-18 14:46:55 +00:00
Lorenzo Zabot
2e978c2cb3 [ruby/irb] Prompt specifiers documentation improvements
(https://github.com/ruby/irb/pull/926)

https://github.com/ruby/irb/commit/e8ea8f253d
2024-04-18 10:33:23 +00:00
David Rodriguez
bc652d7568
[rubygems/rubygems] Never write credentials to lockfiles
https://github.com/rubygems/rubygems/commit/e8a363713e
2024-04-18 11:07:09 +09:00
Kenichi Kamiya
a3b7a7bc21
[ruby/reline] Remove unused variable
(https://github.com/ruby/reline/pull/684)

https://github.com/ruby/reline/commit/ce30c23730
2024-04-18 11:07:09 +09:00
Nobuyoshi Nakada
0f1ef19fcd
[ruby/optparse] Fix typo [ci skip]
https://github.com/ruby/optparse/commit/0aec9adfc5
2024-04-18 10:27:19 +09:00
Nobuyoshi Nakada
88a88b56c7
[ruby/optparse] [DOC] Package files for RDoc
https://github.com/ruby/optparse/commit/b49cb996af
2024-04-18 10:27:19 +09:00
Ben Fritsch
6ac8f6a10e
[ruby/ipaddr] Add IPAddr.cidr to return ip address in cidr notation
https://github.com/ruby/ipaddr/commit/f5b006741f
2024-04-18 10:27:19 +09:00
ParadoxV5
48846d6b8d add #2709’s new RBIs to .gemspec 2024-04-17 20:45:25 +00:00
tomoya ishida
ca764062b0 [ruby/irb] Remove internal-only methods from Command::Base
(https://github.com/ruby/irb/pull/922)

* Remove internal-only methods from Command::Base

Command#ruby_args and Command#unwrap_string_literal are used for default command's argument backward compatibility.
Moved these methods to another module to avoid being used from custom commands.

* Update lib/irb/command/edit.rb

---------

https://github.com/ruby/irb/commit/7405a841e8

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-04-17 18:36:30 +00:00
Mike Dalessio
98c84ef42c [rubygems/rubygems] Excluding local platform from lockfile should not affect musl vs gnu case
This case is for not locking things like `arm-darwin-23` when the
lockfile already includes `arm-darwin`, so that we don't infinitely keep
redundant versioned platforms in the lockfile when not necessary.

We detect this with `Gem::Platform#===`. For example,
`Gem::Platform.new("arm-darwin-23") === Gem::Platform.new("arm-darwin")`
but they're not `==`.

However, in the case of `-musl` vs `-gnu`, those act as the platform
"version", but `===` is not commutative for them. This is explained in
`===` docs.

We only want to exclude the local platform in situations when
`Gem::Platform#===` is actually commutative.

https://github.com/rubygems/rubygems/commit/8099c4face
2024-04-17 18:17:12 +00:00
Kevin Newton
d186eb36a4 [ruby/prism] Add a reflection API for determining the fields of a node
https://github.com/ruby/prism/commit/f3f9950a74
2024-04-17 13:54:29 -04:00
tomoya ishida
15b659ca93 [ruby/reline] Refactor nomultiline and multiline mode difference
(https://github.com/ruby/reline/pull/653)

* Support multiline input in Reline.readline internally, reduce multiline-singleline branch

* Add readline(singleline) prompt test with force inserting multiline text

https://github.com/ruby/reline/commit/97846095d7
2024-04-17 16:12:20 +00:00
Kevin Newton
f72436f835 [ruby/prism] Inline pm_state_stack 2024-04-17 10:36:52 -04:00