turbot-runner-morph 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/turbot_runner/base_handler.rb +3 -0
- data/lib/turbot_runner/processor.rb +2 -2
- data/lib/turbot_runner/version.rb +1 -1
- data/spec/bots/bot-that-emits-snapshot-ended/manifest.json +8 -0
- data/spec/bots/bot-that-emits-snapshot-ended/scraper.rb +11 -0
- data/spec/lib/runner_spec.rb +18 -2
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDJhMjMzZjdhNjZkNTdmZDE1Y2YwYzA2MzI1NjJiNTNhODk5NGMyZg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MDFjYzNkYjgzYjdhM2RhNWFhMTFmZTZiYjE0NmM5ZjRmODFiNmRmOA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OTQxMDQwYTBhMmI4MDQxZmNlNWNhNmU4NmVlODNlNzYxNzA1OGMyZDZmZmMy
|
10
|
+
MmM3MGFhYjhlZDE1ZWViOTk5ZGViOGEwZmM0MThjZWEwY2M3NDZkZWM2YWFm
|
11
|
+
YjA3NzgxODU3M2Y3MTM0NGMyNDgwNGY2YzZmZTc2YjBjMWQwNjA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2E2MmFmZmZkYzBkZWFiMTNjODYwOWFkMjJkYzJlZTI4YjgwMTI1YmY3YjUx
|
14
|
+
ZDIzNDc2NTUyMTYzYmFkOTZjMDQyYzIxZjhmMzNlYjMyNjViYjdmZTE4MDkx
|
15
|
+
ZDM1YTFkODIwNmRhYjVmMzM5NGEzOGZjNjg0ZjQ1NWJhZDY3YzY=
|
@@ -11,8 +11,8 @@ module TurbotRunner
|
|
11
11
|
|
12
12
|
def process(line)
|
13
13
|
begin
|
14
|
-
if line.strip == "RUN ENDED"
|
15
|
-
@record_handler.
|
14
|
+
if line.strip == "SNAPSHOT ENDED" || line.strip == "RUN ENDED" # latter is legacy
|
15
|
+
@record_handler.handle_snapshot_ended
|
16
16
|
@runner.interrupt if @runner
|
17
17
|
else
|
18
18
|
record = Openc::JsonSchema.convert_dates(schema_path, JSON.parse(line))
|
data/spec/lib/runner_spec.rb
CHANGED
@@ -88,8 +88,9 @@ describe TurbotRunner::Runner do
|
|
88
88
|
before do
|
89
89
|
@runner = test_runner('bot-that-emits-run-ended', :log_to_file => true)
|
90
90
|
end
|
91
|
-
|
92
|
-
|
91
|
+
|
92
|
+
it 'calls handle_snapshot_ended on the handler' do
|
93
|
+
expect_any_instance_of(TurbotRunner::BaseHandler).to receive(:handle_snapshot_ended)
|
93
94
|
@runner.run
|
94
95
|
end
|
95
96
|
|
@@ -99,6 +100,21 @@ describe TurbotRunner::Runner do
|
|
99
100
|
end
|
100
101
|
end
|
101
102
|
|
103
|
+
context 'with a bot that outputs SNAPSHOT ENDED' do
|
104
|
+
before do
|
105
|
+
@runner = test_runner('bot-that-emits-snapshot-ended', :log_to_file => true)
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'calls handle_snapshot_ended on the handler' do
|
109
|
+
expect_any_instance_of(TurbotRunner::BaseHandler).to receive(:handle_snapshot_ended)
|
110
|
+
@runner.run
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'interrupts the run' do
|
114
|
+
expect_any_instance_of(TurbotRunner::ScriptRunner).to receive(:interrupt)
|
115
|
+
@runner.run
|
116
|
+
end
|
117
|
+
end
|
102
118
|
|
103
119
|
context 'with a bot that crashes in scraper' do
|
104
120
|
before do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbot-runner-morph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenCorporates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: openc-json_schema
|
@@ -87,6 +87,8 @@ files:
|
|
87
87
|
- spec/bots/bot-that-crashes-in-transformer/transformer2.rb
|
88
88
|
- spec/bots/bot-that-emits-run-ended/manifest.json
|
89
89
|
- spec/bots/bot-that-emits-run-ended/scraper.rb
|
90
|
+
- spec/bots/bot-that-emits-snapshot-ended/manifest.json
|
91
|
+
- spec/bots/bot-that-emits-snapshot-ended/scraper.rb
|
90
92
|
- spec/bots/bot-that-expects-file/manifest.json
|
91
93
|
- spec/bots/bot-that-expects-file/scraper.rb
|
92
94
|
- spec/bots/bot-that-expects-file/something.txt
|
@@ -134,18 +136,19 @@ require_paths:
|
|
134
136
|
- lib
|
135
137
|
required_ruby_version: !ruby/object:Gem::Requirement
|
136
138
|
requirements:
|
137
|
-
- -
|
139
|
+
- - ! '>='
|
138
140
|
- !ruby/object:Gem::Version
|
139
141
|
version: 1.9.2
|
140
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
143
|
requirements:
|
142
|
-
- -
|
144
|
+
- - ! '>='
|
143
145
|
- !ruby/object:Gem::Version
|
144
146
|
version: '0'
|
145
147
|
requirements: []
|
146
148
|
rubyforge_project:
|
147
|
-
rubygems_version: 2.
|
149
|
+
rubygems_version: 2.2.2
|
148
150
|
signing_key:
|
149
151
|
specification_version: 4
|
150
152
|
summary: Utilities for running bots with Turbot
|
151
153
|
test_files: []
|
154
|
+
has_rdoc:
|