turbot-runner 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmI4MTEyZmVjYzM1OTk1YzBhZDgxOWVlMmRhMDdkZTBmYTEwMGQ1Mg==
4
+ MDM3YjY4NDc1NGU5YTZjN2EzYWYzNWMxZGQwYjVmN2M3Mzk5NDRlMQ==
5
5
  data.tar.gz: !binary |-
6
- NGQ1NmJiM2JjZjgwYzAyNGJiZGRjOGM1YmUyODExMjllYzVkZGIxYg==
6
+ NTA0MDhmNzA0MzI3ZWQ2M2MzZmU3ZGFhY2Y0NTRiNzZhZDdhNTZhMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmRkZjAwNzNlYzQ1NWZhODMzNjJmMjdjMjUwYjYyNDNlNjI0OTNmZDhiODMy
10
- NWY4ZDIyMmY1ZGM2NGI3MDBlZmRhNGE4NzA2YTU5ZGM3OWNmMTI2OGY4ZTky
11
- YzI3YTkyNTI5NmRhNjNjNTdmNDExMGJjYWIxNThhOTQ1MzIwZmQ=
9
+ NWY1ZGNkMjdmM2YxZTE2MDcyNGY4NWI2NjE4N2Y2ZDkwMjY3MDAyYWI2Yzdk
10
+ ZDliNDlmNjU0YWU4YzBlMWU2Yjk1NzJjZmQ1ZjQyMzI2ZTU5N2U5NGI5YjQ4
11
+ ZjEzY2ZkOThiNjQ5ZDQxZjBiNmI5MWZmM2RmMDEyOTFjY2YxODU=
12
12
  data.tar.gz: !binary |-
13
- Y2ZlNGU3YzBhNzU4NjdmNjZmNGM4ZmIyZWFiYzAyMjI5MWVjYjdmOTEyZDA5
14
- MmI4MWE1MTQzZTE0YmE0OWEwYmRlNzAxOTUxNzM4YTJiOGM4OTFiY2VkZWMx
15
- YjJmM2QyYTQ1ZWUxMDJmMGZiNTAyNDYzNTcwM2U1NDY0YTUyNDU=
13
+ YjlkODU1MGUxYzBlZGFhYWYwMGRiMmM1YjhlOWYwZDhiZDFmZDFjMzUwMjc0
14
+ NDhmOTFlNDJiNzNhY2NkYmEzODkwZmY5ZTBjYmY5OTlhZDNiY2FkZDAxZWQ0
15
+ ODlkZmNmN2VjMmVkNWRmMDA5NjU2YjBiMDk5OTA2NDcyZjU4ZmY=
@@ -1,3 +1,3 @@
1
1
  module TurbotRunner
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
data/lib/turbot_runner.rb CHANGED
@@ -20,11 +20,13 @@ module TurbotRunner
20
20
  raise "Could not parse #{manifest_path} as JSON"
21
21
  end
22
22
 
23
+ @status = :initialized
23
24
  @interrupted = false
24
25
  @schemas = {}
25
26
  end
26
27
 
27
28
  def run(opts={})
29
+ @status = :running
28
30
  validation_required = opts[:validate] || true
29
31
 
30
32
  command = "#{interpreter_for(scraper_file)} #{scraper_file}"
@@ -70,19 +72,27 @@ module TurbotRunner
70
72
  end
71
73
 
72
74
  if @interrupted
75
+ @status = :interrupted
73
76
  handle_interrupted_run
74
77
  else
78
+ @status = :successful
75
79
  handle_successful_run
76
80
  end
77
81
  rescue ScriptError => e
78
82
  if @interrupted
83
+ @status = :interrupted
79
84
  handle_interrupted_run
80
85
  else
86
+ @status = :failed
81
87
  handle_failed_run
82
88
  end
83
89
  end
84
90
  end
85
91
 
92
+ def successful?
93
+ status == :successful
94
+ end
95
+
86
96
  def interrupt
87
97
  @interrupted = true
88
98
  end
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.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenCorporates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-05 00:00:00.000000000 Z
11
+ date: 2014-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema