ruby-graphviz 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,10 @@
1
- = GNU GENERAL PUBLIC LICENSE
2
- = Version 2, June 1991
1
+ # GNU GENERAL PUBLIC LICENSE
2
+
3
+ Version 2, June 1991
3
4
 
4
5
  Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
5
6
 
6
- == Preamble
7
+ ## Preamble
7
8
 
8
9
  The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
9
10
 
@@ -21,7 +22,7 @@ Finally, any free program is threatened constantly by software patents. We wish
21
22
 
22
23
  The precise terms and conditions for copying, distribution and modification follow.
23
24
 
24
- == GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
25
+ ## GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
25
26
 
26
27
  0.This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
27
28
 
@@ -79,13 +80,13 @@ Each version is given a distinguishing version number. If the Program specifies
79
80
 
80
81
  10.If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
81
82
 
82
- == NO WARRANTY
83
+ ## NO WARRANTY
83
84
 
84
85
  11.BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
85
86
 
86
87
  12.IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
87
88
 
88
- == END OF TERMS AND CONDITIONS
89
+ ## END OF TERMS AND CONDITIONS
89
90
 
90
91
  How to Apply These Terms to Your New Programs
91
92
 
@@ -0,0 +1,297 @@
1
+ # Ruby/GraphViz
2
+ [![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg)](#contributors)
3
+ [![Travis CI build](https://secure.travis-ci.org/glejeune/Ruby-Graphviz.svg)](https://travis-ci.org/glejeune/Ruby-Graphviz)
4
+ [![Gem Version](https://badge.fury.io/rb/ruby-graphviz.svg)](https://rubygems.org/gems/ruby-graphviz)
5
+
6
+ Copyright (C) 2004-2018 Gregoire Lejeune
7
+
8
+ * Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
9
+ * Sources : https://github.com/glejeune/Ruby-Graphviz
10
+ * On Rubygems: https://rubygems.org/gems/ruby-graphviz
11
+
12
+ ## INSTALLATION
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ gem 'ruby-graphviz'
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install ruby-graphviz
25
+
26
+ ## DESCRIPTION
27
+
28
+ Interface to the GraphViz graphing tool
29
+
30
+ ## TODO
31
+
32
+ * New FamilyTree
33
+
34
+
35
+ ## SYNOPSIS
36
+
37
+ A basic example
38
+
39
+ ```ruby
40
+ require 'ruby-graphviz'
41
+
42
+ # Create a new graph
43
+ g = GraphViz.new( :G, :type => :digraph )
44
+
45
+ # Create two nodes
46
+ hello = g.add_nodes( "Hello" )
47
+ world = g.add_nodes( "World" )
48
+
49
+ # Create an edge between the two nodes
50
+ g.add_edges( hello, world )
51
+
52
+ # Generate output image
53
+ g.output( :png => "hello_world.png" )
54
+ ```
55
+
56
+ The same but with a block
57
+
58
+ ```ruby
59
+ require 'ruby-graphviz'
60
+
61
+ GraphViz::new( :G, :type => :digraph ) { |g|
62
+ g.world( :label => "World" ) << g.hello( :label => "Hello" )
63
+ }.output( :png => "hello_world.png" )
64
+ ```
65
+
66
+ Or with the DSL
67
+
68
+ ```ruby
69
+ require 'ruby-graphviz/dsl'
70
+ digraph :G do
71
+ world[:label => "World"] << hello[:label => "Hello"]
72
+
73
+ output :png => "hello_world.png"
74
+ end
75
+ ```
76
+
77
+ Create a graph from a file
78
+
79
+ ```ruby
80
+ require 'ruby-graphviz'
81
+
82
+ # In this example, hello.dot is :
83
+ # digraph G {Hello->World;}
84
+
85
+ GraphViz.parse( "hello.dot", :path => "/usr/local/bin" ) { |g|
86
+ g.get_node("Hello") { |n|
87
+ n[:label] = "Bonjour"
88
+ }
89
+ g.get_node("World") { |n|
90
+ n[:label] = "Le Monde"
91
+ }
92
+ }.output(:png => "sample.png")
93
+ ```
94
+
95
+ [GraphML](http://graphml.graphdrawing.org/) support
96
+
97
+ ```ruby
98
+ require 'ruby-graphviz/graphml'
99
+
100
+ g = GraphViz::GraphML.new( "graphml/cluster.graphml" )
101
+ g.graph.output( :path => "/usr/local/bin", :png => "#{$0}.png" )
102
+ ```
103
+
104
+ ## TOOLS
105
+
106
+ Ruby/GraphViz also includes :
107
+
108
+ * `ruby2gv`, a simple tool that allows you to create a dependency graph from a ruby script. Example : http://drp.ly/dShaZ
109
+
110
+ ```ruby
111
+ ruby2gv -Tpng -oruby2gv.png ruby2gv
112
+ ```
113
+
114
+ * `gem2gv`, a tool that allows you to create a dependency graph between gems. Example : http://drp.ly/dSj9Y
115
+
116
+ ```ruby
117
+ gem2gv -Tpng -oruby-graphviz.png ruby-graphviz
118
+ ```
119
+
120
+ * `dot2ruby`, a tool that allows you to create a ruby script from a graphviz script
121
+
122
+ ```ruby
123
+ $ cat hello.dot
124
+ digraph G {Hello->World;}
125
+
126
+ $ dot2ruby hello.dot
127
+ # This code was generated by dot2ruby.g
128
+
129
+ require 'rubygems'
130
+ require 'ruby-graphviz'
131
+ graph_g = GraphViz.digraph( "G" ) { |graph_g|
132
+ graph_g[:bb] = '0,0,70,108'
133
+ node_hello = graph_g.add_nodes( "Hello", :height => '0.5', :label => '\N', :pos => '35,90', :width => '0.88889' )
134
+ graph_g.add_edges( "Hello", "World", :pos => 'e,35,36.413 35,71.831 35,64.131 35,54.974 35,46.417' )
135
+ node_world = graph_g.add_nodes( "World", :height => '0.5', :label => '\N', :pos => '35,18', :width => '0.97222' )
136
+ }
137
+ puts graph_g.output( :canon => String )
138
+ ```
139
+
140
+ * `git2gv`, a tool that allows you to show your git commits
141
+
142
+ * `xml2gv`, a tool that allows you to show a xml file as graph.
143
+
144
+
145
+ ## GRAPH THEORY
146
+
147
+ ```ruby
148
+ require 'ruby-graphviz'
149
+ require 'ruby-graphviz/theory'
150
+
151
+ g = GraphViz.new( :G ) { ... }
152
+
153
+ t = GraphViz::Theory.new( g )
154
+
155
+ puts "Adjancy matrix : "
156
+ puts t.adjancy_matrix
157
+
158
+ puts "Symmetric ? #{t.symmetric?}"
159
+
160
+ puts "Incidence matrix :"
161
+ puts t.incidence_matrix
162
+
163
+ g.each_node do |name, node|
164
+ puts "Degree of node `#{name}' = #{t.degree(node)}"
165
+ end
166
+
167
+ puts "Laplacian matrix :"
168
+ puts t.laplacian_matrix
169
+
170
+ puts "Dijkstra between a and f"
171
+ r = t.moore_dijkstra(g.a, g.f)
172
+ if r.nil?
173
+ puts "No way !"
174
+ else
175
+ print "\tPath : "; p r[:path]
176
+ puts "\tDistance : #{r[:distance]}"
177
+ end
178
+
179
+ print "Ranges : "
180
+ rr = t.range
181
+ p rr
182
+ puts "Your graph contains circuits" if rr.include?(nil)
183
+
184
+ puts "Critical path : "
185
+ rrr = t.critical_path
186
+ print "\tPath "; p rrr[:path]
187
+ puts "\tDistance : #{rrr[:distance]}"
188
+ ```
189
+
190
+ ## INSTALLATION
191
+
192
+ ```
193
+ sudo gem install ruby-graphviz
194
+ ```
195
+
196
+ You also need to install [GraphViz](http://www.graphviz.org)
197
+
198
+ On **Windows** you also need to install win32-open3. This is not an absolute
199
+ requirement.
200
+
201
+ ## LICENCES
202
+
203
+ ### Ruby/GraphViz
204
+
205
+ Ruby/GraphViz is freely distributable according to the terms of the GNU
206
+ General Public License (see the file 'COPYING').
207
+
208
+ This program is distributed without any warranty. See the file 'COPYING' for
209
+ details.
210
+
211
+ GNU General Public Licence: https://en.wikipedia.org/wiki/Gpl
212
+
213
+ ### nothugly.xsl
214
+
215
+ By Vidar Hokstad and Ryan Shea; Contributions by Jonas Tingborn, Earl
216
+ Cummings, Michael Kennedy (Graphviz 2.20.2 compatibility, bug fixes, testing,
217
+ lots of gradients)
218
+
219
+ Copyright (c) 2009 Vidar Hokstad
220
+
221
+ Permission is hereby granted, free of charge, to any person obtaining a copy
222
+ of this software and associated documentation files (the "Software"), to deal
223
+ in the Software without restriction, including without limitation the rights
224
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
225
+ copies of the Software, and to permit persons to whom the Software is
226
+ furnished to do so, subject to the following conditions:
227
+
228
+ The above copyright notice and this permission notice shall be included in all
229
+ copies or substantial portions of the Software.
230
+
231
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
232
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
233
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
234
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
235
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
236
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
237
+ SOFTWARE.
238
+
239
+ MIT license: https://en.wikipedia.org/wiki/MIT_License
240
+
241
+ ## Contributors
242
+
243
+ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
244
+
245
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
246
+ <!-- prettier-ignore-start -->
247
+ <!-- markdownlint-disable -->
248
+ <table>
249
+ <tr>
250
+ <td align="center"><a href="https://github.com/dburt"><img src="https://avatars0.githubusercontent.com/u/139988?v=4" width="100px;" alt=""/><br /><sub><b>Dave Burt</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=dburt" title="Code">💻</a></td>
251
+ <td align="center"><a href="https://github.com/obruening"><img src="https://avatars2.githubusercontent.com/u/146361?v=4" width="100px;" alt=""/><br /><sub><b>obruening</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=obruening" title="Code">💻</a></td>
252
+ <td align="center"><a href="https://github.com/hipe"><img src="https://avatars1.githubusercontent.com/u/22006?v=4" width="100px;" alt=""/><br /><sub><b>Chip Malice</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=hipe" title="Code">💻</a></td>
253
+ <td align="center"><a href="https://github.com/MSNexploder"><img src="https://avatars3.githubusercontent.com/u/101456?v=4" width="100px;" alt=""/><br /><sub><b>Stefan Stüben</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=MSNexploder" title="Code">💻</a></td>
254
+ <td align="center"><a href="https://github.com/oupo"><img src="https://avatars1.githubusercontent.com/u/143470?v=4" width="100px;" alt=""/><br /><sub><b>oupo</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=oupo" title="Code">💻</a></td>
255
+ <td align="center"><a href="http://lejeun.es"><img src="https://avatars1.githubusercontent.com/u/15168?v=4" width="100px;" alt=""/><br /><sub><b>Gregoire Lejeune</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=glejeune" title="Code">💻</a> <a href="#design-glejeune" title="Design">🎨</a> <a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=glejeune" title="Documentation">📖</a></td>
256
+ <td align="center"><a href="https://github.com/markus1189"><img src="https://avatars0.githubusercontent.com/u/591567?v=4" width="100px;" alt=""/><br /><sub><b>Markus Hauck</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=markus1189" title="Code">💻</a></td>
257
+ </tr>
258
+ <tr>
259
+ <td align="center"><a href="https://github.com/khalilfazal"><img src="https://avatars2.githubusercontent.com/u/308027?v=4" width="100px;" alt=""/><br /><sub><b>Khalil Fazal</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=khalilfazal" title="Code">💻</a></td>
260
+ <td align="center"><a href="https://github.com/kachick"><img src="https://avatars2.githubusercontent.com/u/1180335?v=4" width="100px;" alt=""/><br /><sub><b>Kenichi Kamiya</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=kachick" title="Code">💻</a></td>
261
+ <td align="center"><a href="https://github.com/nevenh"><img src="https://avatars0.githubusercontent.com/u/1448453?v=4" width="100px;" alt=""/><br /><sub><b>Neven Has</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=nevenh" title="Code">💻</a></td>
262
+ <td align="center"><a href="https://Andrew.Kvalhe.im"><img src="https://avatars1.githubusercontent.com/u/1844746?v=4" width="100px;" alt=""/><br /><sub><b>Andrew</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=AndrewKvalheim" title="Code">💻</a></td>
263
+ <td align="center"><a href="https://github.com/dznz"><img src="https://avatars3.githubusercontent.com/u/245206?v=4" width="100px;" alt=""/><br /><sub><b>Daniel Zollinger</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=dznz" title="Code">💻</a></td>
264
+ <td align="center"><a href="https://guilhermesimoes.github.io"><img src="https://avatars0.githubusercontent.com/u/531168?v=4" width="100px;" alt=""/><br /><sub><b>Guilherme Simoes</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=guilhermesimoes" title="Code">💻</a></td>
265
+ <td align="center"><a href="https://github.com/OrelSokolov"><img src="https://avatars0.githubusercontent.com/u/2205407?v=4" width="100px;" alt=""/><br /><sub><b>Oleg Orlov</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=OrelSokolov" title="Code">💻</a></td>
266
+ </tr>
267
+ <tr>
268
+ <td align="center"><a href="https://www.instagram.com/stewiecutedog/"><img src="https://avatars3.githubusercontent.com/u/222582?v=4" width="100px;" alt=""/><br /><sub><b>Gabe Kopley</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=gkop" title="Code">💻</a></td>
269
+ <td align="center"><a href="http://jakegoulding.com"><img src="https://avatars0.githubusercontent.com/u/174509?v=4" width="100px;" alt=""/><br /><sub><b>Jake Goulding</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=shepmaster" title="Code">💻</a></td>
270
+ <td align="center"><a href="https://github.com/hirochachacha"><img src="https://avatars0.githubusercontent.com/u/898442?v=4" width="100px;" alt=""/><br /><sub><b>hirochachacha</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=hirochachacha" title="Code">💻</a></td>
271
+ <td align="center"><a href="http://www.ronenbarzel.org"><img src="https://avatars2.githubusercontent.com/u/125620?v=4" width="100px;" alt=""/><br /><sub><b>ronen barzel</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=ronen" title="Code">💻</a></td>
272
+ <td align="center"><a href="https://jamison.dance"><img src="https://avatars1.githubusercontent.com/u/72027?v=4" width="100px;" alt=""/><br /><sub><b>Jamison Dance</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=jergason" title="Code">💻</a> <a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=jergason" title="Documentation">📖</a></td>
273
+ <td align="center"><a href="http://josephholsten.com"><img src="https://avatars3.githubusercontent.com/u/7495?v=4" width="100px;" alt=""/><br /><sub><b>Joseph Anthony Pasquale Holsten</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=josephholsten" title="Code">💻</a></td>
274
+ <td align="center"><a href="http://mfcabrera.com"><img src="https://avatars0.githubusercontent.com/u/12527?v=4" width="100px;" alt=""/><br /><sub><b>Miguel Cabrera</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=mfcabrera" title="Code">💻</a></td>
275
+ </tr>
276
+ <tr>
277
+ <td align="center"><a href="http://www.miketheman.net"><img src="https://avatars0.githubusercontent.com/u/529516?v=4" width="100px;" alt=""/><br /><sub><b>Mike Fiedler</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=miketheman" title="Code">💻</a></td>
278
+ <td align="center"><a href="http://nathanmlong.com"><img src="https://avatars2.githubusercontent.com/u/338814?v=4" width="100px;" alt=""/><br /><sub><b>Nathan Long</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=nathanl" title="Code">💻</a> <a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=nathanl" title="Documentation">📖</a></td>
279
+ <td align="center"><a href="http://ollehost.dk/"><img src="https://avatars0.githubusercontent.com/u/211?v=4" width="100px;" alt=""/><br /><sub><b>Olle Jonsson</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=olleolleolle" title="Code">💻</a> <a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=olleolleolle" title="Documentation">📖</a></td>
280
+ <td align="center"><a href="http://postmodern.github.com/"><img src="https://avatars2.githubusercontent.com/u/12671?v=4" width="100px;" alt=""/><br /><sub><b>Postmodern</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=postmodern" title="Code">💻</a></td>
281
+ <td align="center"><a href="https://www.versioneye.com"><img src="https://avatars0.githubusercontent.com/u/652130?v=4" width="100px;" alt=""/><br /><sub><b>Robert Reiz</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=reiz" title="Code">💻</a></td>
282
+ <td align="center"><a href="http://46halbe.de"><img src="https://avatars2.githubusercontent.com/u/1724196?v=4" width="100px;" alt=""/><br /><sub><b>Göran Bodenschatz</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=coding46" title="Code">💻</a></td>
283
+ <td align="center"><a href="https://www.hsbt.org/"><img src="https://avatars1.githubusercontent.com/u/12301?v=4" width="100px;" alt=""/><br /><sub><b>SHIBATA Hiroshi</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=hsbt" title="Code">💻</a></td>
284
+ </tr>
285
+ <tr>
286
+ <td align="center"><a href="https://github.com/moracca"><img src="https://avatars1.githubusercontent.com/u/7213746?v=4" width="100px;" alt=""/><br /><sub><b>moracca</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=moracca" title="Code">💻</a></td>
287
+ <td align="center"><a href="https://github.com/TPei"><img src="https://avatars0.githubusercontent.com/u/4004343?v=4" width="100px;" alt=""/><br /><sub><b>TPei</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=TPei" title="Documentation">📖</a></td>
288
+ <td align="center"><a href="https://github.com/villuorav"><img src="https://avatars3.githubusercontent.com/u/8543094?v=4" width="100px;" alt=""/><br /><sub><b>Villu Orav</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=villuorav" title="Documentation">📖</a></td>
289
+ <td align="center"><a href="https://github.com/deivid-rodriguez"><img src="https://avatars2.githubusercontent.com/u/2887858?v=4" width="100px;" alt=""/><br /><sub><b>David Rodríguez</b></sub></a><br /><a href="https://github.com/glejeune/Ruby-Graphviz/commits?author=deivid-rodriguez" title="Code">💻</a> <a href="#platform-deivid-rodriguez" title="Packaging/porting to new platform">📦</a></td>
290
+ </tr>
291
+ </table>
292
+
293
+ <!-- markdownlint-enable -->
294
+ <!-- prettier-ignore-end -->
295
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
296
+
297
+ This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
data/Rakefile CHANGED
@@ -5,41 +5,21 @@ require 'rubygems'
5
5
  require 'rake/clean'
6
6
  require 'bundler'
7
7
  require 'rubygems/package_task'
8
- require 'rdoc/task'
9
8
  require 'rake/testtask'
10
9
  require 'fileutils'
11
10
  require 'open-uri'
11
+ require 'yard'
12
12
  include FileUtils
13
13
 
14
14
  CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log']
15
- RDOC_OPTS = ['--quiet', '--title', "Ruby/GraphViz, the Documentation",
16
- "--opname", "index.html",
17
- "--line-numbers",
18
- "--main", "README.rdoc"]
19
15
 
20
16
  desc "Packages up Ruby/GraphViz."
21
17
  task :default => [:test, :package]
22
18
  task :package => [:clean]
23
19
 
24
- task :doc => :rdoc
20
+ task :doc => :yard
25
21
 
26
- RDoc::Task.new do |rdoc|
27
- rdoc.rdoc_dir = 'doc/rdoc'
28
- rdoc.options += RDOC_OPTS
29
- rdoc.main = "README.rdoc"
30
- rdoc.title = "Ruby/GraphViz, the Documentation"
31
- rdoc.rdoc_files.add ['README.rdoc', 'CHANGELOG.rdoc', 'AUTHORS.rdoc', 'COPYING.rdoc',
32
- 'lib/graphviz.rb',
33
- 'lib/graphviz/node.rb',
34
- 'lib/graphviz/edge.rb',
35
- 'lib/graphviz/constants.rb',
36
- 'lib/graphviz/xml.rb',
37
- 'lib/graphviz/graphml.rb',
38
- 'lib/graphviz/family_tree.rb',
39
- 'lib/graphviz/family_tree/couple.rb',
40
- 'lib/graphviz/family_tree/generation.rb',
41
- 'lib/graphviz/family_tree/person.rb',
42
- 'lib/graphviz/family_tree/sibling.rb']
22
+ YARD::Rake::YardocTask.new do |t|
43
23
  end
44
24
 
45
25
  Rake::TestTask.new(:test) do |t|
@@ -67,5 +47,24 @@ task :man do
67
47
  end
68
48
  end
69
49
 
50
+ namespace :changelog do
51
+ desc "Update CHANGELOG"
52
+ task :update do
53
+ require "github_changelog_generator"
54
+ GitHubChangelogGenerator::ChangelogGenerator.new.run
55
+ end
56
+ end
57
+
70
58
  Bundler::GemHelper.install_tasks
71
59
 
60
+ namespace :contributors do
61
+ desc "Install all-contributors-cli"
62
+ task :install do
63
+ sh "npm install --save-dev all-contributors-cli"
64
+ end
65
+
66
+ desc "Run"
67
+ task :run do
68
+ sh "npx all-contributors"
69
+ end
70
+ end
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  # Copyright (C) 2003 - 2012 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
3
  #
3
4
  # This program is free software; you can redistribute it and/or modify
@@ -32,10 +33,6 @@ require 'graphviz/dot2ruby'
32
33
  require 'graphviz/types'
33
34
  require 'graphviz/core_ext'
34
35
 
35
- if /^1.8/.match RUBY_VERSION
36
- $KCODE = "UTF8"
37
- end
38
-
39
36
  class GraphViz
40
37
  include GraphViz::Constants
41
38
  include GraphViz::Utils
@@ -156,6 +153,15 @@ class GraphViz
156
153
  return nil
157
154
  end
158
155
 
156
+ def enumerate_nodes
157
+ nodes = @hoNodes.keys
158
+ each_graph { |_, g|
159
+ child_nodes = g.enumerate_nodes
160
+ nodes += child_nodes
161
+ }
162
+ return nodes
163
+ end
164
+
159
165
  #
160
166
  # Return the node object for the given index
161
167
  #
@@ -41,7 +41,7 @@
41
41
  #
42
42
  class GraphViz
43
43
  module Constants
44
- RGV_VERSION = "1.2.4"
44
+ RGV_VERSION = "1.2.5"
45
45
 
46
46
  ## Const: Output formats
47
47
  FORMATS = [
@@ -215,6 +215,7 @@ class GraphViz
215
215
  "mode" => { :usedBy => "G", :type => :EscString }, # string
216
216
  "model" => { :usedBy => "G", :type => :EscString }, # string
217
217
  "mosek" => { :usedBy => "G", :type => :GvBool }, # bool
218
+ "newrank" => { :usedBy => "G", :type => :EscString }, # rankType
218
219
  "nodesep" => { :usedBy => "G", :type => :GvDouble },
219
220
  "nojustify" => { :usedBy => "GCNE", :type => :GvBool }, # bool
220
221
  "normalize" => { :usedBy => "G", :type => :GvBool }, # bool