carnivore-sqs 0.1.0 → 0.1.2
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.
- data/CHANGELOG.md +4 -0
- data/README.md +3 -3
- data/carnivore-sqs.gemspec +1 -1
- data/lib/carnivore-sqs/sqs.rb +15 -2
- data/lib/carnivore-sqs/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -19,6 +19,6 @@ end.start!
|
|
19
19
|
```
|
20
20
|
|
21
21
|
# Info
|
22
|
-
* Carnivore: https://github.com/
|
23
|
-
* Repository: https://github.com/
|
24
|
-
* IRC: Freenode @ #
|
22
|
+
* Carnivore: https://github.com/carnivore-rb/carnivore
|
23
|
+
* Repository: https://github.com/carnivore-rb/carnivore-sqs
|
24
|
+
* IRC: Freenode @ #carnivore
|
data/carnivore-sqs.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.summary = 'Message processing helper'
|
7
7
|
s.author = 'Chris Roberts'
|
8
8
|
s.email = 'chrisroberts.code@gmail.com'
|
9
|
-
s.homepage = 'https://github.com/
|
9
|
+
s.homepage = 'https://github.com/carnivore-rb/carnivore-sqs'
|
10
10
|
s.description = 'Carnivore SQS source'
|
11
11
|
s.require_path = 'lib'
|
12
12
|
s.add_dependency 'carnivore', '>= 0.1.8'
|
data/lib/carnivore-sqs/sqs.rb
CHANGED
@@ -34,7 +34,15 @@ module Carnivore
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def format_queue(q)
|
37
|
-
q.include?('.com')
|
37
|
+
unless(q.include?('.com'))
|
38
|
+
if((parts = q.split(':')).size > 1)
|
39
|
+
"/#{parts[-2,2].join('/')}"
|
40
|
+
else
|
41
|
+
q
|
42
|
+
end
|
43
|
+
else
|
44
|
+
q
|
45
|
+
end
|
38
46
|
end
|
39
47
|
|
40
48
|
def connect
|
@@ -71,6 +79,7 @@ module Carnivore
|
|
71
79
|
|
72
80
|
def transmit(message, original=nil)
|
73
81
|
queue = determine_queue(original)
|
82
|
+
message = JSON.dump(message) unless message.is_a?(String)
|
74
83
|
@fog.send_message(queue, message)
|
75
84
|
end
|
76
85
|
|
@@ -78,7 +87,11 @@ module Carnivore
|
|
78
87
|
queue = determine_queue(message)
|
79
88
|
debug "Source<#{name}> Confirming message<#{message}> on Queue<#{queue}>"
|
80
89
|
m = message.is_a?(Message) ? message[:message] : message
|
81
|
-
|
90
|
+
if(m['ReceiptHandle'])
|
91
|
+
@fog.delete_message(queue, m['ReceiptHandle'])
|
92
|
+
else
|
93
|
+
debug "Message contained no receipt handle. Likely a looper #{message}"
|
94
|
+
end
|
82
95
|
end
|
83
96
|
|
84
97
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carnivore-sqs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: carnivore
|
@@ -55,7 +55,7 @@ files:
|
|
55
55
|
- carnivore-sqs.gemspec
|
56
56
|
- README.md
|
57
57
|
- CHANGELOG.md
|
58
|
-
homepage: https://github.com/
|
58
|
+
homepage: https://github.com/carnivore-rb/carnivore-sqs
|
59
59
|
licenses: []
|
60
60
|
post_install_message:
|
61
61
|
rdoc_options: []
|