turbot-runner 0.1.31 → 0.1.32
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.
- checksums.yaml +8 -8
- data/lib/turbot_runner.rb +10 -1
- data/lib/turbot_runner/exceptions.rb +1 -0
- data/lib/turbot_runner/version.rb +1 -1
- data/spec/bots/bot-with-invalid-data-type/manifest.json +8 -0
- data/spec/bots/bot-with-invalid-data-type/scraper.rb +10 -0
- data/spec/lib/runner_spec.rb +10 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTUyZjJjODU0Mzg5ODhmOGMxZGFhYjc0ZjRmM2RkYTZmOTUzOTlkZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzcyOTU0NmFmZGU3NGZiNmUyZmRhZGE5YjA2YWU5Y2UwOTI5OWI3OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2E3NmRlYjk4MjE0NGQzYmIxOWUxODcwODI1OWU5NDEzNjNhM2UyZWUyYjEy
|
10
|
+
ZTgxY2IzZjEzZmU1YmFjMWNjMjU3NGI4YmIwZGZlOTM5NWVhMzI2NzViOTUz
|
11
|
+
NGRhNDdiZWM2NDQ2NjIwMDcxNGM1MjI1OGNmMDgxYjYyNjdjMTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTM1ZDEyODdlNTkwMmIzNGEwZTE4NWViMTg1MmVhYzRjYWFkMDlmY2U3Mjgx
|
14
|
+
Njg3ODdjNTQzYTgyMDg2ZjBlZWMyNThiZjg1ODdjYmU2ZDhlZmY1NTkzYmY4
|
15
|
+
NWI5MjQ3YTZiNGNjYTdiMjJmOWViMmQyMGVkNWM2ZTFjOTg4M2Q=
|
data/lib/turbot_runner.rb
CHANGED
@@ -11,7 +11,16 @@ module TurbotRunner
|
|
11
11
|
SCHEMAS_PATH = File.expand_path('../../schema/schemas', __FILE__)
|
12
12
|
|
13
13
|
def self.schema_path(data_type)
|
14
|
+
@schema_paths ||= Hash.new do |h, k|
|
15
|
+
h[k] = get_and_validate_schema_path(k)
|
16
|
+
end
|
17
|
+
@schema_paths[data_type]
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.get_and_validate_schema_path(data_type)
|
14
21
|
hyphenated_name = data_type.to_s.gsub("_", "-").gsub(" ", "-")
|
15
|
-
File.join(SCHEMAS_PATH, "#{hyphenated_name}-schema.json")
|
22
|
+
path = File.join(SCHEMAS_PATH, "#{hyphenated_name}-schema.json")
|
23
|
+
raise TurbotRunner::InvalidDataType unless File.exists?(path)
|
24
|
+
path
|
16
25
|
end
|
17
26
|
end
|
data/spec/lib/runner_spec.rb
CHANGED
@@ -226,6 +226,16 @@ describe TurbotRunner::Runner do
|
|
226
226
|
expect(@runner.run).to be(false)
|
227
227
|
end
|
228
228
|
end
|
229
|
+
|
230
|
+
context 'with a bot with an invalid data type' do
|
231
|
+
before do
|
232
|
+
@runner = test_runner('bot-with-invalid-data-type')
|
233
|
+
end
|
234
|
+
|
235
|
+
it 'raises InvalidDataType' do
|
236
|
+
expect{@runner.run}.to raise_error(TurbotRunner::InvalidDataType)
|
237
|
+
end
|
238
|
+
end
|
229
239
|
end
|
230
240
|
|
231
241
|
describe '#process_output' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbot-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenCorporates
|
@@ -86,6 +86,8 @@ files:
|
|
86
86
|
- spec/bots/bot-that-expects-file/manifest.json
|
87
87
|
- spec/bots/bot-that-expects-file/scraper.rb
|
88
88
|
- spec/bots/bot-that-expects-file/something.txt
|
89
|
+
- spec/bots/bot-with-invalid-data-type/manifest.json
|
90
|
+
- spec/bots/bot-with-invalid-data-type/scraper.rb
|
89
91
|
- spec/bots/bot-with-invalid-sample-date/manifest.json
|
90
92
|
- spec/bots/bot-with-invalid-sample-date/scraper.rb
|
91
93
|
- spec/bots/bot-with-pause/manifest.json
|