carnivore-http 0.2.4 → 0.2.6
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/CHANGELOG.md +5 -0
- data/lib/carnivore-http/http_source.rb +13 -4
- data/lib/carnivore-http/retry_delivery.rb +10 -1
- data/lib/carnivore-http/version.rb +1 -1
- metadata +2 -4
- data/Gemfile.lock +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f342b9b66f1d52b80f5c7602e176352bea82e607
|
4
|
+
data.tar.gz: e42127361c8171ce84eee20e138819053c3a3748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19bd3bbc193dd30ed033ad5469c5e6bad34f4e136af8048764ccd92ead069a12863c54f19b46b73a868ca4e2a3a3ee501a320358958380a0c4a1f84db5c80c6a
|
7
|
+
data.tar.gz: 763d46d07186e87cb60e5f9603c8489273a3e2746996a405bbeb8d900db30f82a0afd1d48c5d8ade17504584c640f486792fe13bbc308b15cc492ac7a30ce493
|
data/CHANGELOG.md
CHANGED
@@ -94,7 +94,7 @@ module Carnivore
|
|
94
94
|
|
95
95
|
# Always auto start
|
96
96
|
def auto_process?
|
97
|
-
true
|
97
|
+
args.has_key?(:enable_processing) ? args[:enable_processing] : true
|
98
98
|
end
|
99
99
|
|
100
100
|
# Message is authorized for processing
|
@@ -234,8 +234,10 @@ module Carnivore
|
|
234
234
|
# @param headers [Hash] request headers
|
235
235
|
# @return [NilClass]
|
236
236
|
def perform_transmission(message_id, payload, method, url, headers={})
|
237
|
-
|
238
|
-
|
237
|
+
unless(retry_delivery.redeliver(message_id, payload, method, url, headers))
|
238
|
+
write_for_retry(message_id, payload, method, url, headers)
|
239
|
+
retry_delivery.async.attempt_redelivery(message_id)
|
240
|
+
end
|
239
241
|
nil
|
240
242
|
end
|
241
243
|
|
@@ -352,7 +354,14 @@ module Carnivore
|
|
352
354
|
:password => pass
|
353
355
|
}
|
354
356
|
end
|
355
|
-
msg
|
357
|
+
if(msg[:body].is_a?(Hash) && msg[:body][:id])
|
358
|
+
Smash.new(
|
359
|
+
:raw => msg,
|
360
|
+
:content => msg[:body].to_smash
|
361
|
+
)
|
362
|
+
else
|
363
|
+
msg
|
364
|
+
end
|
356
365
|
end
|
357
366
|
|
358
367
|
end
|
@@ -68,7 +68,16 @@ module Carnivore
|
|
68
68
|
if(uri.userinfo)
|
69
69
|
base = base.basic_auth(:user => uri.user, :pass => uri.password)
|
70
70
|
end
|
71
|
-
|
71
|
+
if(payload.is_a?(String))
|
72
|
+
begin
|
73
|
+
payload = MultiJson.load(payload)
|
74
|
+
rescue MultiJson::ParseError
|
75
|
+
# ignore
|
76
|
+
end
|
77
|
+
end
|
78
|
+
result = base.send(method, url,
|
79
|
+
payload.is_a?(Hash) ? :json : :body => payload
|
80
|
+
)
|
72
81
|
if(result.code < 200 || result.code > 299)
|
73
82
|
error "Invalid response code received for #{message_id}: #{result.code} - #{result.reason}"
|
74
83
|
false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carnivore-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carnivore
|
@@ -75,7 +75,6 @@ files:
|
|
75
75
|
- CHANGELOG.md
|
76
76
|
- CONTRIBUTING.md
|
77
77
|
- Gemfile
|
78
|
-
- Gemfile.lock
|
79
78
|
- LICENSE
|
80
79
|
- README.md
|
81
80
|
- carnivore-http.gemspec
|
@@ -116,4 +115,3 @@ signing_key:
|
|
116
115
|
specification_version: 4
|
117
116
|
summary: Message processing helper
|
118
117
|
test_files: []
|
119
|
-
has_rdoc:
|
data/Gemfile.lock
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
carnivore-http (0.2.1)
|
5
|
-
blockenspiel
|
6
|
-
carnivore (>= 0.1.8)
|
7
|
-
htauth
|
8
|
-
reel (~> 0.5.0)
|
9
|
-
|
10
|
-
GEM
|
11
|
-
remote: https://rubygems.org/
|
12
|
-
specs:
|
13
|
-
attribute_struct (0.2.8)
|
14
|
-
blockenspiel (0.4.5)
|
15
|
-
bogo (0.1.8)
|
16
|
-
hashie
|
17
|
-
multi_json
|
18
|
-
bogo-config (0.1.8)
|
19
|
-
attribute_struct
|
20
|
-
bogo (>= 0.1.4, < 1.0)
|
21
|
-
multi_json
|
22
|
-
multi_xml
|
23
|
-
carnivore (0.3.6)
|
24
|
-
bogo-config
|
25
|
-
celluloid
|
26
|
-
hashie
|
27
|
-
multi_json
|
28
|
-
celluloid (0.16.0)
|
29
|
-
timers (~> 4.0.0)
|
30
|
-
celluloid-io (0.16.2)
|
31
|
-
celluloid (>= 0.16.0)
|
32
|
-
nio4r (>= 1.1.0)
|
33
|
-
form_data (0.1.0)
|
34
|
-
hashie (3.4.0)
|
35
|
-
highline (1.7.0)
|
36
|
-
hitimes (1.2.2)
|
37
|
-
htauth (1.1.0)
|
38
|
-
highline (~> 1.6)
|
39
|
-
http (0.7.1)
|
40
|
-
form_data (~> 0.1.0)
|
41
|
-
http_parser.rb (~> 0.6.0)
|
42
|
-
http_parser.rb (0.6.0)
|
43
|
-
multi_json (1.10.1)
|
44
|
-
multi_xml (0.5.5)
|
45
|
-
nio4r (1.1.0)
|
46
|
-
reel (0.5.0)
|
47
|
-
celluloid (>= 0.15.1)
|
48
|
-
celluloid-io (>= 0.15.0)
|
49
|
-
http (>= 0.6.0.pre)
|
50
|
-
http_parser.rb (>= 0.6.0)
|
51
|
-
websocket_parser (>= 0.1.6)
|
52
|
-
timers (4.0.1)
|
53
|
-
hitimes
|
54
|
-
websocket_parser (1.0.0)
|
55
|
-
|
56
|
-
PLATFORMS
|
57
|
-
java
|
58
|
-
ruby
|
59
|
-
|
60
|
-
DEPENDENCIES
|
61
|
-
carnivore-http!
|