turbot-runner 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dd39bb61650d5be95618abe1c447f5e1e9f3e6e8
4
- data.tar.gz: d6e827a73dea91e210cb1101ddd3516326212c4c
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTQwMzAzZjBmNTk0ZGNiYzU2NjNjNTExNTA3Y2YzMGZjMTE3MzYzZQ==
5
+ data.tar.gz: !binary |-
6
+ NjdmYTYzN2QzZTk5MjI0OTE4MDFlOWMxNWY0ZGVlZDJmYmM5MzI0OA==
5
7
  SHA512:
6
- metadata.gz: 32b164da9b666b3d89348b45362ab4ac15a70e6cbcb1334c97b4cd2ee175704de0061391e894ff648d286069d11607473d6b8d9b43feb45b29ebbaaa30001e85
7
- data.tar.gz: c24d22527ae8935ddc9e5681412d6cd28c84dbd32c5e9c8fe3e494b5d45b291f2105b56dbdd50b78e69c822f15019707873f9216c8abbe912a4916341c1f2b80
8
+ metadata.gz: !binary |-
9
+ NjgwZDYyNjg4OTkwZTAzYWJkNTI5ZmE4YjkwZWVhNTZkZmEyNTg2NGQ2ZjVm
10
+ NDBjMTcwZWRlOTRjYmJjNmJkZmRmZjFhMmUzNmY0NTZjMGMyNzc5N2VmM2M0
11
+ MDczNjAxYWE1MDFkNjI3MTcxNWYzODA0M2YyN2Y4MTkzMmQxMjM=
12
+ data.tar.gz: !binary |-
13
+ MTg0NTk1Yzg1ZGQ3MWQyZmZlMTRmNDAzYWM5OTg3MDAxYWJhODZhMmE0MGMz
14
+ YWE4ZDhiMDkyYzEwMWEwNDIzMmY3MjliZTIyNjFjM2Q3NGU0MjllYzk0YTQy
15
+ MzE1YTVmZmZhZDc4YjkzNGQ5MTIxMmYyN2NlOTlhMWM4ZDY4ZDE=
@@ -3,6 +3,9 @@ module TurbotRunner
3
3
  def handle_valid_record(record, data_type)
4
4
  end
5
5
 
6
+ def handle_snapshot_ended
7
+ end
8
+
6
9
  def handle_run_ended
7
10
  end
8
11
 
@@ -1,3 +1,3 @@
1
1
  module TurbotRunner
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
@@ -0,0 +1,8 @@
1
+ {
2
+ "bot_id": "bot-that-emits-snapshot-ended",
3
+ "description": "This is a bot that emits SNAPSHOT ENDED",
4
+ "language": "ruby",
5
+ "data_type": "primary data",
6
+ "identifying_fields": ["licence_number"],
7
+ "files": ["scraper.rb"]
8
+ }
@@ -0,0 +1,11 @@
1
+ require 'json'
2
+
3
+ 0.upto(2) do |n|
4
+ record = {
5
+ :licence_number => "XYZ#{n}",
6
+ :source_url => 'http://example.com',
7
+ :sample_date => '2014-06-01'
8
+ }
9
+ puts(record.to_json)
10
+ end
11
+ puts "SNAPSHOT ENDED"
@@ -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
- it 'calls handle_run_ended on the handler' do
92
- expect_any_instance_of(TurbotRunner::BaseHandler).to receive(:handle_run_ended)
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
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.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-21 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -101,6 +101,8 @@ files:
101
101
  - spec/bots/bot-that-crashes-in-transformer/transformer2.rb
102
102
  - spec/bots/bot-that-emits-run-ended/manifest.json
103
103
  - spec/bots/bot-that-emits-run-ended/scraper.rb
104
+ - spec/bots/bot-that-emits-snapshot-ended/manifest.json
105
+ - spec/bots/bot-that-emits-snapshot-ended/scraper.rb
104
106
  - spec/bots/bot-that-expects-file/manifest.json
105
107
  - spec/bots/bot-that-expects-file/scraper.rb
106
108
  - spec/bots/bot-that-expects-file/something.txt
@@ -152,18 +154,19 @@ require_paths:
152
154
  - lib
153
155
  required_ruby_version: !ruby/object:Gem::Requirement
154
156
  requirements:
155
- - - ">="
157
+ - - ! '>='
156
158
  - !ruby/object:Gem::Version
157
159
  version: 1.9.2
158
160
  required_rubygems_version: !ruby/object:Gem::Requirement
159
161
  requirements:
160
- - - ">="
162
+ - - ! '>='
161
163
  - !ruby/object:Gem::Version
162
164
  version: '0'
163
165
  requirements: []
164
166
  rubyforge_project:
165
- rubygems_version: 2.4.5
167
+ rubygems_version: 2.2.2
166
168
  signing_key:
167
169
  specification_version: 4
168
170
  summary: Utilities for running bots with Turbot
169
171
  test_files: []
172
+ has_rdoc: