While looking through multiple gems and applications, I needed a little tool to help me.
This gem outputs a PlantUML diagram of class/location's that perform a job. The parser and logic were built while exploring Samvera's ActiveJob implementations.
This gem requires Ripgrep.
While this is specific to application jobs, it would not take much to generalize this for class/module references. In other words show the relationships between constants.
Install the gem and add to the application's Gemfile by executing:
$ bundle add job_grapher
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install job_grapher
This gem came about as a thought experiment. Here's the command line:
job_grapher ~/path/to/repo ~/path/to/other-repo
At present, the command-line only allows you to specify directories. However, you can call the underlying Ruby class and provide additional parameters.
require "job_grapher"
JobGrapher.plantuml_for(
dirs: [
"~/git/hyrax",
"~/git/bulkrax",
"~/git/hyku",
"~/git/newspaper_works/"
],
filter: ->(job) do
job.include?("Permission") || job.include?("Ingest")
end
)
Bug reports and pull requests are welcome on GitHub at https://github.com/jeremyf/job_grapher.