I was curious about what an object chart, or dependency graph, looks like in a running application. One of my favorite features about ruby is its ability to introspect; to have awareness of its own state at runtime.
- http://phrogz.net/ProgrammingRuby/ospace.html#tracingyourprogramsexecution
- http://www.reddit.com/r/ruby/comments/11ns2l/does_a_uml_sequence_diagram_generation_gem_exist/
Using the following snippet in your development Rails 4.x application, results in a verbose log file and a tremendously slow page-load time, but provides insightful information about the lifecycle of a request in Rails.
class Application < Rails::Application
set_trace_func proc { |event, file, line, id, binding, classname|
printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
}
end