1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/lib/pry/print.rb
2011-04-22 02:16:35 -04:00

16 lines
434 B
Ruby

class Pry
DEFAULT_PRINT = proc do |output, value|
if Pry.color
output.puts "=> #{CodeRay.scan(Pry.view(value), :ruby).term}"
else
output.puts "=> #{Pry.view(value)}"
end
end
# Will only show the first line of the backtrace
DEFAULT_EXCEPTION_HANDLER = proc do |output, exception|
output.puts "#{exception.class}: #{exception.message}"
output.puts "from #{exception.backtrace.first}"
end
end