Skip to content

jeremyf/job_grapher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JobGrapher

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.

General Notes

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.

Installation

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

Usage

This gem came about as a thought experiment. Here's the command line:

job_grapher ~/path/to/repo ~/path/to/other-repo

From Ruby

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
)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jeremyf/job_grapher.

About

A naive graph generator for ActiveJob's declared and called across projects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published