summaryrefslogtreecommitdiff
path: root/test/irb
AgeCommit message (Collapse)Author
2024-12-12[ruby/irb] Load history when starting a direct debug sessionJames Reid-Smith
(https://github.com/ruby/irb/pull/1046) * Load history when starting a direct debug session When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and `require 'debug'; debugger`, IRB's history wasn't loaded. This commit ensures history is loaded in this case by calling `load_history` when configuring IRB for the debugger. Fixes ruby/irb#975 * Update test/irb/test_history.rb * Update lib/irb/debug.rb --------- https://github.com/ruby/irb/commit/7f851b5353 Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-12-03[ruby/irb] Don't show 'Maybe IRB bug!' in show_source and ls commandtomoya ishida
(https://github.com/ruby/irb/pull/1039) https://github.com/ruby/irb/commit/9eb14a3a0b
2024-11-26[ruby/irb] Fix indentation of xstring literaltomoya ishida
(https://github.com/ruby/irb/pull/1038) Fixes indent calculation of this input ``` if false p `ls` end ``` https://github.com/ruby/irb/commit/4217a46f5d
2024-11-19[ruby/irb] Don't use delegator to install helper methods to maintomoya ishida
object (https://github.com/ruby/irb/pull/1031) IRB used delegator to install command as a method of frozen main object. Command is not a method now. We can drop it. https://github.com/ruby/irb/commit/2f1c593801
2024-11-07Prevent a warning: ambiguous `/`Yusuke Endoh
2024-10-20[ruby/irb] Improve history test's encoding settingGo
(https://github.com/ruby/irb/pull/1022) * improve history test's encoding setting * fix missing locale error for ci and refactoring https://github.com/ruby/irb/commit/7f385bc19b
2024-10-13[ruby/irb] Fix rendering test broken by conflicttomoya ishida
(https://github.com/ruby/irb/pull/1016) https://github.com/ruby/irb/commit/a21b953a99
2024-10-12[ruby/irb] Make rendering test faster using updated yamatanoorotitomoya ishida
(https://github.com/ruby/irb/pull/1001) https://github.com/ruby/irb/commit/2c2956bc1f
2024-10-11[ruby/irb] History refactors (https://github.com/ruby/irb/pull/1013)Gert Goet
* Extract logic save_history in separate helper * Extract logic history_file in helper * Allow for readonly history https://github.com/ruby/irb/commit/52307f9026
2024-10-06[ruby/irb] Change default completor from regexp to auto, trytomoya ishida
TypeCompletor and fallback to RegexpCompletor. (https://github.com/ruby/irb/pull/1010) https://github.com/ruby/irb/commit/bb6a99d815
2024-10-05[ruby/irb] Hash#inspect style has changed in ruby 3.4Nobuyoshi Nakada
[[Bug #20433]](https://bugs.ruby-lang.org/issues/20433) https://github.com/ruby/irb/commit/ecd08a527e
2024-10-02[ruby/irb] Use correct binding in debug modetomoya ishida
(https://github.com/ruby/irb/pull/1007) In debug command, IRB's context was using wrong binding. Some code colorization, command detection failed because binding.local_variable returned wrong value. https://github.com/ruby/irb/commit/68f718de21
2024-09-24[ruby/irb] Use proper locale in history encoding testtomoya ishida
(https://github.com/ruby/irb/pull/1008) https://github.com/ruby/irb/commit/f6b06a9a40
2024-09-20[ruby/irb] Fix debug command in nomultiline modetomoya ishida
(https://github.com/ruby/irb/pull/1006) * Fix debug command in nomultiline mode * context.colorize_code -> context.colorize_input https://github.com/ruby/irb/commit/71f4d6bfb5
2024-09-03[ruby/irb] Fix easter_egg run without RDoc, fix input-method testtomoya ishida
run without RDoc (https://github.com/ruby/irb/pull/998) * EasterEgg no longer depend on RDoc * Run most of the input-method tests even if RDoc is not avialable https://github.com/ruby/irb/commit/30fa1595d9
2024-09-01Skip show_doc tests if RDoc is not availableHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11491
2024-08-29Surpressing 'unknown command: “Switch to inspect mode.”' messageHiroshi SHIBATA
2024-08-28[ruby/irb] Make colorize test pass with NO_COLOR env settomoya ishida
(https://github.com/ruby/irb/pull/994) https://github.com/ruby/irb/commit/985ac509c1
2024-08-28[ruby/irb] Colorize command inputtomoya ishida
(https://github.com/ruby/irb/pull/983) https://github.com/ruby/irb/commit/0e64136e76
2024-08-04[ruby/irb] Remove Ruby version checksRicardo Trindade
(https://github.com/ruby/irb/pull/985) https://github.com/ruby/irb/commit/9ce6972e71
2024-07-18[ruby/irb] Clear ENV["XDG_CONFIG_HOME"] to avoid loadingtomoya ishida
user-defined irbrc in TestIRB::ConfigValidationTest (https://github.com/ruby/irb/pull/982) https://github.com/ruby/irb/commit/632da0ff29
2024-07-16[ruby/irb] Group class methods under `class << self`Stan Lo
(https://github.com/ruby/irb/pull/981) https://github.com/ruby/irb/commit/cdaa356df2
2024-07-05[ruby/irb] Return only commands when completing help command'sStan Lo
argument (https://github.com/ruby/irb/pull/973) The command only takes command names as arguments, so we should only return command names as candidates. This will help users find a command faster as completion will be another useful hint too. https://github.com/ruby/irb/commit/7b6557cc24
2024-07-03[ruby/irb] Introduce cd commandStan Lo
(https://github.com/ruby/irb/pull/971) It's essentially a combination of pushws and popws commands that are easier to use. Help message: ``` Usage: cd ([target]|..) IRB uses a stack of workspaces to keep track of context(s), with `pushws` and `popws` commands to manipulate the stack. The `cd` command is an attempt to simplify the operation and will be subject to change. When given: - an object, cd will use that object as the new context by pushing it onto the workspace stack. - "..", cd will leave the current context by popping the top workspace off the stack. - no arguments, cd will move to the top workspace on the stack by popping off all workspaces. Examples: cd Foo cd Foo.new cd @ivar cd .. cd ``` https://github.com/ruby/irb/commit/4a0e0e89b7
2024-06-30[ruby/irb] Allow assigning and using local variable name conflictingtomoya ishida
with command (https://github.com/ruby/irb/pull/961) https://github.com/ruby/irb/commit/00603d470f
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-06-12[ruby/irb] Invalid encoding symbol now raises SyntaxError also intomoya ishida
3.3 (https://github.com/ruby/irb/pull/969) https://github.com/ruby/irb/commit/bad7492ab0
2024-06-12[ruby/irb] Cleanup irbrc generator cache always at teardowntomoya ishida
(https://github.com/ruby/irb/pull/968) https://github.com/ruby/irb/commit/905184ff9c
2024-06-09[ruby/irb] Suppress Ruby warnings in certain backtrace filteringStan Lo
tests (https://github.com/ruby/irb/pull/966) Since they're sensitive to the warnings, and the warnings are not relevant to the tests, we can suppress them to keep the tests simple. https://github.com/ruby/irb/commit/ad642795da
2024-06-05[ruby/irb] Add accidentally dropped disable_irb command backStan Lo
(https://github.com/ruby/irb/pull/964) * Add accidentally dropped disable_irb command back * Sort command files require by name https://github.com/ruby/irb/commit/1d627cebca
2024-05-12[ruby/irb] Clean up tmpdirNobuyoshi Nakada
https://github.com/ruby/irb/commit/7d60349499
2024-05-10[ruby/irb] Add a new initialization step to validate IRB.conf'sStan Lo
values (https://github.com/ruby/irb/pull/953) Currently, users can only find out that they have set a wrong value for IRB configs when the value is used, with opaque error messages like "comparison of Integer with true failed (TypeError)". This commit adds a new initialization step to validate the values of some IRB configs, so that users can find out about the wrong values during the initialization of IRB. https://github.com/ruby/irb/commit/af8ef2948b
2024-05-05[ruby/irb] Clarify that the context is IRB contextStan Lo
(https://github.com/ruby/irb/pull/950) https://github.com/ruby/irb/commit/8cde57f55a
2024-05-04[ruby/irb] Improve help message for no meta commandsStan Lo
(https://github.com/ruby/irb/pull/948) * Remove unnecessary code from command tests * Improve help message for no meta commands 1. Add placeholder values for both command category and description 2. Update help command's output to give different types of categories more explicit ordering https://github.com/ruby/irb/commit/b1ef58aeff
2024-05-04[ruby/irb] Use flag instead of caller for `debug`'s binding.irbStan Lo
check (https://github.com/ruby/irb/pull/947) https://github.com/ruby/irb/commit/4a4d7a4279
2024-05-03[ruby/irb] Avoid raising errors while running help for customKenichi Kamiya
commands (https://github.com/ruby/irb/pull/944) * Avoid raising errors while running help for custom commands Raising an error from the help command is not a pleasure for the end user, even if the command does not define any attributes * Update test/irb/command/test_custom_command.rb --------- https://github.com/ruby/irb/commit/c8bba9f8dc Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-05-03[ruby/irb] Fix typos in test/irb/command/test_custom_command.rbKenichi Kamiya
(https://github.com/ruby/irb/pull/945) https://github.com/ruby/irb/commit/f2b5fc192f
2024-05-02Sync IRB 241e061Stan Lo
2024-05-01[ruby/irb] Support `IRB.conf[:BACKTRACE_FILTER]`Stan Lo
(https://github.com/ruby/irb/pull/917) * Use 'irbtest-' instead if 'irb-' as prefix of test files. Otherwise IRB would mis-recognize exceptions raised in test files as exceptions raised in IRB itself. * Support `IRB.conf[:BACKTRACE_FILTER]`` This config allows users to customize the backtrace of exceptions raised and displayed in IRB sessions. This is useful for filtering out library frames from the backtrace. IRB expects the given value to response to `call` method and return the filtered backtrace. https://github.com/ruby/irb/commit/6f6e87d769
2024-04-30[ruby/irb] Restore MAIN_CONTEXT correctlytomoya ishida
(https://github.com/ruby/irb/pull/937) https://github.com/ruby/irb/commit/c41f460a70
2024-04-26[ruby/irb] Suppress command return valuesStan Lo
(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[ruby/irb] Command registration should take both strings and symbolsStan Lo
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-24[ruby/irb] Memoize helper method instances with Singleton moduleStan Lo
(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[ruby/irb] Revert "Memoize helper method instances with Singleton module"Stan Lo
This reverts commit https://github.com/ruby/irb/commit/169a9a2c3097. https://github.com/ruby/irb/commit/221b0a4928
2024-04-24[ruby/irb] Memoize helper method instances with Singleton moduleStan Lo
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-23Sync IRB f9347b1 (#10611)Stan Lo
2024-04-20[ruby/irb] Stop using ExtendCommandBundle internallyStan Lo
(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[ruby/irb] Remove exit command workaround, handle IRB_EXIT intomoya ishida
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-19[ruby/irb] Add MultiIRB commands testKuniaki Igarashi
(https://github.com/ruby/irb/pull/929) https://github.com/ruby/irb/commit/c6bbc424c3
2024-04-18[ruby/irb] Fix % escape in prompt formattomoya ishida
(https://github.com/ruby/irb/pull/927) https://github.com/ruby/irb/commit/08eee25d28