opener-callback-handler 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 655ab9d8c146fc45a37585a22d07b4302288b0f9
|
4
|
+
data.tar.gz: 4bb1d96b74f4005c239d66028ddbed274d0ee878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63d3055bed9d31b32bef298bb707984a1b32a955f5c50466a5ba221558042bccfcbb3a39c1deef69f5bbad0b161e9d00c7f00518da6dd764937073f9566ba28b
|
7
|
+
data.tar.gz: 811a710dae0e96546edf862627ae8c37284396a3632845bcce8e5c85bf2dfbbcaeb074050edff6faf26c7d987defdfd5fc96016e30e26a57b3b7452d333ed3f0
|
@@ -10,7 +10,7 @@ module Opener
|
|
10
10
|
# Here `<name>` is the name of the queue to use.
|
11
11
|
#
|
12
12
|
# @!attribute [r] sqs
|
13
|
-
# @return [
|
13
|
+
# @return [Aws::SQS::Client]
|
14
14
|
#
|
15
15
|
class AmazonSqs
|
16
16
|
attr_reader :sqs
|
@@ -24,35 +24,32 @@ module Opener
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def initialize
|
27
|
-
@sqs =
|
27
|
+
@sqs = Aws::SQS::Client.new
|
28
28
|
end
|
29
29
|
|
30
|
-
##
|
31
30
|
# @param [String] uri The queue URI
|
32
31
|
# @param [Hash] params The message to submit.
|
33
|
-
#
|
34
32
|
def process(uri, params = {})
|
35
|
-
|
33
|
+
queue_url = queue_url_for_uri(uri)
|
36
34
|
|
37
|
-
|
35
|
+
sqs.send_message(
|
36
|
+
:queue_url => queue_url,
|
37
|
+
:message_body => JSON.dump(params)
|
38
|
+
)
|
38
39
|
end
|
39
40
|
|
40
|
-
##
|
41
41
|
# @param [String] uri
|
42
|
-
# @return [
|
43
|
-
|
44
|
-
def queue_for_uri(uri)
|
42
|
+
# @return [String]
|
43
|
+
def queue_url_for_uri(uri)
|
45
44
|
parsed = Addressable::URI.parse(uri)
|
46
45
|
|
47
|
-
return
|
46
|
+
return queue_url_for_name(parsed.host)
|
48
47
|
end
|
49
48
|
|
50
|
-
##
|
51
49
|
# @param [String] name
|
52
|
-
# @return [
|
53
|
-
|
54
|
-
|
55
|
-
return sqs.queues.named(name)
|
50
|
+
# @return [String]
|
51
|
+
def queue_url_for_name(name)
|
52
|
+
sqs.get_queue_url(:queue_name => name).queue_url
|
56
53
|
end
|
57
54
|
end # AmazonSqs
|
58
55
|
end # Strategies
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opener-callback-handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- development@olery.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httpclient
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.4.8
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: Tool for handling different callback URLs based on their protocol.
|