mementus 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -6
- data/lib/mementus/mutators.rb +8 -0
- data/lib/mementus/version.rb +1 -1
- data/spec/mutable_graph_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e42c083e1ae9ae809d54f14f7b591e2bc284f3d
|
4
|
+
data.tar.gz: fae1ead8b3ad28db5f8577dede5f050009cc0006
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbb064bc33f02815ecbb090150fa9a312ab96e4f4b42fea44f5fecd1c58cdfa7ee7d103f90e0b9bae6b93dac09d7aef46e68bf0c83a90535401fba7e5f3dd4b3
|
7
|
+
data.tar.gz: 27bbf6b5a7962eef54d519207d710123cafc7a4b247cafec5beefeba23c0c3669cd01823662464c8aef497141bfadf1dd7e153ab72fc46dc99cf4c478309c1be
|
data/.travis.yml
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
- 2.3.1
|
6
|
-
- 2.4.0-preview1
|
3
|
+
- 2.3
|
4
|
+
- 2.4
|
7
5
|
- ruby-head
|
8
|
-
- jruby-9
|
6
|
+
- jruby-9.1.13.0
|
9
7
|
- jruby-head
|
10
|
-
|
8
|
+
- rbx-3
|
9
|
+
before_install: gem install bundler
|
11
10
|
script: bundle exec rspec
|
data/lib/mementus/mutators.rb
CHANGED
@@ -33,5 +33,13 @@ module Mementus
|
|
33
33
|
builder.id = @edge_ids.next_id unless builder.id
|
34
34
|
set_edge(builder.to_edge)
|
35
35
|
end
|
36
|
+
|
37
|
+
def remove_node(node)
|
38
|
+
@structure.remove_node(node)
|
39
|
+
end
|
40
|
+
|
41
|
+
def remove_edge(edge)
|
42
|
+
@structure.remove_edge(edge)
|
43
|
+
end
|
36
44
|
end
|
37
45
|
end
|
data/lib/mementus/version.rb
CHANGED
data/spec/mutable_graph_spec.rb
CHANGED
@@ -113,4 +113,22 @@ describe Mementus::MutableGraph do
|
|
113
113
|
expect(edge[:name]).to eq('Relationship')
|
114
114
|
end
|
115
115
|
end
|
116
|
+
|
117
|
+
specify '#remove_node' do
|
118
|
+
graph = Mementus::MutableGraph.new
|
119
|
+
graph.add_edge(from: 1, to: 2)
|
120
|
+
|
121
|
+
graph.remove_node(2)
|
122
|
+
expect(graph.nodes_count).to eq(1)
|
123
|
+
expect(graph.edges_count).to eq(0)
|
124
|
+
end
|
125
|
+
|
126
|
+
specify '#remove_edge' do
|
127
|
+
graph = Mementus::MutableGraph.new
|
128
|
+
graph.add_edge(from: 1, to: 2)
|
129
|
+
|
130
|
+
graph.remove_edge(1)
|
131
|
+
expect(graph.nodes_count).to eq(2)
|
132
|
+
expect(graph.edges_count).to eq(0)
|
133
|
+
end
|
116
134
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mementus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maetl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|