# TraceTree Print TracePoint(`:b_call`, `:b_return`, `:c_call`, `:c_return`, `:call`, `:return`, `:class`, `:end`, `:thread_begin`, `:thread_end`) in tree view, to console or html. *Notice: it does not trace `:raise`, which can be represented by Kernel#raise(`:c_call`)* - [Installation](#installation) - [Usage](#usage) - [Parameters](#parameters) - [Example 1: Output to HTML](#example-1-output-to-html) - [Example 2: Output to STDOUT](#example-2-output-to-stdout) ## Installation Add this line to your application's Gemfile: ```ruby gem 'trace_tree' ``` And then execute: $ bundle Or install it yourself as: $ gem install trace_tree ## Usage Just call the method you want to trace in the block passed to `binding.trace_tree`: ```ruby things_done = binding.trace_tree do somebody.do_something end ``` ### Parameters You may pass optional parameters while invoking `binding.trace_tree`, for example: ```ruby binding.trace_tree(file, color: false, gem: false) do somebody.do_something end ``` * `file == STDOUT` by default. You can give it a File object or anything responds to `puts`. * `:color => true` by default. It makes method names have different color than source_location in output. When you print the output to file, you may want to set it false to discard those color ANSI escape sequences. * `:gem => true` by default. Replace the gem paths in source_location with $GemPathN, which shorten lines. To see what are replaced, inspect `TraceTree::GemPaths`. * `:html => nil` by default. Set it true to generate a html in which a tree constructed with `