lib/pry-moves/pry_ext.rb in pry-moves-1.0.2 vs lib/pry-moves/pry_ext.rb in pry-moves-1.0.3
- old
+ new
@@ -84,11 +84,12 @@
def build_output
lines = ['']
formatter = PryMoves::Formatter.new
prefix = Thread.current[:pry_moves_debug] ? "👾 " : ""
- lines << "#{prefix}#{formatter.shorten_path location}"
+ lines << "🦆 step_in_everywhere" if PryMoves.step_in_everywhere
+ lines << "#{prefix}#{formatter.shorten_path location}:#{@line} #{me}"
lines << " ." + formatter.method_signature(target)
lines << ''
lines << "#{code.with_line_numbers(use_line_numbers?).with_marker(marker).highlighted}"
lines << PryMoves::Watch.instance.output(target) unless PryMoves::Watch.instance.empty?
@@ -97,16 +98,19 @@
lines << ''
lines.join "\n"
end
- def location
+ def me
me = target.eval 'self' rescue nil
me = PryMoves::Painter.colorize me if me
- file = defined?(Rails) ? @file.gsub(Rails.root.to_s, '') : @file
- "#{file}:#{@line} #{me}"
+ me
end
+
+ def location
+ defined?(Rails) ? @file.gsub(Rails.root.to_s, '') : @file
+ end
end
Pry.config.marker = "=>"
Pry::Code::LOC.class_eval do
@@ -121,10 +125,12 @@
Pry::Output.class_eval do
alias pry_moves_origin_for_puts puts
def puts *args
+ # <first> formatted by Pry.config.print = proc do |output, value|
first = args[0]
+ # Kernel.puts "Pry::Output.puts: #{first}"
if first.is_a? String and first.start_with? "(pry) output error"
first.slice! 400..-1
end
pry_moves_origin_for_puts *args
end
\ No newline at end of file