Last active
August 29, 2015 14:18
-
-
Save tgxworld/c1f0ba82a2d1a5bedf2e to your computer and use it in GitHub Desktop.
Interpolate Regexp expression.
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
{ | |
["/home/guoxiang/work/rails-dev-box/rails/actionpack/lib/action_controller/metal/test.rb", 8, :T_ARRAY]=>[1, 0, 0, 0, 0, 0], | |
["/home/guoxiang/work/rails-dev-box/rails/actionpack/lib/action_controller/metal/test.rb", 8, :T_STRING]=>[6, 0, 0, 0, 0, 0], | |
["/home/guoxiang/work/rails-dev-box/rails/actionpack/lib/action_controller/metal/test.rb", 8, :T_REGEXP]=>[1, 0, 0, 0, 0, 0] | |
} |
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
require 'objspace' | |
require 'allocation_tracer' | |
require 'pp' | |
ObjectSpace::AllocationTracer.setup(%i{path line type}) | |
a = "asd" | |
result = ObjectSpace::AllocationTracer.trace do | |
/#{a}/ | |
end | |
pp result | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment