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 +4 -4
- data/lib/simplerubysteps/dsl.rb +6 -2
- data/lib/simplerubysteps/model.rb +37 -21
- data/lib/simplerubysteps/tool.rb +1 -0
- data/lib/simplerubysteps/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4634df51423d09b913d7580a4c2827a4a5a052ffaa5784df7bde18b1e61a729
|
4
|
+
data.tar.gz: 9410dcd916fb7ef55cb6be079c71f0f9f2db9d60d0a3c11984eac9b27213c01d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05c5515b4308c4697760ceb7b2f64e998ae97f97f46898696dda3a6bb7cc6ae4f29c9552ccb9e217fde5f3f35a424ad768f179c76722c160d28116fa47b96dbf
|
7
|
+
data.tar.gz: d530940f3ba655761ff90586f1ccccb126279966211fea319b7dcbd0730b017dd17c22556d3f08e0ba6735fa8e545d1b527935d963a189a6f4ac88e5ef5f102b
|
data/lib/simplerubysteps/dsl.rb
CHANGED
@@ -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
|
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
|
data/lib/simplerubysteps/tool.rb
CHANGED
@@ -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
|
|