ruby-graphviz 0.9.12 → 0.9.13
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +39 -3
- data/examples/dot/balanced.dot +36 -0
- data/examples/sample43.rb +4 -5
- data/examples/sample55.rb +9 -0
- data/lib/ext/gvpr/dot2ruby.g +146 -0
- data/lib/ext/gvpr/toto.gv +560 -0
- data/lib/ext/gvpr/toto.rb +497 -0
- data/lib/graphviz/constants.rb +3 -3
- data/lib/graphviz/node.rb +5 -0
- data/lib/graphviz/types/lbl_string.rb +21 -0
- data/test/test_examples.rb +3 -0
- metadata +13 -4
data/lib/graphviz/constants.rb
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
# C => cluster
|
41
41
|
#
|
42
42
|
module Constants
|
43
|
-
RGV_VERSION = "0.9.
|
43
|
+
RGV_VERSION = "0.9.13"
|
44
44
|
|
45
45
|
## Const: Output formats
|
46
46
|
FORMATS = [
|
@@ -164,11 +164,11 @@ module Constants
|
|
164
164
|
"headtooltip" => { :usedBy => "E", :type => :EscString },
|
165
165
|
"height" => { :usedBy => "N", :type => :EscString },
|
166
166
|
"href" => { :usedBy => "NE", :type => :EscString },
|
167
|
-
"html" => { :usedBy => "N", :type => :HtmlString }, # API extension
|
167
|
+
"html" => { :usedBy => "N", :type => :HtmlString }, # API extension -- Deprecated
|
168
168
|
"id" => { :usedBy => "ENG", :type => :EscString },
|
169
169
|
"image" => { :usedBy => "N", :type => :EscString },
|
170
170
|
"imagescale" => { :usedBy => "N", :type => :EscString },
|
171
|
-
"label" => { :usedBy => "ENGC", :type => :
|
171
|
+
"label" => { :usedBy => "ENGC", :type => :LblString },
|
172
172
|
"labelURL" => { :usedBy => "E", :type => :EscString },
|
173
173
|
"labelangle" => { :usedBy => "E", :type => :EscString },
|
174
174
|
"labeldistance" => { :usedBy => "E", :type => :EscString },
|
data/lib/graphviz/node.rb
CHANGED
@@ -124,8 +124,13 @@ class GraphViz
|
|
124
124
|
xOut = "" << xNodeName
|
125
125
|
xAttr = ""
|
126
126
|
xSeparator = ""
|
127
|
+
|
128
|
+
if @oAttrNode.data.has_key?("label") and @oAttrNode.data.has_key?("html")
|
129
|
+
@oAttrNode.data.delete("label")
|
130
|
+
end
|
127
131
|
@oAttrNode.data.each do |k, v|
|
128
132
|
if k == "html"
|
133
|
+
warn "html attribut is deprecated, please use label : :label => '<<html />>'"
|
129
134
|
xAttr << xSeparator + "label = " + v.to_gv
|
130
135
|
else
|
131
136
|
xAttr << xSeparator + k + " = " + v.to_gv
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class GraphViz
|
2
|
+
class Types
|
3
|
+
class LblString < Common
|
4
|
+
def check(data)
|
5
|
+
return data
|
6
|
+
end
|
7
|
+
|
8
|
+
def output
|
9
|
+
html = /^<([<|(^<)*<].*)>$/m.match(@data)
|
10
|
+
if html != nil
|
11
|
+
"<#{html[1]}>"
|
12
|
+
else
|
13
|
+
@data.to_s.inspect.gsub( "\\\\", "\\" )
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
alias :to_gv :output
|
18
|
+
alias :to_s :output
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/test/test_examples.rb
CHANGED
@@ -54,6 +54,9 @@ class GraphVizTest < Test::Unit::TestCase
|
|
54
54
|
assert_output_pattern(/\Adigraph G \{.*\}\n\Z/m, '40')
|
55
55
|
end
|
56
56
|
|
57
|
+
def test_sample55
|
58
|
+
assert_output_pattern(/\Agraph G \{.*\}\n\Z/m, '55')
|
59
|
+
end
|
57
60
|
|
58
61
|
#
|
59
62
|
# for every sample file in the examples directory that matches the
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-graphviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 33
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 13
|
10
|
+
version: 0.9.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gregoire Lejeune
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06
|
18
|
+
date: 2010-07-06 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- setup.rb
|
51
51
|
- bin/gem2gv
|
52
52
|
- bin/ruby2gv
|
53
|
+
- examples/dot/balanced.dot
|
53
54
|
- examples/dot/cluster.dot
|
54
55
|
- examples/dot/dotgraph.dot
|
55
56
|
- examples/dot/fsm.dot
|
@@ -123,12 +124,16 @@ files:
|
|
123
124
|
- examples/sample52.rb
|
124
125
|
- examples/sample53.rb
|
125
126
|
- examples/sample54.rb
|
127
|
+
- examples/sample55.rb
|
126
128
|
- examples/sample99.rb
|
127
129
|
- examples/sdlshapes/README
|
128
130
|
- examples/sdlshapes/sdl.ps
|
129
131
|
- examples/sdlshapes/sdlshapes.dot
|
130
132
|
- examples/simpsons.gv
|
131
133
|
- examples/test.xml
|
134
|
+
- lib/ext/gvpr/dot2ruby.g
|
135
|
+
- lib/ext/gvpr/toto.gv
|
136
|
+
- lib/ext/gvpr/toto.rb
|
132
137
|
- lib/graphviz/attrs.rb
|
133
138
|
- lib/graphviz/constants.rb
|
134
139
|
- lib/graphviz/core_ext.rb
|
@@ -145,6 +150,7 @@ files:
|
|
145
150
|
- lib/graphviz/parser.rb
|
146
151
|
- lib/graphviz/types/esc_string.rb
|
147
152
|
- lib/graphviz/types/html_string.rb
|
153
|
+
- lib/graphviz/types/lbl_string.rb
|
148
154
|
- lib/graphviz/types.rb
|
149
155
|
- lib/graphviz/xml.rb
|
150
156
|
- lib/graphviz.rb
|
@@ -174,6 +180,9 @@ post_install_message: |
|
|
174
180
|
/!\ GraphViz::Node#name is deprecated and will be removed in version 1.0.0
|
175
181
|
|
176
182
|
/!\ :output and :file options are deprecated and will be removed in version 1.0.0
|
183
|
+
|
184
|
+
/!\ The html attribut is deprecated and will be removed in version 1.0.0
|
185
|
+
You can use the label attribut, as dot do it : :label => '<<html/>>'
|
177
186
|
|
178
187
|
rdoc_options:
|
179
188
|
- --title
|