pheme 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pheme/topic_publisher.rb +6 -1
- data/lib/pheme/version.rb +1 -1
- data/spec/topic_publisher_spec.rb +15 -0
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c15bdc8da4a4e3811dcbf6d27c5609f3fb4ad4a6
|
4
|
+
data.tar.gz: f6cfc6f4647fe02f3776e4b65df8b3450551707b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb6019a9f24ad2846902bdbadd4e5e7b17cb0f626d4e504f8f51e2268758ae3eac6f82dfa48f6bd81225b193aecf3ae5256c8c9996305dc7c656f1ddc0e491ec
|
7
|
+
data.tar.gz: 4a270c99f9aaf0f56040ba6bbc2b42c80c5e94fcaa5a0b0daf2115e9d16987eaa8ddf062aee1a9b487c8d50e71621e770784e5d2bcdc69737c95b388c92b3ef1
|
@@ -13,7 +13,12 @@ module Pheme
|
|
13
13
|
|
14
14
|
def publish(message)
|
15
15
|
Pheme.log(:info, "Publishing to #{topic_arn}: #{message}")
|
16
|
-
Pheme.configuration.sns_client.publish(topic_arn: topic_arn, message: message
|
16
|
+
Pheme.configuration.sns_client.publish(topic_arn: topic_arn, message: serialize(message))
|
17
|
+
end
|
18
|
+
|
19
|
+
def serialize(message)
|
20
|
+
return message if message.is_a? String
|
21
|
+
message.to_json
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
data/lib/pheme/version.rb
CHANGED
@@ -29,5 +29,20 @@ describe Pheme::TopicPublisher do
|
|
29
29
|
})
|
30
30
|
subject.publish_events
|
31
31
|
end
|
32
|
+
|
33
|
+
context 'with string message' do
|
34
|
+
let(:topic_arn) { "arn:aws:sns:anything" }
|
35
|
+
let(:message) { "don't touch my string" }
|
36
|
+
|
37
|
+
subject {Pheme::TopicPublisher.new(topic_arn: topic_arn)}
|
38
|
+
|
39
|
+
it "publishes unchanged message" do
|
40
|
+
expect(Pheme.configuration.sns_client).to receive(:publish).with({
|
41
|
+
topic_arn: topic_arn,
|
42
|
+
message: message,
|
43
|
+
})
|
44
|
+
subject.publish(message)
|
45
|
+
end
|
46
|
+
end
|
32
47
|
end
|
33
48
|
end
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Graham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2'
|
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
26
|
version: '2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: recursive-open-struct
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: smarter_csv
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '3.4'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec_junit_formatter
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0.2'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.2'
|
97
97
|
description: Ruby AWS SNS publisher + SQS poller & message handler
|
@@ -101,8 +101,8 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
-
|
105
|
-
-
|
104
|
+
- .gitignore
|
105
|
+
- .rspec
|
106
106
|
- Gemfile
|
107
107
|
- LICENSE
|
108
108
|
- README.md
|
@@ -135,17 +135,17 @@ require_paths:
|
|
135
135
|
- lib
|
136
136
|
required_ruby_version: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
|
-
- -
|
138
|
+
- - '>='
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: 2.1.0
|
141
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.
|
148
|
+
rubygems_version: 2.0.14.1
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: Ruby SNS publisher + SQS poller & message handler
|