ruby-graphviz 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,9 +16,10 @@
16
16
  * Ronen Barzel <https://github.com/ronen>
17
17
  * Jamison Dance <https://github.com/jergason>
18
18
  * hirochachacha <https://github.com/hirochachacha>
19
- * coding64 (https://github.com/coding46)
20
- * Neven Has (https://github.com/nevenh)
21
- * Postmodern (https://github.com/postmodern)
19
+ * coding64 <https://github.com/coding46>
20
+ * Neven Has <https://github.com/nevenh>
21
+ * Postmodern <https://github.com/postmodern>
22
+ * markus1189 <https://github.com/markus1189>
22
23
 
23
24
  Thanks to :
24
25
 
@@ -1,5 +1,9 @@
1
1
  = CHANGELOG
2
2
 
3
+ == 1.0.7 :
4
+ * Issue #48 : add_graph fails when passed a GraphViz object
5
+ * Issue #47 : Find executable (by markus1189)
6
+
3
7
  == 1.0.6 :
4
8
  * Issue #46 : Some tests fail because it cannot find 'dot'
5
9
  * Issue #45 : Fix for copy/paste error (by coding46)
@@ -1,6 +1,6 @@
1
1
  = Ruby/GraphViz
2
2
 
3
- Copyright (C) 2004-2011 Gregoire Lejeune
3
+ Copyright (C) 2004-2012 Gregoire Lejeune
4
4
 
5
5
  * Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
6
6
  * Sources : http://github.com/glejeune/Ruby-Graphviz
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ # Copyright (C) 2005 - 2012 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  #
4
4
  # This program is free software; you can redistribute it and/or modify
5
5
  # it under the terms of the GNU General Public License as published by
data/bin/xml2gv CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
+ # Copyright (C) 2005 - 2012 Gregoire Lejeune <gregoire.lejeune@free.fr>
3
3
  #
4
4
  # This program is free software; you can redistribute it and/or modify
5
5
  # it under the terms of the GNU General Public License as published by
@@ -93,4 +93,4 @@ if xFile.nil? == true
93
93
  end
94
94
 
95
95
  gvxml = GraphViz::XML::new( xFile, :text => true, :attrs => true )
96
- gvxml.graph.output( xOutFormat => xOutFile, :path => xGVPath )
96
+ gvxml.graph.output( xOutFormat => xOutFile, :path => xGVPath )
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Gregoire Lejeune <gregoire.lejeune@free.fr>
1
+ # Copyright (C) 2003 - 2012 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -260,6 +260,8 @@ class GraphViz
260
260
  if xGraphName.kind_of?(GraphViz)
261
261
  xGraphID = xGraphName.id
262
262
  @hoGraphs[xGraphID] = xGraphName.clone
263
+ @hoGraphs[xGraphID].type = @oGraphType
264
+ @hoGraphs[xGraphID].pg = self
263
265
  xGraphName = xGraphID
264
266
  else
265
267
  if xGraphName.kind_of?(Hash)
@@ -331,6 +333,9 @@ class GraphViz
331
333
  def type
332
334
  @oGraphType
333
335
  end
336
+ def type=(x) #:nodoc:
337
+ @oGraphType = x
338
+ end
334
339
 
335
340
  #
336
341
  # Get the number of graphs
@@ -510,7 +515,7 @@ class GraphViz
510
515
  end
511
516
  @prog = xValue
512
517
  when "path"
513
- @path = xValue.split( "," ).map{ |x| x.strip }
518
+ @path = xValue && xValue.split( "," ).map{ |x| x.strip }
514
519
  when "errors"
515
520
  @errors = xValue
516
521
  when "extlib"
@@ -702,6 +707,9 @@ class GraphViz
702
707
  def pg #:nodoc:
703
708
  @oParentGraph
704
709
  end
710
+ def pg=(x) #:nodoc:
711
+ @oParentGraph = x
712
+ end
705
713
 
706
714
  #
707
715
  # Return the root graph
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Gregoire Lejeune <gregoire.lejeune@free.fr>
1
+ # Copyright (C) 2004 - 2012 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Gregoire Lejeune <gregoire.lejeune@free.fr>
1
+ # Copyright (C) 2004 - 2012 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@
40
40
  # C => cluster
41
41
  #
42
42
  module Constants
43
- RGV_VERSION = "1.0.6"
43
+ RGV_VERSION = "1.0.7"
44
44
 
45
45
  ## Const: Output formats
46
46
  FORMATS = [
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Gregoire Lejeune <gregoire.lejeune@free.fr>
1
+ # Copyright (C) 2004 - 2012 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -16,14 +16,16 @@ module GVUtils
16
16
  # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
17
17
  # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
18
18
  # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
- def find_executable(bin, paths) #:nodoc:
20
- paths = ENV['PATH'].split(File::PATH_SEPARATOR) if paths.nil? or paths.empty?
21
-
22
- paths.each do |path|
23
- file = (path.nil?)?bin:File.join(path,bin)
24
- if File.executable?(file) and not File.directory?(file) then
25
- return file
26
- elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ # WAS: elsif RUBY_PLATFORM =~ /mswin|mingw/
19
+ def find_executable(bin, custom_paths) #:nodoc:
20
+ system_path = ENV['PATH']
21
+ user_given_path = Array(custom_paths).join(File::PATH_SEPARATOR)
22
+ search_path = system_path + File::PATH_SEPARATOR + user_given_path
23
+
24
+ search_path.split(File::PATH_SEPARATOR).each do |path|
25
+ file_path = File.join(path,bin)
26
+ return file_path if File.executable?(file_path) and File.file?(file_path)
27
+
28
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ # WAS: elsif RUBY_PLATFORM =~ /mswin|mingw/
27
29
  found_ext = (ENV['PATHEXT'] || '.exe;.bat;.com').split(";").find {|ext| File.executable?(file + ext) }
28
30
  return file + found_ext if found_ext
29
31
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Gregoire Lejeune <gregoire.lejeune@free.fr>
1
+ # Copyright (C) 2004 - 2012 Gregoire Lejeune <gregoire.lejeune@free.fr>
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -0,0 +1,16 @@
1
+ require 'test/unit'
2
+ $:.unshift(File.expand_path('../../lib',__FILE__))
3
+ require 'graphviz'
4
+
5
+ class GraphVizSubGraphTest < Test::Unit::TestCase
6
+ def test_subgraph
7
+ master1 = GraphViz::new(:G)
8
+ cl1 = master1.add_graph('cluster_cl1')
9
+
10
+ master2 = GraphViz::new(:G)
11
+ cl2 = GraphViz::new('cluster_cl1')
12
+ master2.add_graph cl2
13
+
14
+ assert_equal(master1.inspect, master2.inspect, "Wrong subgraph")
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-graphviz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-01 00:00:00.000000000 Z
12
+ date: 2012-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -239,6 +239,7 @@ files:
239
239
  - test/test_examples.rb
240
240
  - test/test_graph.rb
241
241
  - test/test_search.rb
242
+ - test/test_subgraph.rb
242
243
  - test/test_theory.rb
243
244
  - test/test_types.rb
244
245
  - test/test_utils_colors.rb
@@ -284,6 +285,7 @@ test_files:
284
285
  - test/test_examples.rb
285
286
  - test/test_graph.rb
286
287
  - test/test_search.rb
288
+ - test/test_subgraph.rb
287
289
  - test/test_theory.rb
288
290
  - test/test_types.rb
289
291
  - test/test_utils_colors.rb