Skip to content

Instantly share code, notes, and snippets.

@smapira
Last active September 20, 2021 10:38
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 smapira/80b890029fbe08ddeacd4ada6f338a83 to your computer and use it in GitHub Desktop.
Save smapira/80b890029fbe08ddeacd4ada6f338a83 to your computer and use it in GitHub Desktop.
# curl https://gist.githubusercontent.com/smapira/80b890029fbe08ddeacd4ada6f338a83/raw --output .pryrc
begin
require 'hirb'
rescue LoadError
# Missing goodies, bummer
end
if defined? Hirb
# Slightly dirty hack to fully support in-session Hirb.disable/enable toggling
Hirb::View.instance_eval do
def enable_output_method
@output_method = true
@old_print = Pry.config.print
Pry.config.print = proc do |*args|
Hirb::View.view_or_page_output(args[1]) || @old_print.call(*args)
end
end
def disable_output_method
Pry.config.print = @old_print
@output_method = nil
end
end
Hirb.enable
end
Pry.config.theme = "pry-modern-256"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment