Pocky generates dependency graphs for your packwerk packages. The gem is named after pocky, a beloved Japanese snack that comes in small packages.
Invoke from irb or code.
Pocky::Packwerk.generate
Invoke as a rake task:
$ rake pocky:generate
Pocky::Packwerk.generate(
package_path: 'app/packages', # Relative path to packages directory
default_package: 'root', # The default package listed as "." in package.yml and deprecated_references.yml
filename: 'packwerk.png', # Name of output file
analyze_sizes: false, # Calculate and display package according to the size of ruby source code
dpi: 100, # Output file resolution
package_color: '#5CC8FF', # color name or hex color, see https://graphviz.org/doc/info/colors.html for more details
secondary_package_color: '#AAAAAA', # secondary package color when visualizing partial system.
dependency_edge: 'darkgreen',
deprecated_reference_edge: 'black',
deprecated_reference_ranking: true, # Set ranking for deprecated references. Set to false to organize nodes on the same vertical level.
)
Note that the the bold edges indicate heavier dependencies.
Invoke as a rake task:
$ rake pocky:generate"[app/packages,Monolith,packages.png,100]"
package_path
can also be an array in case your packages are organized in multiple directories. Alternatively, you can also provide paths to individual packages to generate more focused graphs for your package subsystems.
Pocky::Packwerk.generate(
package_path: [
'app/packages/a',
'app/packages/z',
]
)
Generate the same graph using the rake task:
$ rake pocky:generate"[app/packages/a app/packages/z]"
Add this line to your application's Gemfile:
gem 'pocky'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install pocky
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/mquan/pocky.
The gem is available as open source under the terms of the MIT License.