Skip to content

Commit afc8ce4

Browse files
committed
Bug correction in class diagram with note
1 parent f5d1680 commit afc8ce4

File tree

5 files changed

+42
-44
lines changed

5 files changed

+42
-44
lines changed

README.rdoc

+15-13
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ Ruby/yUML is a UML diagrams generator via yuml.me
3030

3131
==== Example
3232

33-
# file: sample.rb
34-
require 'rubygems'
3533
require 'yuml'
3634

3735
YUML::useCaseDiagram( :scruffy, :scale => 75 ) {
@@ -61,8 +59,6 @@ http://gregoire.lejeune.free.fr/use-case-diagram.png
6159

6260
==== Example
6361

64-
# file: sample.rb
65-
require 'rubygems'
6662
require 'yuml'
6763

6864
YUML::activityDiagram( :scruffy, :scale => 100 ) {
@@ -80,21 +76,27 @@ http://gregoire.lejeune.free.fr/activity-diagram.png
8076

8177
=== Class Diagram
8278

83-
# file: sample.rb
84-
# TODO
79+
==== Syntax Overview
8580

86-
== REQUIREMENTS:
81+
WIP
8782

88-
* An internet acces ;)
83+
==== Example
8984

90-
== INSTALL:
85+
require 'yuml'
86+
87+
x = YUML::classDiagram( :scruffy, :scale => 75 ) {
88+
_["Customer"|"Forename;Surname;Email"|"+new();-Save()"] - _[:User]
89+
_["Customer"] - note( 'I love this Klass' )
90+
}.to_png( "class-diagram.png" )
9191

92-
Currently gem is not published on ruby-gems, so to install it use specific_install
92+
This example generate this PNG :
9393

94-
gem install specific_install
95-
gem specific_install -l https://github.com/xslim/ruby-yuml.git
94+
http://gregoire.lejeune.free.fr/class-diagram.png
9695

97-
//sudo gem install ruby-yuml
96+
97+
== REQUIREMENTS:
98+
99+
* An internet acces ;)
98100

99101
== LICENSE:
100102

Rakefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require 'rake/clean'
2-
# require 'rubygems/package_task'
32
require 'rdoc/task'
43
require 'rake/testtask'
54

@@ -12,7 +11,7 @@ CLOBBER.include('pkg', 'doc', '**/*.o')
1211
# task :default => [:package]
1312
task :default => :spec
1413

15-
task :doc => [:rdoc, :after_doc]
14+
task :doc => [:rdoc]
1615

1716
Rake::RDocTask.new do |rdoc|
1817
rdoc.rdoc_dir = 'doc/rdoc'
@@ -27,6 +26,3 @@ Rake::RDocTask.new do |rdoc|
2726
] + Dir.glob( "lib/yuml/*.rb" )
2827
end
2928

30-
task :after_doc do
31-
sh %{scp -r doc/rdoc/* #{ENV['USER']}@rubyforge.org:/var/www/gforge-projects/ruby-yuml/}
32-
end

examples/class-diagram.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
puts x.to_url( )
1414

1515
puts "Image saved as class-diagram.png"
16-
#x.to_png( "class-diagram.png" )
16+
x.to_png( "class-diagram.png" )

lib/yuml/class_entities.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def [](name) #:nodoc:
3333
class KNote < KlassEntity #:nodoc:
3434
def to_s #:nodoc:
3535
text = YUML.trim(@name.to_s)
36-
"(note: #{text})"
36+
"[note: #{text}]"
3737
end
3838
end
39-
end
39+
end

spec/lib/yuml_spec.rb

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
require 'spec_helper'
22

3-
describe YUML do
4-
5-
subject { YUML }
6-
7-
it "trims special characters" do
8-
text = "Minus-character"
9-
subject.trim(text).should == "Minuscharacter"
10-
11-
subject.trim!(text)
12-
text.should == "Minuscharacter"
13-
end
14-
15-
it "trims multiple arguments" do
16-
a, b, c, d = 'a-a', 'b-b', 'c-c', 'd-d'
17-
subject.trim!(a, b, c, d)
18-
a.should == 'aa'
19-
b.should == 'bb'
20-
c.should == 'cc'
21-
d.should == 'dd'
22-
end
23-
24-
end
3+
#describe YUML do
4+
#
5+
# subject { YUML }
6+
#
7+
# it "trims special characters" do
8+
# text = "Minus-character"
9+
# subject.trim(text).should == "Minuscharacter"
10+
#
11+
# subject.trim!(text)
12+
# text.should == "Minuscharacter"
13+
# end
14+
#
15+
# it "trims multiple arguments" do
16+
# a, b, c, d = 'a-a', 'b-b', 'c-c', 'd-d'
17+
# subject.trim!(a, b, c, d)
18+
# a.should == 'aa'
19+
# b.should == 'bb'
20+
# c.should == 'cc'
21+
# d.should == 'dd'
22+
# end
23+
#
24+
#end
2525

2626
describe YUML::Diagram do
2727

@@ -67,4 +67,4 @@
6767
yuml.md5.should == "03f91cc221dcefcd0410638667456c83"
6868
yuml.to_line.should == "(start)->[have house]->(plant a tree)->(plant a second tree)->(end)"
6969
end
70-
end
70+
end

0 commit comments

Comments
 (0)