Created
January 16, 2013 22:54
-
-
Save duckinator/4551735 to your computer and use it in GitHub Desktop.
This file contains 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
[..inator/ruby-hashdec/tests]$ ./trace.rb | |
Entering test(1) | |
In test() | |
Leaving test (returned nil) | |
[..inator/ruby-hashdec/tests]$ |
This file contains 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
#!/usr/bin/env ruby | |
require '../lib/hashdec.rb' | |
# FIXME: Make it work with test(*args) | |
module HashDec | |
def self.trace(ba, function, hashdec_args, args, ret) | |
case ba | |
when :before | |
puts "Entering #{function}(#{args.map(&:inspect).join(', ')})" | |
when :after | |
puts "Leaving #{function} (returned #{ret.inspect})" | |
end | |
end | |
end | |
#trace() | |
def test(arg) | |
puts "In test()" | |
end | |
test 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment