graph 2.5.3 → 2.6.0
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.
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/lib/graph.rb +8 -1
- data/test/test_graph.rb +22 -4
- metadata +18 -18
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/lib/graph.rb
CHANGED
@@ -7,7 +7,7 @@ require "enumerator"
|
|
7
7
|
# dot format.
|
8
8
|
|
9
9
|
class Graph
|
10
|
-
VERSION = "2.
|
10
|
+
VERSION = "2.6.0" # :nodoc:
|
11
11
|
|
12
12
|
# :stopdoc:
|
13
13
|
|
@@ -370,6 +370,13 @@ class Graph
|
|
370
370
|
subgraph "cluster_#{name}", &block
|
371
371
|
end
|
372
372
|
|
373
|
+
##
|
374
|
+
# Deletes a node from the graph
|
375
|
+
def delete_node node_name
|
376
|
+
nodes.delete node_name
|
377
|
+
nodes_order.delete node_name
|
378
|
+
end
|
379
|
+
|
373
380
|
##
|
374
381
|
# Outputs a graphviz graph.
|
375
382
|
|
data/test/test_graph.rb
CHANGED
@@ -9,7 +9,7 @@ class String
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
class TestGraph <
|
12
|
+
class TestGraph < Minitest::Test
|
13
13
|
attr_accessor :graph
|
14
14
|
|
15
15
|
def assert_attribute k, v, a
|
@@ -109,6 +109,24 @@ class TestGraph < MiniTest::Unit::TestCase
|
|
109
109
|
assert_graph graph, 'label = "blah"', '"a" -> "b"'
|
110
110
|
end
|
111
111
|
|
112
|
+
def test_delete_node
|
113
|
+
g = digraph do
|
114
|
+
node "a"
|
115
|
+
node "b"
|
116
|
+
end
|
117
|
+
|
118
|
+
assert_equal 2, g.nodes.length
|
119
|
+
assert_equal 2, g.nodes_order.length
|
120
|
+
assert_equal %w[a b], g.nodes.keys.sort
|
121
|
+
|
122
|
+
g.delete_node "a"
|
123
|
+
|
124
|
+
assert_equal 1, g.nodes.length
|
125
|
+
assert_equal 1, g.nodes_order.length
|
126
|
+
assert_equal %w[b], g.nodes.keys.sort
|
127
|
+
end
|
128
|
+
|
129
|
+
|
112
130
|
def test_label_html
|
113
131
|
graph.label "<<B>blah</B>>"
|
114
132
|
|
@@ -270,7 +288,7 @@ g_s = "subgraph \"subgraph\"
|
|
270
288
|
end
|
271
289
|
end
|
272
290
|
|
273
|
-
class TestAttribute <
|
291
|
+
class TestAttribute < Minitest::Test
|
274
292
|
attr_accessor :a
|
275
293
|
|
276
294
|
def setup
|
@@ -312,7 +330,7 @@ class TestCompoundAttribute < TestAttribute
|
|
312
330
|
end
|
313
331
|
end
|
314
332
|
|
315
|
-
class TestNode <
|
333
|
+
class TestNode < Minitest::Test
|
316
334
|
attr_accessor :n
|
317
335
|
|
318
336
|
def setup
|
@@ -404,7 +422,7 @@ class TestNode < MiniTest::Unit::TestCase
|
|
404
422
|
end
|
405
423
|
end
|
406
424
|
|
407
|
-
class TestEdge <
|
425
|
+
class TestEdge < Minitest::Test
|
408
426
|
attr_accessor :e
|
409
427
|
|
410
428
|
def setup
|
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:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 2.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 2.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -16,9 +16,9 @@ bindir: bin
|
|
16
16
|
cert_chain:
|
17
17
|
- |
|
18
18
|
-----BEGIN CERTIFICATE-----
|
19
|
-
|
19
|
+
MIIDPjCCAiagAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
20
20
|
ZC1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END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2013-
|
39
|
+
date: 2013-09-19 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
@@ -76,11 +76,11 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - ~>
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
hash:
|
79
|
+
hash: 9
|
80
80
|
segments:
|
81
81
|
- 3
|
82
|
-
-
|
83
|
-
version: "3.
|
82
|
+
- 7
|
83
|
+
version: "3.7"
|
84
84
|
type: :development
|
85
85
|
version_requirements: *id003
|
86
86
|
description: |-
|
@@ -135,8 +135,8 @@ files:
|
|
135
135
|
- test/test_graph.rb
|
136
136
|
- .gemtest
|
137
137
|
homepage: https://github.com/seattlerb/graph
|
138
|
-
licenses:
|
139
|
-
|
138
|
+
licenses:
|
139
|
+
- MIT
|
140
140
|
post_install_message:
|
141
141
|
rdoc_options:
|
142
142
|
- --main
|
metadata.gz.sig
CHANGED
Binary file
|