Skip to content

Instantly share code, notes, and snippets.

@tadd
Last active June 2, 2023 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadd/af06178502df54f4f896505e6fc2d5c6 to your computer and use it in GitHub Desktop.
Save tadd/af06178502df54f4f896505e6fc2d5c6 to your computer and use it in GitHub Desktop.
Customization of IRB Inspection
class Array; def inspect = IO.popen(['banner', to_s], &:read).chomp; end
conf.echo_on_assignment = true # never truncate # IRB.conf[:ECHO_ON_ASSIGNMENT] = true
conf.inspect_mode = :inspect # IRB.conf[:INSPECT_MODE] = :inspect
irb(main):001:0> [*1..10]
=>
##### # ##### #####
# ## # # # #
# # # # #
# # ### ##### ### ##### ###
# # ### # ### # ###
# # # # # # # #
##### ##### # ####### # ##### #
irb(main):002:0> foo,bar=foo,bar
=>
##### #####
# # # # # # # # # #
# ## # # # ## # # # #
# # # # # # ### # # # # # #
# # # # # # ### # # # # # #
# # ## # # # # ## # # #
##### # # # ###### # # # # ###### #####
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment