Project

dudity

0.0
No commit activity in last 3 years
No release in over 3 years
Try DudeGL code visualization in your Rails projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Dudity

Dudity gem allows to test DudeGL features from your local machine.

See examples in main.rb

Gem supports 3 methods: visualise, visualise_diff, visualise_pr

Installation

For installation run:

gem install dudity

or add gem to Gemfile:

gem 'dudity'

visualise

Visualise code in a form of dudes

All code: Dudity.visualise('./projects/my_app')

Only from selected folders: Dudity.visualise('./projects/my_app', only: ['app/models', 'app/controllers'])

All code except some folders: Dudity.visualise('./projects/my_app', except: ['app/models', 'app/controllers'])

Result will be saved in image folder in svg format.

You can also specify particular classes that you want to exclude from analysis Dudity.visualise('./projects/my_app', only: ['app/models'], ignore_classes: ['Ability', 'User'])

or analyze only selected classes: Dudity.visualise('./projects/my_app', only: ['app/models'], only_classes: ['Ability', 'User'])

visualise_diff

Useful for analyzing your private repositories. In order to use this feature:

  • put code of your master branch and from a branch from which you are making pull request in the same folder on your local machine.
  • from pull request page download diff file and put it in the same folder. To download diff file just add .diff to the end of pull request url. For example https://github.com/user/repo/pull/1 diff can be accessed by url: https://github.com/dmikhr/Dudity/pull/1.diff

Visualise diff and generate html report: Dudity.visualise_diff('./projects/my_app', pull_branch: 'pr_branch', as: :html)

or just render an image:

Dudity.visualise_diff('./projects/my_app', pull_branch: 'pr_branch', as: :svg)

visualise_pr

Similar to visualise_diff but can be used for public pull requests. Instead of using local code it will fetch all necessary data from github.

Dudity.visualise_pr('./projects/my_app', pull_branch: 'pr_branch', as: :html)

or

Dudity.visualise_pr('./projects/my_app', pull_branch: 'pr_branch', as: :svg)

Credits

  • Code parser (lib/dudes.rb) was created by Victor Shepelev (zverok)
  • The idea of code visualization with stick dudes was presented by Ivan Nemytchenko on RubyRussia 2019 conference