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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sfn/mock_macros/sqs.rb +25 -0
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84a623fc6db39626f2c4562e6f6613827428629409425c18864ceca3f88c954d
4
- data.tar.gz: 9077be558acade75591926166e04e2428f9225c11dd897206124697b9a4e6c4e
3
+ metadata.gz: 5f097b2ef985d1e4b6d146c9a094a2ae650dc2bbb13e7b36588a476308db867c
4
+ data.tar.gz: ee9fe4880d8244b63aecec10b02fafef4572af6ddae3aab3e2f2cf8f8fd70351
5
5
  SHA512:
6
- metadata.gz: c61caf572c5957664eaed371552f438780bf6354962a1aff13aa1355acd06e73ebbfbeeb171dbe63f208934d493d36e4a4be8736c7b07bea2cf611759c2d3ced
7
- data.tar.gz: edb7519af4ee46230ed1e578358fe97f4430dd07491cd05897549de628f9aab43a5b8ebef95521aae1c68e2f7f293913b408908057e100687a777bc75a555302
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.10
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