turbot-runner 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 +15 -0
- data/lib/turbot_runner/version.rb +1 -1
- data/lib/turbot_runner.rb +17 -2
- metadata +10 -13
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MmI4MTEyZmVjYzM1OTk1YzBhZDgxOWVlMmRhMDdkZTBmYTEwMGQ1Mg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NGQ1NmJiM2JjZjgwYzAyNGJiZGRjOGM1YmUyODExMjllYzVkZGIxYg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZmRkZjAwNzNlYzQ1NWZhODMzNjJmMjdjMjUwYjYyNDNlNjI0OTNmZDhiODMy
|
10
|
+
NWY4ZDIyMmY1ZGM2NGI3MDBlZmRhNGE4NzA2YTU5ZGM3OWNmMTI2OGY4ZTky
|
11
|
+
YzI3YTkyNTI5NmRhNjNjNTdmNDExMGJjYWIxNThhOTQ1MzIwZmQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Y2ZlNGU3YzBhNzU4NjdmNjZmNGM4ZmIyZWFiYzAyMjI5MWVjYjdmOTEyZDA5
|
14
|
+
MmI4MWE1MTQzZTE0YmE0OWEwYmRlNzAxOTUxNzM4YTJiOGM4OTFiY2VkZWMx
|
15
|
+
YjJmM2QyYTQ1ZWUxMDJmMGZiNTAyNDYzNTcwM2U1NDY0YTUyNDU=
|
data/lib/turbot_runner.rb
CHANGED
@@ -31,7 +31,13 @@ module TurbotRunner
|
|
31
31
|
data_type = @config['data_type']
|
32
32
|
begin
|
33
33
|
run_script_each_line(command) do |line|
|
34
|
-
|
34
|
+
begin
|
35
|
+
record = JSON.parse(line)
|
36
|
+
rescue JSON::ParserError
|
37
|
+
handle_non_json_output(line)
|
38
|
+
next
|
39
|
+
end
|
40
|
+
|
35
41
|
errors = validate(record, data_type)
|
36
42
|
if errors.empty?
|
37
43
|
handle_valid_record(record, data_type)
|
@@ -42,7 +48,12 @@ module TurbotRunner
|
|
42
48
|
data_type1 = transformer['data_type']
|
43
49
|
|
44
50
|
run_script_each_line(command1, :input => line) do |line1|
|
45
|
-
|
51
|
+
begin
|
52
|
+
record1 = JSON.parse(line1)
|
53
|
+
rescue JSON::ParserError
|
54
|
+
handle_non_json_output(line1)
|
55
|
+
next
|
56
|
+
end
|
46
57
|
|
47
58
|
errors = validate(record1, data_type1)
|
48
59
|
|
@@ -111,6 +122,10 @@ module TurbotRunner
|
|
111
122
|
raise NotImplementedError
|
112
123
|
end
|
113
124
|
|
125
|
+
def handle_non_json_output(line)
|
126
|
+
raise NotImplementedError
|
127
|
+
end
|
128
|
+
|
114
129
|
def handle_successful_run
|
115
130
|
end
|
116
131
|
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbot-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- OpenCorporates
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: json-schema
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - '='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - '='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -37,10 +34,6 @@ files:
|
|
37
34
|
- lib/prerun.rb
|
38
35
|
- lib/turbot_runner.rb
|
39
36
|
- lib/turbot_runner/version.rb
|
40
|
-
- spec/dummy-bot/manifest.json
|
41
|
-
- spec/dummy-bot/scraper.rb
|
42
|
-
- spec/dummy-bot/transformer.rb
|
43
|
-
- spec/turbot_runner_spec.rb
|
44
37
|
- schema/schemas/company-schema.json
|
45
38
|
- schema/schemas/includes/address.json
|
46
39
|
- schema/schemas/includes/base-statement.json
|
@@ -58,29 +51,33 @@ files:
|
|
58
51
|
- schema/schemas/share-parcel-schema.json
|
59
52
|
- schema/schemas/simple-licence-schema.json
|
60
53
|
- schema/schemas/subsidiary-relationship-schema.json
|
54
|
+
- spec/dummy-bot/manifest.json
|
55
|
+
- spec/dummy-bot/scraper.rb
|
56
|
+
- spec/dummy-bot/transformer.rb
|
57
|
+
- spec/turbot_runner_spec.rb
|
61
58
|
homepage: http://turbot.opencorporates.com/
|
62
59
|
licenses:
|
63
60
|
- MIT
|
61
|
+
metadata: {}
|
64
62
|
post_install_message:
|
65
63
|
rdoc_options: []
|
66
64
|
require_paths:
|
67
65
|
- lib
|
68
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
-
none: false
|
70
67
|
requirements:
|
71
68
|
- - ! '>='
|
72
69
|
- !ruby/object:Gem::Version
|
73
70
|
version: 1.9.2
|
74
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
72
|
requirements:
|
77
73
|
- - ! '>='
|
78
74
|
- !ruby/object:Gem::Version
|
79
75
|
version: '0'
|
80
76
|
requirements: []
|
81
77
|
rubyforge_project:
|
82
|
-
rubygems_version:
|
78
|
+
rubygems_version: 2.2.2
|
83
79
|
signing_key:
|
84
|
-
specification_version:
|
80
|
+
specification_version: 4
|
85
81
|
summary: Utilities for running bots with Turbot
|
86
82
|
test_files: []
|
83
|
+
has_rdoc:
|