clomp 0.0.10 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e80866684e8ed7bfb98c419cf2602810e5e35a01
4
- data.tar.gz: a4b8f6d72954c4038e53850814c2275933630b0d
3
+ metadata.gz: 3f3b495be69cf45ef6f945664149599b3966e937
4
+ data.tar.gz: 42249a2784393668c08a4874d0d9b8eb26968bc4
5
5
  SHA512:
6
- metadata.gz: e4d7a41991a09f099ffc616c2185ffd7329e42f3b229a6af06ec6b1889a25bd9ac72cf9a5d974a5943e8a652bc018b16a29b15b91401dc66c41951b614cc5cf3
7
- data.tar.gz: 866453fb2cd08d139bbd06bb7efee5703d66046476cb1355c18b2ed780e6afda91c9bda0be39cdcc0f748ae61886fd38774ec294d2a223708f44495cb46a1b05
6
+ metadata.gz: ecf15b609fa0cf5f0fcb081954ca0610d544525270b04cec6ebe43f1b8bc44062c0e4ae3ba0735dad4ba2a982ea159148e722de807ae61dc76e3b7bf077f4a4a
7
+ data.tar.gz: '084ec7df8cb9c8ab2c922a33a3d8648d4f6681d3f1ff1e5eebe9a8c193684545074cd5363c0ec4904864ba18d5e216dfdf803e7e5935c42fc8ca7a37ed98a4fd'
@@ -1,4 +1,5 @@
1
1
  require 'pp'
2
+ require 'securerandom'
2
3
 
3
4
  module Clomp
4
5
  class Executor
@@ -7,10 +8,11 @@ module Clomp
7
8
  #
8
9
  def [](result = {}, options, _self:)
9
10
  result['tracks'].each_with_index do |track, i|
11
+
12
+ break if break?(result['tracks'], i)
13
+
10
14
  next if _self.successful? && track.left_track?
11
15
  next if _self.failed? && track.right_track?
12
- break if i > 0 && result['tracks'][i -1].track_options[:fail_fast]
13
- break if i > 0 && result['tracks'][i -1].track_options[:pass_fast]
14
16
 
15
17
  _callable_object = Callable[track, options, _self]
16
18
 
@@ -21,6 +23,18 @@ module Clomp
21
23
 
22
24
  _self
23
25
  end
26
+
27
+ def break?(tracks, index)
28
+ track = index > 0 && tracks[index -1] || Track.new(name: SecureRandom.hex(5)).tap {|track| track.mark_as_success! && track.executed = true }
29
+
30
+ if track.right_track? && track.failure?
31
+ return true if track.track_options[:fail_fast]
32
+ elsif track.left_track?
33
+ return true if track.track_options[:fail_fast]
34
+ end
35
+
36
+ true if track.track_options[:pass_fast]
37
+ end
24
38
  end
25
39
  end
26
40
  end
data/lib/clomp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Clomp
2
- VERSION = '0.0.10'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clomp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Irfan Ahmed
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler