simplerubysteps 0.0.11 → 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: 8119ab1363f5d1ad540c1e7f0b7219259de98ed4a57c81c34e72b67c7f44d204
4
- data.tar.gz: ac34f56db5fd0e16339434e3a54b11b34f00701cbd659aab8226138d34242412
3
+ metadata.gz: b4634df51423d09b913d7580a4c2827a4a5a052ffaa5784df7bde18b1e61a729
4
+ data.tar.gz: 9410dcd916fb7ef55cb6be079c71f0f9f2db9d60d0a3c11984eac9b27213c01d
5
5
  SHA512:
6
- metadata.gz: cbb17200e59338024a5fb2ceef8e91e1bf07d15135dcd62d309965d5996c180b75a93352097030f49d58f57491c6bd281f37a0db6dac4d014976896c7e0ce485
7
- data.tar.gz: 16ec5a0b65c23e8623588bc1aec389038f54f54ce126e7cac22fd9f6779a9ef1936d2e27a0359e0ff9ef062006a8f3af2a55e4573da5a67583f1ad481b3db25b
6
+ metadata.gz: 05c5515b4308c4697760ceb7b2f64e998ae97f97f46898696dda3a6bb7cc6ae4f29c9552ccb9e217fde5f3f35a424ad768f179c76722c160d28116fa47b96dbf
7
+ data.tar.gz: d530940f3ba655761ff90586f1ccccb126279966211fea319b7dcbd0730b017dd17c22556d3f08e0ba6735fa8e545d1b527935d963a189a6f4ac88e5ef5f102b
@@ -90,6 +90,18 @@ module Simplerubysteps
90
90
  $tasks.last.next = state
91
91
  end
92
92
 
93
+ def error_retry(interval, max, backoff, error = "States.ALL")
94
+ $tasks.last.error_retry(interval, max, backoff)
95
+ end
96
+
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")
102
+ $tasks.last.error_catch state
103
+ end
104
+
93
105
  def transition_to(state, &condition_block)
94
106
  choice = $tasks.last.implicit_choice
95
107
 
@@ -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
@@ -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.11"
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.11
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Tschenett