turbot-runner 0.1.0 → 0.1.1

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
- YWYzYWQ4OTMwNGNiMDMxMjJlYzRlMDMyMGNjMmM0ZGNlZjA5MzdiNQ==
4
+ MDY4Njc3YjMyMzJlOGMxYzc0YTdkOTI3MDU0MTdmMGQyOGY2NTkzMA==
5
5
  data.tar.gz: !binary |-
6
- ZTJjZGMxNDlkN2EyMmVjZDJjZWNmZWQ0ZWE5NTJjN2EyYjgxYjRkNQ==
6
+ MDc3NzFkMGZmOTU1MjUyYmU4MWExZTI3ZWI5MTExNmJmMDQ4MjYxZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Yjg3YThjYzk5NTBhMjFjN2Q1MzMxNmY2N2ZhNDhmNDM3MmUxN2ZiYzgwZTM0
10
- ZTM0ZWJmNDA2NDljZDk4YTM0NDlmMjc3ODk3ZjY3NDk3MjZhZTM1ZjJlNzFi
11
- Mzg5ODdkODIwNjU3YjVmNmI3OWQ2YjBjZjZlMmIzNTk1MTZmZDQ=
9
+ YTMwY2ExOTNjZTRlNmU2NTExNDY1MjlhYzQ3YjYyZThkYWY2ODNlODQ5OGYw
10
+ NWQ0NTI0NDcxNGQwMjFhM2MyMDlkYmE0NzRmODhjMTIzZjZkZDVhOGI3ZmE5
11
+ NmFmNjRhYjQ4MmFjMTY5MWIwZDdhZjFlYjEwYTJlZGUyNmEzYmQ=
12
12
  data.tar.gz: !binary |-
13
- NDQ2ZjY4YmE1NTI5NjRiM2U3ZTVlYjhlOTY1NDc2NGJjMGM1ODdhZDAzZjE5
14
- ZWFhZWFmOTIwYTUyNjhjZDNiOWI3ZDliNWU1ODdlZDViZGYzNjZiZGYzMTg3
15
- Y2NkZjE3ODVhYWI4YWQ2NGQzZTI4YTc0NTI3NzA2OGJhMjhiZDM=
13
+ MmZkYzkxMGRlN2NhZTQ4YWE4ZDFiODZjNTliNzRiMGQ0NDUwYzc5ZTRlNTNm
14
+ MzVlYjE1MjEyOTQ3YTY3ODJmNmJjOTk0OWEzNzU1MzYwM2Q5OTdkN2RhZjA4
15
+ NjJjMTAxOTFlZjgyMTdjZTRlMWMzYmM3NDYwNzU3MWJlZDFiM2I=
@@ -1,7 +1,6 @@
1
1
  module TurbotRunner
2
2
  class BaseHandler
3
3
  def handle_valid_record(record, data_type)
4
- true
5
4
  end
6
5
 
7
6
  def handle_invalid_record(record, data_type, line)
@@ -0,0 +1,3 @@
1
+ module TurbotRunner
2
+ class InterruptRun < StandardError; end
3
+ end
@@ -15,8 +15,11 @@ module TurbotRunner
15
15
  errors = validate(record)
16
16
 
17
17
  if errors.empty?
18
- rc = @record_handler.handle_valid_record(record, @data_type)
19
- @runner.interrupt unless rc
18
+ begin
19
+ @record_handler.handle_valid_record(record, @data_type)
20
+ rescue InterruptRun
21
+ @runner.interrupt
22
+ end
20
23
  else
21
24
  @record_handler.handle_invalid_record(record, @data_type, errors)
22
25
  @runner.interrupt_and_mark_as_failed
@@ -1,3 +1,3 @@
1
1
  module TurbotRunner
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
data/lib/turbot_runner.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'turbot_runner/base_handler'
2
+ require 'turbot_runner/exceptions'
2
3
  require 'turbot_runner/processor'
3
4
  require 'turbot_runner/runner'
4
5
  require 'turbot_runner/script_runner'
@@ -139,7 +139,7 @@ describe TurbotRunner::Runner do
139
139
 
140
140
  def handle_valid_record(record, data_type)
141
141
  @count += 1
142
- @count < 5 ? true : false
142
+ raise TurbotRunner::InterruptRun if @count >= 5
143
143
  end
144
144
  end
145
145
 
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenCorporates
@@ -33,6 +33,7 @@ files:
33
33
  - bin/rspec
34
34
  - lib/turbot_runner.rb
35
35
  - lib/turbot_runner/base_handler.rb
36
+ - lib/turbot_runner/exceptions.rb
36
37
  - lib/turbot_runner/prerun.rb
37
38
  - lib/turbot_runner/processor.rb
38
39
  - lib/turbot_runner/runner.rb