ruby-yuml
ruby-yuml copied to clipboard
Ruby/yUML is a small DSL to generate UML diagrams with yuml.me
= Ruby/yUML
Copyright (C) 2009 Gregoire Lejeune
- home : http://github.com/glejeune/ruby-yuml
- doc : http://rdoc.info/projects/glejeune/ruby-yuml
== DESCRIPTION:
Ruby/yUML is a UML diagrams generator via yuml.me
== FEATURES/PROBLEMS:
=== 0.1.0
- Initial release
== SYNOPSIS:
=== Use Case Diagram
==== Syntax Overview
- Use Case : _(:UseCase) or useCase(:UseCase)
- Actor : _[:Actor] or actor(:Actor)
- <<Extend>> : _(:UseCase) < _(:OtherUseCase)
- <<Include>> : _(:UseCase) > _(:OtherUseCase)
- Link : _[:Actor] - _(:UseCase)
- Actor Inheritance : _[:Actor] ^ _[:OtherActor]
- Notes : _(:UseCase) - note('This is a note')
==== Example
require 'yuml'
YUML::useCaseDiagram( :scruffy, :scale => 75 ) { _[:Admin] ^ _[:User] _[:Admin] - note( 'Most privilidged user' ) _[:User] - _(:Login) _[:User] - _(:Logout) _(:Login) < _(:Reminder) _(:Login) > _(:Captcha) }.to_png( "sample.png" )
This example generate this PNG :
http://gregoire.lejeune.free.fr/use-case-diagram.png
=== Activity Diagram
==== Syntax Overview
- Start : _(:start) or _start or activity(:start)
- End : _(:end) or _end or activity(:end)
- Activity : _(:Activity) or activity(:Activity)
- Flow : _(:A) > _(:B)
- Decision : _{:Decision} or decision(:Decision)
- Parallel : _[:Parallel] or parallel(:Parallel)
- Decision with label : _{:Decision} -"label"> _(:Activity)
==== Example
require 'yuml'
YUML::activityDiagram( :scruffy, :scale => 100 ) { _(:start) > _{:d1} _{:d1} -"logged in"> _("Show Dashboard") _("Show Dashboard") > _[:a] _[:a] > _(:end) _{:d1} -"not logged in"> _("Show Login") _("Show Login") > _[:a] }.to_png( "activity-diagram.png" )
This example generate this PNG :
http://gregoire.lejeune.free.fr/activity-diagram.png
=== Class Diagram
==== Syntax Overview
WIP
==== Example
require 'yuml'
x = YUML::classDiagram( :scruffy, :scale => 75 ) {
_["Customer"|"Forename;Surname;Email"|"+new();-Save()"] - _[:User]
_["Customer"] - note( 'I love this Klass' )
}.to_png( "class-diagram.png" )
This example generate this PNG :
http://gregoire.lejeune.free.fr/class-diagram.png
== REQUIREMENTS:
- An internet acces ;)
== LICENSE:
Ruby/yUML is freely distributable according to the terms of the GNU General Public License.
This program is distributed without any warranty. See the file 'COPYING' for details.