cecelia 0.0.5 → 0.0.6
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/lib/cecelia/graph.rb +5 -2
- data/lib/cecelia/version.rb +1 -1
- data/pkg/cecelia-0.0.3.gem +0 -0
- data/pkg/cecelia-0.0.5.gem +0 -0
- data/pkg/cecelia-0.0.6.gem +0 -0
- data/spec/graph_spec.rb +5 -2
- metadata +12 -25
data/lib/cecelia/graph.rb
CHANGED
@@ -18,8 +18,11 @@ class Graph
|
|
18
18
|
begin
|
19
19
|
source_id = Vertices.find(:label => source)[:id]
|
20
20
|
target_id = Vertices.find(:label => target)[:id]
|
21
|
-
rescue
|
22
|
-
|
21
|
+
rescue
|
22
|
+
add_vertex(source)
|
23
|
+
add_vertex(target)
|
24
|
+
source_id = Vertices.find(:label => source)[:id]
|
25
|
+
target_id = Vertices.find(:label => target)[:id]
|
23
26
|
ensure
|
24
27
|
add_edge_id(source_id, target_id, attributes = {})
|
25
28
|
end
|
data/lib/cecelia/version.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/spec/graph_spec.rb
CHANGED
@@ -68,7 +68,9 @@ describe Graph,"エッジの追加に関するテスト" do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
it "存在しないノード間エッジは禁止" do
|
71
|
-
g.
|
71
|
+
size = g.vertices.size
|
72
|
+
g.add_edge("100","200")
|
73
|
+
(g.vertices.size - size).should == 2
|
72
74
|
end
|
73
75
|
|
74
76
|
it "複数ノードの追加" do
|
@@ -78,12 +80,13 @@ describe Graph,"エッジの追加に関するテスト" do
|
|
78
80
|
end
|
79
81
|
|
80
82
|
it "複数エッジの追加" do
|
83
|
+
size = g.edges.size
|
81
84
|
g.add_edge("3","4")
|
82
85
|
g.add_edge("5","6")
|
83
86
|
g.add_edge("6","7")
|
84
87
|
g.add_edge("1","6")
|
85
88
|
|
86
|
-
g.edges.size.should ==
|
89
|
+
(g.edges.size - size).should == 4
|
87
90
|
end
|
88
91
|
end
|
89
92
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cecelia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-25 00:00:00.
|
12
|
+
date: 2012-09-25 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70144744086200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
24
|
+
version_requirements: *70144744086200
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: rspec
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &70144744084020 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ! '>='
|
@@ -37,15 +32,10 @@ dependencies:
|
|
37
32
|
version: '0'
|
38
33
|
type: :runtime
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
35
|
+
version_requirements: *70144744084020
|
46
36
|
- !ruby/object:Gem::Dependency
|
47
37
|
name: sequel
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &70144744081940 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
40
|
requirements:
|
51
41
|
- - ! '>='
|
@@ -53,12 +43,7 @@ dependencies:
|
|
53
43
|
version: '0'
|
54
44
|
type: :runtime
|
55
45
|
prerelease: false
|
56
|
-
version_requirements:
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
46
|
+
version_requirements: *70144744081940
|
62
47
|
description: cecelia
|
63
48
|
email:
|
64
49
|
- onodes@onod.es
|
@@ -76,6 +61,9 @@ files:
|
|
76
61
|
- lib/cecelia/graph_model.rb
|
77
62
|
- lib/cecelia/version.rb
|
78
63
|
- pkg/cecelia-0.0.1.gem
|
64
|
+
- pkg/cecelia-0.0.3.gem
|
65
|
+
- pkg/cecelia-0.0.5.gem
|
66
|
+
- pkg/cecelia-0.0.6.gem
|
79
67
|
- spec/graph_spec.rb
|
80
68
|
homepage: https://github.com/onodes/cecelia
|
81
69
|
licenses: []
|
@@ -97,10 +85,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
85
|
version: '0'
|
98
86
|
requirements: []
|
99
87
|
rubyforge_project: cecelia
|
100
|
-
rubygems_version: 1.8.
|
88
|
+
rubygems_version: 1.8.10
|
101
89
|
signing_key:
|
102
90
|
specification_version: 3
|
103
91
|
summary: cecelia
|
104
92
|
test_files:
|
105
93
|
- spec/graph_spec.rb
|
106
|
-
has_rdoc:
|