README.md in rshade-0.1.9.1 vs README.md in rshade-0.2.0

- old
+ new

@@ -1,8 +1,9 @@ # RShade - -![warcraft shade](https://github.com/gingray/rshade/raw/master/shade.jpg) +<p align="center"> + <img src="https://github.com/gingray/rshade/raw/master/shade.jpg"> +</p> RShade is a debugging/code exploration tool based on `TracePoint` functionality. Recent years I've working with relatively huge legacy code and I need a tool which can help me to figure out what is going on due execution. Luckely Ruby have build in functionality to achieve it, but it's pretty low level. It was my motivation to create `RShade` it helps me to save tons of time when I face with something not trivial or a good start point to create dependency map when I do refactoring or bugfix. Tool still in beta and it's possible that there @@ -83,11 +84,11 @@ ```ruby context '#cost_currency' do context 'when cost currency is nil' do before { variant.cost_currency = nil } - it 'populates cost currency with the default value on save', focus: true do + it 'populates cost currency with the default value on save' do RShade::Trace.reveal do variant.save! end expect(variant.cost_currency).to eql 'USD' end @@ -96,9 +97,24 @@ ``` Below is example how output will look like. As you can see all code that have been in use is printed. [![asciicast](https://asciinema.org/a/MR5KL7TmHmYRUhwBUWQjBI373.svg)](https://asciinema.org/a/MR5KL7TmHmYRUhwBUWQjBI373) + +## Stack reveal +Config +```ruby +::RShade::Config::Registry.instance.stack_config do |config| + config.exclude_gems! + filepath = File.join(Rails.root, 'log', 'rshade-stack.json.log') + config.set_formatter(:json, { filepath: filepath, pretty: false }) +end +``` + +Execute (put in any place where you want reveal stack) +```ruby +::RShade::Stack.trace +``` ## TODO Use stack to keep connections between current method and caller take a look on https://github.com/matugm/visual-call-graph