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 CHANGED
@@ -1,2 +1,6 @@
1
+ # v0.1.2
2
+ * Fix up queue formatting to prevent error on actor restarts
3
+ * Always dump transmit object if not string type
4
+
1
5
  # v0.1.0
2
6
  * Initial release
data/README.md CHANGED
@@ -19,6 +19,6 @@ end.start!
19
19
  ```
20
20
 
21
21
  # Info
22
- * Carnivore: https://github.com/heavywater/carnivore
23
- * Repository: https://github.com/heavywater/carnivore-sqs
24
- * IRC: Freenode @ #heavywater
22
+ * Carnivore: https://github.com/carnivore-rb/carnivore
23
+ * Repository: https://github.com/carnivore-rb/carnivore-sqs
24
+ * IRC: Freenode @ #carnivore
@@ -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/heavywater/carnivore-sqs'
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'
@@ -34,7 +34,15 @@ module Carnivore
34
34
  end
35
35
 
36
36
  def format_queue(q)
37
- q.include?('.com') ? q : "/#{q.split(':')[-2,2].join('/')}"
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
- @fog.delete_message(queue, m['ReceiptHandle'])
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
@@ -2,6 +2,6 @@ module Carnivore
2
2
  module Sqs
3
3
  class Version < Gem::Version
4
4
  end
5
- VERSION = Version.new('0.1.0')
5
+ VERSION = Version.new('0.1.2')
6
6
  end
7
7
  end
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.0
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: 2013-10-15 00:00:00.000000000 Z
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/heavywater/carnivore-sqs
58
+ homepage: https://github.com/carnivore-rb/carnivore-sqs
59
59
  licenses: []
60
60
  post_install_message:
61
61
  rdoc_options: []