pheme 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pheme/queue_poller.rb +8 -1
- data/lib/pheme/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14eae1568c79d666dceae2a6543d089948a9d17d
|
4
|
+
data.tar.gz: 4d2122f25924f664b49f2649fec617a9e67ecdf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c0ddfea4f7cbbb6ccc3e985a3ef6f644e8f06af24684bf2271b3fc240c0a8390984e8d2d0023be9ba0018297b8bc92fa5c448a1ed11b1484b3f38792b59e4da
|
7
|
+
data.tar.gz: a3a5ba835ba6dccd4ca8210e9af6fa89c2f3549889091d74d2b168db80dc0fef3e7d34eb59dccbe4012e49cc4b1565f3e525d1acc610505bc95d32bc39b14c4d
|
data/lib/pheme/queue_poller.rb
CHANGED
@@ -53,23 +53,30 @@ module Pheme
|
|
53
53
|
def parse_body(queue_message)
|
54
54
|
message_body = JSON.parse(queue_message.body)
|
55
55
|
raw_content = get_content(message_body)
|
56
|
+
body = get_metadata(message_body)
|
56
57
|
|
57
58
|
case format
|
58
59
|
when :csv
|
59
60
|
parsed_content = parse_csv(raw_content)
|
61
|
+
body['Message'] = raw_content
|
60
62
|
when :json
|
61
63
|
parsed_content = parse_json(raw_content)
|
64
|
+
body['Message'] = parsed_content
|
62
65
|
else
|
63
66
|
method_name = "parse_#{format}".to_sym
|
64
67
|
raise ArgumentError, "Unknown format #{format}" unless respond_to?(method_name)
|
65
68
|
parsed_content = __send__(method_name, raw_content)
|
69
|
+
body['Records'] = parsed_content
|
66
70
|
end
|
67
71
|
|
68
|
-
body = format == :csv ? raw_content : parsed_content
|
69
72
|
log_message_received(queue_message, body)
|
70
73
|
parsed_content
|
71
74
|
end
|
72
75
|
|
76
|
+
def get_metadata(message_body)
|
77
|
+
message_body.except('Message', 'Records')
|
78
|
+
end
|
79
|
+
|
73
80
|
def get_content(body)
|
74
81
|
body['Message']
|
75
82
|
end
|
data/lib/pheme/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pheme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Graham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|