diff options
author | tomoya ishida <[email protected]> | 2025-01-21 22:58:05 +0900 |
---|---|---|
committer | tomoya ishida <[email protected]> | 2025-01-22 23:08:34 +0900 |
commit | 7813edbe19a2cd131aec5490a8ad314ded61e70e (patch) | |
tree | 6c5cf79c1c39db6a89a8688a030f692e3d8f149e /lib/irb/context.rb | |
parent | c6e8ee4514c8f24c211a5fb0b6291ac81ee83115 (diff) |
[ruby/irb] Show a quick preview of inspect result before pager
launch
(https://github.com/ruby/irb/pull/1040)
* Quickly show inspect preview even if pretty_print takes too much time
* Show a message "Inspecting..." while generating pretty_print content
* Update inspecting message
Co-authored-by: Stan Lo <[email protected]>
* Update rendering test for preparing inspect message
* Don't show preview if pretty_print does not take time
---------
https://github.com/ruby/irb/commit/03c36586e6
Co-authored-by: Stan Lo <[email protected]>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12612
Diffstat (limited to 'lib/irb/context.rb')
-rw-r--r-- | lib/irb/context.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/irb/context.rb b/lib/irb/context.rb index 2642256c40..395d9081f8 100644 --- a/lib/irb/context.rb +++ b/lib/irb/context.rb @@ -658,8 +658,12 @@ module IRB end end - def inspect_last_value # :nodoc: - @inspect_method.inspect_value(@last_value) + def inspect_last_value(output = +'') # :nodoc: + @inspect_method.inspect_value(@last_value, output) + end + + def inspector_support_stream_output? + @inspect_method.support_stream_output? end NOPRINTING_IVARS = ["@last_value"] # :nodoc: |