simplerubysteps 0.0.12 → 0.0.13

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
  SHA256:
3
- metadata.gz: 8df78b6ac515f9ff4206dbe05fc17ff6d830747f9efc2c633a9713a8e7ba31a6
4
- data.tar.gz: b874f48551b72e1f49e60073cd0ef98c1e58776fcd505272c56852603f8a02cd
3
+ metadata.gz: b4634df51423d09b913d7580a4c2827a4a5a052ffaa5784df7bde18b1e61a729
4
+ data.tar.gz: 9410dcd916fb7ef55cb6be079c71f0f9f2db9d60d0a3c11984eac9b27213c01d
5
5
  SHA512:
6
- metadata.gz: 740575bc2919cfe719e0bf7c17b1861b28923732735bf81285f1e367114052299ebb02ecce73acb02106ac1636a6fca1ef18d3675af40cd34d62c279479570e6
7
- data.tar.gz: d9c6afe7bd5d7d7f0f6647b618b6b1ca6552308aa83f66f2c34f3b695f1579cfb98b35ebe55a24100917bbeaa15b61627cd6d930a9c688173bef89ed636aa5e2
6
+ metadata.gz: 05c5515b4308c4697760ceb7b2f64e998ae97f97f46898696dda3a6bb7cc6ae4f29c9552ccb9e217fde5f3f35a424ad768f179c76722c160d28116fa47b96dbf
7
+ data.tar.gz: d530940f3ba655761ff90586f1ccccb126279966211fea319b7dcbd0730b017dd17c22556d3f08e0ba6735fa8e545d1b527935d963a189a6f4ac88e5ef5f102b
@@ -90,11 +90,15 @@ module Simplerubysteps
90
90
  $tasks.last.next = state
91
91
  end
92
92
 
93
- def error_retry(interval, max, backoff)
93
+ def error_retry(interval, max, backoff, error = "States.ALL")
94
94
  $tasks.last.error_retry(interval, max, backoff)
95
95
  end
96
96
 
97
- def error_catch(state)
97
+ def task_timeout(secs, state = nil)
98
+ $tasks.last.task_timeout secs, state
99
+ end
100
+
101
+ def error_catch(state, error = "States.ALL")
98
102
  $tasks.last.error_catch state
99
103
  end
100
104
 
@@ -94,6 +94,43 @@ module Simplerubysteps
94
94
  dict[:End] = true unless dict[:Next]
95
95
  dict
96
96
  end
97
+
98
+ def error_retry(interval, max, backoff, error = "States.ALL") # FIXME move to new baseclass for Task and Callback
99
+ data = {
100
+ :ErrorEquals => [error],
101
+ :IntervalSeconds => interval,
102
+ :BackoffRate => backoff,
103
+ :MaxAttempts => max,
104
+ }
105
+
106
+ unless @dict[:Retry]
107
+ @dict[:Retry] = [data]
108
+ else
109
+ @dict[:Retry].push data
110
+ end
111
+ end
112
+
113
+ def task_timeout(secs, state = nil) # FIXME move to new baseclass for Task and Callback
114
+ @dict[:TimeoutSeconds] = secs
115
+
116
+ if state
117
+ error_catch state, "States.Timeout"
118
+ end
119
+ end
120
+
121
+ def error_catch(state, error = "States.ALL") # FIXME move to new baseclass for Task and Callback
122
+ data = {
123
+ :ErrorEquals => [error],
124
+ :Next => (state.is_a? Symbol) ? state : state.name,
125
+ :ResultPath => "$.error",
126
+ }
127
+
128
+ unless @dict[:Catch]
129
+ @dict[:Catch] = [data]
130
+ else
131
+ @dict[:Catch].push data
132
+ end
133
+ end
97
134
  end
98
135
 
99
136
  class Parallel < State
@@ -167,27 +204,6 @@ module Simplerubysteps
167
204
  }
168
205
  end
169
206
 
170
- def error_retry(interval, max, backoff)
171
- @dict[:Retry] = [
172
- {
173
- :ErrorEquals => ["States.ALL"],
174
- :IntervalSeconds => interval,
175
- :BackoffRate => backoff,
176
- :MaxAttempts => max,
177
- },
178
- ]
179
- end
180
-
181
- def error_catch(state)
182
- @dict[:Catch] = [
183
- {
184
- :ErrorEquals => ["States.ALL"],
185
- :Next => (state.is_a? Symbol) ? state : state.name,
186
- :ResultPath => "$.error",
187
- },
188
- ]
189
- end
190
-
191
207
  def action(&action_block)
192
208
  @action_block = action_block
193
209
  end
@@ -589,6 +589,7 @@ module Simplerubysteps
589
589
  opts.separator " destroy Delete Step Functions State Machine"
590
590
  opts.separator " log Continuously prints Lambda function log output"
591
591
  opts.separator " start Start State Machine execution"
592
+ opts.separator " stack Display stack infos"
592
593
  opts.separator " task-success Continue Start State Machine execution"
593
594
  opts.separator ""
594
595
 
@@ -1,3 +1,3 @@
1
1
  module Simplerubysteps
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplerubysteps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Tschenett