ruby-sfn-local 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sfn/mock_macros/sqs.rb +25 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f097b2ef985d1e4b6d146c9a094a2ae650dc2bbb13e7b36588a476308db867c
|
4
|
+
data.tar.gz: ee9fe4880d8244b63aecec10b02fafef4572af6ddae3aab3e2f2cf8f8fd70351
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cffa8c52d646735bf6a4f396d0cbefb419f501e44ca936a531e47228fea6fc254d5239a0ec67d9606df99ce83d2aca768ef64439356f43061ed6d447a7fc944c
|
7
|
+
data.tar.gz: 4ed79cecd663ab17da02784f68478d15bf0544dda0cb7cc3fe275d3f262d69027367b5742f5b484b2aa44f245baa6c1a452ee6b5ebb8bfa2b0790b103d2ada84
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sfn
|
4
|
+
module MockMacros
|
5
|
+
module Sqs
|
6
|
+
def self.response(data)
|
7
|
+
data = [data] if data.is_a?(Hash)
|
8
|
+
data.map! do |val|
|
9
|
+
if val.key?(:error)
|
10
|
+
{ Throw: { Error: val[:error], Cause: val[:cause] } }
|
11
|
+
else
|
12
|
+
val[:uuid] ||= SecureRandom.uuid
|
13
|
+
val[:sequence] ||= 10_000_000_000_000_003_000
|
14
|
+
{ Return: { MessageId: val[:uuid], SequenceNumber: val[:sequence] } }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
out = {}
|
18
|
+
data.each_with_index do |val, idx|
|
19
|
+
out[idx.to_s] = val
|
20
|
+
end
|
21
|
+
out
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-sfn-local
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gianni Mazza
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/sfn/mock_macros/api_gateway.rb
|
70
70
|
- lib/sfn/mock_macros/lambda.rb
|
71
71
|
- lib/sfn/mock_macros/sns.rb
|
72
|
+
- lib/sfn/mock_macros/sqs.rb
|
72
73
|
- lib/sfn/mock_macros/step_function.rb
|
73
74
|
- lib/sfn/state_machine.rb
|
74
75
|
- lib/string.rb
|