ARST
Abstract Ruby Syntax Tree (ARST) is a high-level language syntax denoting the object domain of a Ruby project.
ARST can be used to generate:
- Pure Ruby
- C Ruby extensions
- Test::Unit, MiniTest::Unit, MiniTest::Spec, or RSpec tests
- GraphViz graphs
- Custom output
ARST files can also be generated from existing projects which allows:
- Bootstrapping C Ruby extensions
- Bootstrapping Test::Unit, MiniTest::Unit, MiniTest::Spec, or RSpec tests
- Generating GraphViz graphs
Integrations:
Generators:
- ARST::Generator::Ruby (baked into this gem)
- ARST::Generator::CRuby (baked into this gem)
- ARST::Generator::JRuby
- ARST::Generator::Test::Unit
- ARST::Generator::MiniTest::Unit
- ARST::Generator::MiniTest::Spec
- ARST::Generator::RSpec
- ARST::Generator::Graphviz
Install
Bundler: gem 'arst' in group :development
RubyGems: gem install arst
Syntax
Ruby
ARST syntax implements most keywords and declarations of the Ruby language's syntax.
This means that most syntax highlighters for Ruby will also work for ARST.
Valid Ruby syntax within ARST:
module ModuleNameclass ClassName < SuperClassNameinclude ModuleNameextend ModuleNamedef instance_method(arg1, *other_args)(and anything else accepted method arguments in Ruby's syntax)def self.class_method(arg1, opts={})(and anything else accepted method arguments in Ruby's syntax)
Indentation
ARST is an indentation-sensitive syntax meaning that the following are not equivalent:
|
|
Valid
|
Invalid
|