-
-
Save banister/944326 to your computer and use it in GitHub Desktop.
Use Pry as IRB replacement in rails 3 console
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
# Add this to the end of your development.rb and add | |
# | |
# gem 'pry' | |
# | |
# to your Gemfile and run bundle to install. | |
silence_warnings do | |
begin | |
require 'pry' | |
IRB = Pry | |
rescue LoadError | |
end | |
end |
@bbhoss, hey man put this in your ~/.pryrc
Pry.print = proc do |output, value|
if Pry.color
output.puts "=> #{CodeRay.scan(value.inspect, :ruby).term}"
else
output.puts "=> #{value.inspect}"
end
end
The next release of Pry
will use inspect by default :)
What potentially causes the load error?
@JoshCheek, the LoadError could be caused by the pry gem not being installed.
silence_warnings
seems rather sloppy, why not:
Object.send :remove_const, :IRB
::IRB = Pry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any way to make it automagically puts the inspected return like IRB does? It would be a near perfect replacement if it did this.