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 +4 -4
- data/lib/minimal_pipeline.rb +1 -0
- data/lib/minimal_pipeline/sqs.rb +31 -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: e66eb93b7279f55a905bcf93175b4a7e8913365c2c01226a6a4e529536a669aa
|
4
|
+
data.tar.gz: 1d0be9124dafe273c01fbbeb402657db2e7e726337cd7ee357512a26813b6c1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc652c291e35aaca7229c8cb86c5224543af81b340f3773933d52efe2924dd7632d4b4fd6a3053985cab6fec860060057d9a483e8676c97314eda42ac185ee5a
|
7
|
+
data.tar.gz: cb304e49d60324e104dc99be3ff68a9f1f3c56033be6f12feaa1139a3f0bdcd55609eddf1214c06feb17cc8ef6aa53a8ce7cdc9bc5fb079f802b03a41218c02c
|
data/lib/minimal_pipeline.rb
CHANGED
@@ -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.
|
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
|