Created
January 8, 2013 11:11
-
-
Save borisd/4482983 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pry.config.editor = "vim" | |
begin | |
require 'hirb' | |
rescue LoadError | |
# Missing goodies, bummer | |
end | |
if defined? Hirb | |
# Dirty hack to support in-session Hirb.disable/enable | |
Hirb::View.instance_eval do | |
def enable_output_method | |
@output_method = true | |
Pry.config.print = proc do |output, value| | |
Hirb::View.view_or_page_output(value) || Pry::DEFAULT_PRINT.call(output, value) | |
end | |
end | |
def disable_output_method | |
Pry.config.print = proc { |output, value| Pry::DEFAULT_PRINT.call(output, value) } | |
@output_method = nil | |
end | |
end | |
Hirb.enable | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment