graph 2.5.0 → 2.5.1

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.
Files changed (5) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +6 -0
  3. data/lib/graph.rb +17 -8
  4. metadata +13 -13
  5. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,9 @@
1
+ === 2.5.1 / 2012-06-27
2
+
3
+ * 1 bug fix:
4
+
5
+ * UGH. The latest 1.8.7 version has randomized hash buckets and that breaks JUST my tests.
6
+
1
7
  === 2.5.0 / 2012-02-13
2
8
 
3
9
  * 1 minor enhancement:
@@ -7,7 +7,7 @@ require "enumerator"
7
7
  # dot format.
8
8
 
9
9
  class Graph
10
- VERSION = "2.5.0" # :nodoc:
10
+ VERSION = "2.5.1" # :nodoc:
11
11
 
12
12
  LIGHT_COLORS = %w(gray lightblue lightcyan lightgray lightpink
13
13
  lightslategray lightsteelblue white)
@@ -120,6 +120,10 @@ class Graph
120
120
 
121
121
  attr_reader :subgraphs
122
122
 
123
+ # TODO: remove if/when I drop 1.8 support.
124
+ attr_reader :nodes_order # :nodoc:
125
+ attr_reader :edges_order # :nodoc:
126
+
123
127
  ##
124
128
  # Creates a new graph object. Optional name and parent graph are
125
129
  # available. Also takes an optional block for DSL-like use.
@@ -128,9 +132,14 @@ class Graph
128
132
  @name = name
129
133
  @graph = graph
130
134
  graph << self if graph
131
- @nodes = Hash.new { |h,k| h[k] = Node.new self, k }
135
+ @nodes_order = []
136
+ @nodes = Hash.new { |h,k| @nodes_order << k; h[k] = Node.new self, k }
137
+ @edges_order = []
132
138
  @edges = Hash.new { |h,k|
133
- h[k] = Hash.new { |h2, k2| h2[k2] = Edge.new self, self[k], self[k2] }
139
+ h[k] = Hash.new { |h2, k2|
140
+ @edges_order << [k, k2]
141
+ h2[k2] = Edge.new self, self[k], self[k2]
142
+ }
134
143
  }
135
144
  @graph_attribs = []
136
145
  @node_attribs = []
@@ -360,14 +369,14 @@ class Graph
360
369
  result << " #{line};"
361
370
  end
362
371
 
363
- nodes.each do |name, node|
372
+ nodes_order.each do |name|
373
+ node = nodes[name]
364
374
  result << " #{node};" if graph or node.attributes? or node.orphan?
365
375
  end
366
376
 
367
- edges.each do |from, deps|
368
- deps.each do |to, edge|
369
- result << " #{edge};"
370
- end
377
+ edges_order.uniq.each do |(from, to)|
378
+ edge = edges[from][to]
379
+ result << " #{edge};"
371
380
  end
372
381
 
373
382
  result << " }"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graph
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 5
9
- - 0
10
- version: 2.5.0
9
+ - 1
10
+ version: 2.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,7 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2012-02-14 00:00:00 Z
39
+ date: 2012-06-27 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
@@ -46,11 +46,11 @@ dependencies:
46
46
  requirements:
47
47
  - - ~>
48
48
  - !ruby/object:Gem::Version
49
- hash: 21
49
+ hash: 7
50
50
  segments:
51
- - 2
52
- - 11
53
- version: "2.11"
51
+ - 3
52
+ - 0
53
+ version: "3.0"
54
54
  type: :development
55
55
  version_requirements: *id001
56
56
  - !ruby/object:Gem::Dependency
@@ -76,11 +76,11 @@ dependencies:
76
76
  requirements:
77
77
  - - ~>
78
78
  - !ruby/object:Gem::Version
79
- hash: 25
79
+ hash: 7
80
80
  segments:
81
- - 2
82
- - 13
83
- version: "2.13"
81
+ - 3
82
+ - 0
83
+ version: "3.0"
84
84
  type: :development
85
85
  version_requirements: *id003
86
86
  description: |-
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  requirements: []
165
165
 
166
166
  rubyforge_project: seattlerb
167
- rubygems_version: 1.8.12
167
+ rubygems_version: 1.8.24
168
168
  signing_key:
169
169
  specification_version: 3
170
170
  summary: Graph is a type of hash that outputs in graphviz's dot format
metadata.gz.sig CHANGED
Binary file