Skip to content

Commit ce37171

Browse files
committed
fix: p should put a newline after the end of the last item too. Closes #116
1 parent f45d759 commit ce37171

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gems/codetracer-pure-ruby-recorder/lib/codetracer/kernel_patches.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def self.install(tracer)
1717
define_method(:p) do |*args|
1818
loc = caller_locations(1, 1).first
1919
content = if args.length == 1 && args.first.is_a?(Array)
20-
args.first.map(&:inspect).join("\n")
20+
args.first.map(&:inspect).join("\n") + "\n"
2121
else
22-
args.map(&:inspect).join("\n")
22+
args.map(&:inspect).join("\n") + "\n"
2323
end
2424
@@tracers.each do |t|
2525
t.record_event(loc.path, loc.lineno, content)

gems/codetracer-ruby-recorder/lib/codetracer/kernel_patches.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def self.install(tracer)
1717
define_method(:p) do |*args|
1818
loc = caller_locations(1, 1).first
1919
content = if args.length == 1 && args.first.is_a?(Array)
20-
args.first.map(&:inspect).join("\n")
20+
args.first.map(&:inspect).join("\n") + "\n"
2121
else
22-
args.map(&:inspect).join("\n")
22+
args.map(&:inspect).join("\n") + "\n"
2323
end
2424
@@tracers.each do |t|
2525
t.record_event(loc.path, loc.lineno, content)

0 commit comments

Comments
 (0)