Skip to content

Instantly share code, notes, and snippets.

@marcocarvalho
Created December 22, 2017 11:06
Show Gist options
  • Save marcocarvalho/8ff4d09785067c4118e43235d72948f7 to your computer and use it in GitHub Desktop.
Save marcocarvalho/8ff4d09785067c4118e43235d72948f7 to your computer and use it in GitHub Desktop.
Ver por onde o código bate
@trace = []
set_trace_func proc { |event, file, line, id, binding, classname|
if event == 'call' && ( file.index('/app/') || file.index('gaia') )
@trace << { number: @trace.count, event: event, file: file, line: line, method_name: id, classname: classname.to_s }
end
}
# Code you want to inspect
set_trace_func nil
File.open('inspected_instructions', 'w+') { |f| f.write(@trace.to_json) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment