Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@enebo
Created February 7, 2019 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enebo/1a546da5c59cbc26368dc1f749eb5d15 to your computer and use it in GitHub Desktop.
Save enebo/1a546da5c59cbc26368dc1f749eb5d15 to your computer and use it in GitHub Desktop.
diff --git a/lib/ruby/stdlib/tracer.rb b/lib/ruby/stdlib/tracer.rb
index faafd803f4..57bec731d7 100644
--- a/lib/ruby/stdlib/tracer.rb
+++ b/lib/ruby/stdlib/tracer.rb
@@ -141,11 +141,11 @@ class Tracer
stdout.print "Trace off\n" if Tracer.verbose?
end
- def add_filter(p = proc) # :nodoc:
+ def add_filter(&p) # :nodoc:
@filters.push p
end
- def set_get_line_procs(file, p = proc) # :nodoc:
+ def set_get_line_procs(file, &p) # :nodoc:
@get_line_procs[file] = p
end
@@ -247,7 +247,7 @@ class Tracer
# puts "line number executed is #{line}"
# })
- def Tracer.set_get_line_procs(file_name, p = proc)
+ def Tracer.set_get_line_procs(file_name, &p)
Single.set_get_line_procs(file_name, p)
end
@@ -260,7 +260,7 @@ class Tracer
# "Kernel" == klass.to_s
# end
- def Tracer.add_filter(p = proc)
+ def Tracer.add_filter(&p)
Single.add_filter(p)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment