Commit graph

14659 commits

Author SHA1 Message Date
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.

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"`.

bb3c922341
2024-04-25 18:46:05 +00:00
Kevin Newton
b6489e9f62 [ruby/prism] Remove need for Natalie patches
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)

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.

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

9d74b699f5
2024-04-25 10:35:46 +00:00
David Rodríguez
5577f138b4 [rubygems/rubygems] Properly resolve aliases when bundle help is run
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.

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.

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

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 169a9a2c30.

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.

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
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)

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

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

a446580e75
2024-04-23 12:45:17 +00:00
Nobuyoshi Nakada
9b580ee7b6 [rubygems/rubygems] Clear temporary directory
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.

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

0b5dd6afd0
2024-04-20 07:45:41 +00:00
Kevin Newton
23be6599a2 [ruby/prism] Split parse result based on type
17194e096d
2024-04-19 19:25:32 +00:00
Kevin Newton
c7255ca219 [ruby/prism] Fix up ruby_parser translation for dstr
b0fa4b7cd8
2024-04-19 18:05:07 +00:00
Kevin Newton
2e80ceb6ff [ruby/prism] Fix it parameters for parser translation
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)

0fe4fdc794
2024-04-19 12:08:22 +00:00
Artur
e133d0c7a1 [ruby/time] Document exception thrown by Time.strptime
f9d078082f
2024-04-19 10:32:04 +00:00
Hiroshi SHIBATA
7522d1bffe [rubygems/rubygems] Keep backword compatibility of Bundler.require
f6f79f4c37
2024-04-19 05:18:21 +00:00
Hiroshi SHIBATA
acc326b7c4 [rubygems/rubygems] Removed needless class name
a2f43d3756
2024-04-19 05:18:21 +00:00
Hiroshi SHIBATA
a95b46db06 [rubygems/rubygems] Track HEAD changes for old PR proposal
e3d180620c
2024-04-19 05:18:21 +00:00
Hiroshi SHIBATA
0a14fee02f [rubygems/rubygems] Removed redundant begin
a9d22e5f46
2024-04-19 05:18:20 +00:00
fatkodima
09cbbe0e3d [rubygems/rubygems] Add plugin hooks for Bundler.require
b373b7ed0d
2024-04-19 05:18:20 +00:00
Kevin Newton
a51139230b [ruby/prism] Bump to v0.26.0
eadb09ef36
2024-04-18 18:36:57 +00:00
Kevin Newton
8f908a354e [ruby/prism] "Fix" transpose issue in parser compiler
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)

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)

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

ce30c23730
2024-04-18 11:07:09 +09:00
Nobuyoshi Nakada
0f1ef19fcd
[ruby/optparse] Fix typo [ci skip]
0aec9adfc5
2024-04-18 10:27:19 +09:00
Nobuyoshi Nakada
88a88b56c7
[ruby/optparse] [DOC] Package files for RDoc
b49cb996af
2024-04-18 10:27:19 +09:00
Ben Fritsch
6ac8f6a10e
[ruby/ipaddr] Add IPAddr.cidr to return ip address in cidr notation
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

---------

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.

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
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

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
Nobuyoshi Nakada
09638741ba [Feature #20335] Thread.each_caller_location arguments
Accecpt the same arguments as `caller` and `caller_locations`.
2024-04-17 18:47:07 +09:00
tomoya ishida
79df0f135e [ruby/reline] Refactor history move and history search
(https://github.com/ruby/reline/pull/651)

90e43e01d4
2024-04-16 14:06:22 +00:00
Mari Imaizumi
8e341d81c9 [ruby/reline] Bump version to 0.5.2
(https://github.com/ruby/reline/pull/682)

17d12cc511
2024-04-16 12:42:57 +00:00