gn_crossmap 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +9 -0
- data/lib/gn_crossmap/resolver.rb +12 -7
- data/lib/gn_crossmap/version.rb +1 -1
- 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: 3436378ff8a58c2bcbf8fdb9988ccf89a0718429
|
4
|
+
data.tar.gz: efe61399742c47ae81a8131f9418ec3cb7ba51cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a95c9255fd031065e3383c10111017025f46ed00a801b1fb6d80cf5f0e01b72e8d1f7348b1f74a22b5f221d82d8c2c67debf3cedd6bc4a23887c58f176e33902
|
7
|
+
data.tar.gz: ae5cecc6f154eec1bc33033a41653527be10c5ac85d22faf83b0ceedd8b5d3f1bc2282a9ec089886de8eb631c87493f4ba13ad92ee053f75dacaf5905f7d3f63
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -130,6 +130,15 @@ GnCrossmap.run(opts) do |stats|
|
|
130
130
|
end
|
131
131
|
```
|
132
132
|
|
133
|
+
To trigger termination of the resolution before it is completed
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
GnCrossmap.run(opts) do
|
137
|
+
# do something and then return STOP string from the block
|
138
|
+
"STOP"
|
139
|
+
end
|
140
|
+
```
|
141
|
+
|
133
142
|
#### Intermediate stats format
|
134
143
|
|
135
144
|
|Field |Description |
|
data/lib/gn_crossmap/resolver.rb
CHANGED
@@ -14,19 +14,24 @@ module GnCrossmap
|
|
14
14
|
|
15
15
|
def resolve(data)
|
16
16
|
update_stats(data.size)
|
17
|
-
data.
|
18
|
-
with_log do
|
19
|
-
names = collect_names(slice)
|
20
|
-
remote_resolve(names)
|
21
|
-
yield(@stats.stats) if block_given?
|
22
|
-
end
|
23
|
-
end
|
17
|
+
block_given? ? process(data, &Proc.new) : process(data)
|
24
18
|
wrap_up
|
25
19
|
yield(@stats.stats) if block_given?
|
26
20
|
end
|
27
21
|
|
28
22
|
private
|
29
23
|
|
24
|
+
def process(data)
|
25
|
+
cmd = nil
|
26
|
+
data.each_slice(@batch) do |slice|
|
27
|
+
with_log do
|
28
|
+
remote_resolve(collect_names(slice))
|
29
|
+
cmd = yield(@stats.stats) if block_given?
|
30
|
+
end
|
31
|
+
break if cmd == "STOP"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
30
35
|
def wrap_up
|
31
36
|
@stats.stats[:resolution_stop] = Time.now
|
32
37
|
@stats.stats[:status] = :finish
|
data/lib/gn_crossmap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gn_crossmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Mozzherin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trollop
|