summaryrefslogtreecommitdiff
path: root/lib/irb/statement.rb
AgeCommit message (Collapse)Author
2025-01-24Migrate irb and reline to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12624
2025-01-10[ruby/irb] Gracefully handle incorrect command aliasesStan Lo
(https://github.com/ruby/irb/pull/1059) * Gracefully handle incorrect command aliases Even if the aliased target is a helper method or does not exist, IRB should not crash. This commit warns users in such cases and treat the input as normal expression. * Streamline command parsing and introduce warnings for incorrect command aliases https://github.com/ruby/irb/commit/9fc14eb74b
2024-06-18[ruby/irb] Improve how command calls' return value is handledStan Lo
(https://github.com/ruby/irb/pull/972) In #934, we changed command calls to return nil only. This PR improves the behaviour even further by: - Not echoing the `nil` returned by command calls - Not overriding previous return value stored in `_` with the `nil` from commands https://github.com/ruby/irb/commit/c844176842
2024-04-10[ruby/irb] Command implementation not by methodtomoya ishida
(https://github.com/ruby/irb/pull/824) * Command is not a method * Fix command test * Implement non-method command name completion * Add test for ExtendCommandBundle.def_extend_command * Add helper method install test * Remove spaces in command input parse * Remove command arg unquote in help command * Simplify Statement and handle execution in IRB::Irb * Tweak require, const name * Always install CommandBundle module to main object * Remove considering local variable in command or expression check * Remove unused method, tweak * Remove outdated comment for help command arg Co-authored-by: Stan Lo <[email protected]> --------- https://github.com/ruby/irb/commit/8fb776e379 Co-authored-by: Stan Lo <[email protected]>
2024-02-18[ruby/irb] Revamp `help` commandStan Lo
(https://github.com/ruby/irb/pull/877) * Make help command display help for individual commands Usage: `help [command]` If the command is not specified, it will display a list of all available commands. If the command is specified, it will display the banner OR description of the command. If the command is not found, it will display a message saying that the command is not found. * Rename test/irb/cmd to test/irb/command * Add banner to edit and ls commands * Promote help command in the help message 1. Make `show_cmds` an alias of `help` so it's not displayed in the help message 2. Update description of the help command to reflect `help <command>` syntax * Rename banner to help_message https://github.com/ruby/irb/commit/43a2c99f3f
2024-02-16[ruby/irb] Standardize command related namesStan Lo
(https://github.com/ruby/irb/pull/873) * Replace ExtendCommand with Command and standardize command related names 1. Rename lib/irb/extend-command.rb to lib/irb/command.rb 2. Rename lib/irb/cmd/*.rb to lib/irb/command/*.rb 3. Rename test/irb/test_cmd.rb to test/irb/test_command.rb 4. Rename ExtendCommand to Command * Alias ExtendCommand to Command and deprecate it * Rename Command::Nop to Command::Base * Not deprecate old constants just yet * Add lib/irb/cmd/nop.rb back https://github.com/ruby/irb/commit/462c1284af
2024-02-16[ruby/irb] Support repeating debugger input by passing empty inputStan Lo
to it (https://github.com/ruby/irb/pull/856) * Test IRB's behaviour with empty input * Handle empty input and pass it to debugger Since `rdbg` accepts empty input to repeat the previous command, IRB should take empty input in `irb:rdbg` sessions and pass them to the debugger. Currently, IRB simply ignores empty input and does nothing. This commit creates `EmptyInput` to represent empty input so it can fit into the current IRB's input processing flow in `Irb#eval_input`. https://github.com/ruby/irb/commit/0e9db419be
2023-08-29[ruby/irb] Improve help/show_cmds message during debuggerStan Lo
integration (https://github.com/ruby/irb/pull/693) * `help` should display debugger's help during irb:rdbg session * Update `show_cmds`'s output when in irb:rdbg session https://github.com/ruby/irb/commit/4029c2e564
2023-08-16[ruby/irb] Encapsulate input details in Statement objectsStan Lo
(https://github.com/ruby/irb/pull/682) * Introduce Statement class * Split Statement class for better clarity https://github.com/ruby/irb/commit/65e8e68690