Skip to content
🌲 Ruby AST Visualizer. Based on Parser.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
images
lib
.tachikoma.yml
CHANGELOG.md
Gemfile
Gemfile.lock
LEGAL
LICENSE
README.md
Rakefile
ruby_ast_visualizer.gemspec

README.md

Ruby AST Visualizer Gem Version

Ruby AST Visualizer. Based on Parser.

Install

$ gem install ruby_ast_visualizer

Usage

An example ruby_ast_visualizer command.

$ cat hello.rb
puts 'hello, world'
$ ruby_ast_visualizer hello.rb

(send nil :puts
  (str "hello, world"))

Wrote a.png

or

$ ruby_ast_visualizer -e 'puts "hello, world"'

(send nil :puts
  (str "hello, world"))

Wrote a.png

AST image file is generated.

hello, world

A little more in detail

You can specify output path in the -o option. That value is default a.png.

$ ruby_ast_visualizer -o path/to/file -e 'puts "hello, world"'

(send nil :puts
  (str "hello, world"))

Wrote path/to/file

And you can also specify the -n (--no-image) option if you don't need an image. You can only get the result of S-expression by Parser gem.

$ ruby_ast_visualizer -n -e 'puts "hello, world"'

(send nil :puts
  (str "hello, world"))

Requirements

  • Graphviz

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Ruby AST Visualizer is released under the GNU General Public License, version 2.

You can’t perform that action at this time.