ruby-graphviz 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  rvm:
2
2
  - 1.8.7
3
- - 1.9.2
3
+ - 1.9.3
4
4
  - jruby
5
+ - rbx-18mode
6
+ - rbx-19mode
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,10 @@
1
1
  = CHANGELOG
2
2
 
3
+ == 1.0.5 :
4
+ * Change deprecated methods in gem2gv, git2gv and ruby2gv
5
+ * Issue #38
6
+ * Issue #39
7
+
3
8
  == 1.0.4 :
4
9
  * GraphViz::Edge#each_attribut is deprecated, please use GraphViz::Edge#each_attribute
5
10
  * GraphViz::GraphML#attributs is deprecated, please, use GraphViz::GraphML#attributes
data/bin/gem2gv CHANGED
@@ -71,7 +71,7 @@ class Gem2Gv
71
71
  #nodeLabel = "#{name}\n#{version}"
72
72
  nodeName = "#{name}"
73
73
  nodeLabel = "#{name}"
74
- return @oGraph.get_node(nodeName) || @oGraph.add_node( nodeName, "label" => nodeLabel )
74
+ return @oGraph.get_node(nodeName) || @oGraph.add_nodes( nodeName, "label" => nodeLabel )
75
75
  end
76
76
 
77
77
  def createEdges( gemName, version, nodes )
@@ -79,7 +79,7 @@ class Gem2Gv
79
79
 
80
80
  nodes.each do |node|
81
81
  nodeB = getNode( node[:name], node[:version] )
82
- @oGraph.add_edge( nodeA, nodeB )
82
+ @oGraph.add_edges( nodeA, nodeB )
83
83
  end
84
84
  end
85
85
  end
@@ -163,4 +163,4 @@ end
163
163
  g = Gem2Gv.new( xGVPath, xUse )
164
164
  g.go( xGem )
165
165
  result = g.out( xOutFormat, xOutFile )
166
- puts result unless result.nil?
166
+ puts result unless result.nil?
data/bin/git2gv CHANGED
@@ -30,11 +30,11 @@ class Git2Gv
30
30
  git.node[:shape => "record"]
31
31
 
32
32
  branches.each do |branch|
33
- git.add_node( branch, :style => "filled", :fillcolor => :lightgrey )
33
+ git.add_nodes( branch, :style => "filled", :fillcolor => :lightgrey )
34
34
  end
35
35
 
36
36
  commits.each do |commit|
37
- git.add_node(
37
+ git.add_nodes(
38
38
  commit[:short],
39
39
  :style => "filled",
40
40
  :fillcolor => :lightblue,
@@ -43,11 +43,11 @@ class Git2Gv
43
43
  end
44
44
 
45
45
  refs.each do |from, to|
46
- git.add_edge( from, to )
46
+ git.add_edges( from, to )
47
47
  end
48
48
 
49
49
  relations.each do |from, to|
50
- git.add_edge( to, from, :dir => "back" )
50
+ git.add_edges( to, from, :dir => "back" )
51
51
  end
52
52
 
53
53
  git.output( @xOutFormat => @xOutFile, :nothugly => @bNothugly )
data/bin/ruby2gv CHANGED
@@ -55,9 +55,9 @@ class Rb2Gv
55
55
  def gv_newNode( xNode, xShape = "box", xColor = nil )
56
56
  xNodeName = xNode.gsub( /[^a-zA-Z0-9]/, "_" )
57
57
  if xColor.nil? == true
58
- @oGraph.add_node( xNodeName, "label" => xNode, "shape" => xShape )
58
+ @oGraph.add_nodes( xNodeName, "label" => xNode, "shape" => xShape )
59
59
  else
60
- @oGraph.add_node( xNodeName, "label" => xNode, "shape" => xShape, "style" => "filled", "color" => xColor )
60
+ @oGraph.add_nodes( xNodeName, "label" => xNode, "shape" => xShape, "style" => "filled", "color" => xColor )
61
61
  end
62
62
  end
63
63
 
@@ -143,7 +143,7 @@ class Rb2Gv
143
143
 
144
144
  puts " + Edge #{xLib} -> #{xRequiredLib}" if DEBUG
145
145
  unless @hxEdge.include?( "#{@hxNodes[xLib].id}-#{@hxNodes[xRequiredLib].id}" )
146
- @oGraph.add_edge( @hxNodes[xLib], @hxNodes[xRequiredLib] )
146
+ @oGraph.add_edges( @hxNodes[xLib], @hxNodes[xRequiredLib] )
147
147
  @hxEdge << "#{@hxNodes[xLib].id}-#{@hxNodes[xRequiredLib].id}"
148
148
  end
149
149
  end
data/lib/graphviz.rb CHANGED
@@ -549,7 +549,7 @@ class GraphViz
549
549
  begin
550
550
  require 'graphviz/nothugly'
551
551
  @nothugly = true
552
- rescue
552
+ rescue LoadError => e
553
553
  warn "You must install ruby-xslt to use nothugly option!"
554
554
  @nothugly = false
555
555
  end
@@ -56,6 +56,11 @@ class GraphViz
56
56
  raise ArgumentError, "#{@name} attribute '#{key.to_s}' invalid"
57
57
  end
58
58
 
59
+ if value.nil?
60
+ warn "Value for attribute `#{key}` can't be null"
61
+ return
62
+ end
63
+
59
64
  begin
60
65
  value = GraphViz::Types.const_get(@attributes[key.to_s]).new( value )
61
66
  rescue => e
@@ -40,7 +40,7 @@
40
40
  # C => cluster
41
41
  #
42
42
  module Constants
43
- RGV_VERSION = "1.0.4"
43
+ RGV_VERSION = "1.0.5"
44
44
 
45
45
  ## Const: Output formats
46
46
  FORMATS = [
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 4
10
- version: 1.0.4
9
+ - 5
10
+ version: 1.0.5
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: 2012-01-29 00:00:00 Z
18
+ date: 2012-02-06 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake