minimal_pipeline 0.0.20 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52993f0ef832366e58e6b3eba09cc4e175ebbc7c2b7f18b4a7c7b7f8f707700b
4
- data.tar.gz: 7a016efa52387427093356bb14ee8f7fcde6e647ad6b9a2893a52ac3dbcfcae1
3
+ metadata.gz: e66eb93b7279f55a905bcf93175b4a7e8913365c2c01226a6a4e529536a669aa
4
+ data.tar.gz: 1d0be9124dafe273c01fbbeb402657db2e7e726337cd7ee357512a26813b6c1f
5
5
  SHA512:
6
- metadata.gz: a3fc0c0aeb662dbd25a931331e6b7fd7af6a5e59fa736b1502b4059c3405973502680ce7de89b93086e143a8b1fe9f733e2fb70a441332d8ff60d97824c2b619
7
- data.tar.gz: bb7d53d62c27667e45fa6919137ff478ea6a09c9c8f3d41b782e78ae0a8b2aa1ac196cd3bff164c79b3156b13a27b23e3631d72254834744cb7c398ebca23279
6
+ metadata.gz: bc652c291e35aaca7229c8cb86c5224543af81b340f3773933d52efe2924dd7632d4b4fd6a3053985cab6fec860060057d9a483e8676c97314eda42ac185ee5a
7
+ data.tar.gz: cb304e49d60324e104dc99be3ff68a9f1f3c56033be6f12feaa1139a3f0bdcd55609eddf1214c06feb17cc8ef6aa53a8ce7cdc9bc5fb079f802b03a41218c02c
@@ -17,4 +17,5 @@ class MinimalPipeline
17
17
  autoload(:Lambda, 'minimal_pipeline/lambda')
18
18
  autoload(:Packer, 'minimal_pipeline/packer')
19
19
  autoload(:S3, 'minimal_pipeline/s3')
20
+ autoload(:Sqs, 'minimal_pipeline/sqs')
20
21
  end
@@ -0,0 +1,31 @@
1
+ require 'aws-sdk'
2
+
3
+ class MinimalPipeline
4
+ # Here is an example of how to use this class to send a message onto a queue.
5
+ #
6
+ # ```
7
+ # sqs = MinimalPipeline::Sqs.new
8
+ # message = 'Beep boop'
9
+ # sqs.send_message('queue-name', message)
10
+ # ```
11
+ class Sqs
12
+ def initialize
13
+ raise 'You must set env variable AWS_REGION or region.' \
14
+ if ENV['AWS_REGION'].nil? && ENV['region'].nil?
15
+
16
+ region = ENV['AWS_REGION'] || ENV['region']
17
+ @client = Aws::SQS::Client.new(region: region)
18
+ end
19
+
20
+ # Places a message on a SQS queue
21
+ #
22
+ # @param queue_name [String] The name of the SQS queue
23
+ # @param body [String] The message body to place on the queue
24
+ # @return [Aws::SQS::Types::SendMessageResult] The result object
25
+ def send_message(queue_name, body)
26
+ queue_url = @client.get_queue_url(queue_name: queue_name).queue_url
27
+ @client.send_message(queue_url: queue_url, message_body: body,
28
+ message_group_id: queue_name)
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimal_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mayowa Aladeojebi
@@ -111,6 +111,7 @@ files:
111
111
  - lib/minimal_pipeline/lambda.rb
112
112
  - lib/minimal_pipeline/packer.rb
113
113
  - lib/minimal_pipeline/s3.rb
114
+ - lib/minimal_pipeline/sqs.rb
114
115
  homepage: https://github.com/stelligent/minimal-pipeline-gem
115
116
  licenses:
116
117
  - 0BSD