messaging_client 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/config/initializers/aws_sdk.rb +6 -0
- data/lib/messaging/client.rb +9 -0
- metadata +29 -21
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dc47d845fd93cc098228c6340f52bbc6218186ca
|
4
|
+
data.tar.gz: 5d78595db7d3eae4963e5bef2b36981554116c84
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: acafb3a23e91c21fd9f4a2fd2ad799276b57031f64642c6fd9afc20dbc219308dc1bcf93201531a672b15881db0d68d8a5334a79df43ab3312909446573561f8
|
7
|
+
data.tar.gz: 743e0fc02d66acf230f486e0ade36f57de3310973313b2e8f004d4f92dd0e3c1823e94c6b4afd56350861199278576410fd63fb534d750830241fb26ef8ae46c
|
data/lib/messaging/client.rb
CHANGED
@@ -16,9 +16,18 @@ module Messaging
|
|
16
16
|
# @param key [String]
|
17
17
|
# @param data [Hash]
|
18
18
|
def self.post_message(key,data={})
|
19
|
+
publish_to_sns(key,data)
|
20
|
+
|
19
21
|
m = Message.new(key_name: key, data: data.to_json)
|
20
22
|
m.create
|
21
23
|
end
|
24
|
+
|
25
|
+
def self.publish_to_sns(key,data)
|
26
|
+
sns = Aws::SNS::Resource.new(region: 'us-east-1')
|
27
|
+
topic_arn = sns.topics.select{|t| t.arn.match(/([^:]*)$/)[0] == key.to_s }.first
|
28
|
+
topic = sns.topic(topic_arn)
|
29
|
+
topic.publish({ message: data.to_json })
|
30
|
+
end
|
22
31
|
|
23
32
|
end
|
24
33
|
end
|
metadata
CHANGED
@@ -1,48 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: messaging_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Dwayne Macgowan
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: railties
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.1'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '3.1'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: logical_model
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 0.5.0
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 0.5.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: aws-sdk-sns
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1'
|
46
55
|
description: This is client library for padma-Messaging-ws
|
47
56
|
email:
|
48
57
|
- dwaynemac@gmail.com
|
@@ -50,35 +59,34 @@ executables: []
|
|
50
59
|
extensions: []
|
51
60
|
extra_rdoc_files: []
|
52
61
|
files:
|
53
|
-
- app/models/messaging/notify_me.rb
|
54
62
|
- app/models/messaging/message.rb
|
55
|
-
-
|
63
|
+
- app/models/messaging/notify_me.rb
|
64
|
+
- config/initializers/aws_sdk.rb
|
65
|
+
- config/initializers/messaging_client.rb
|
56
66
|
- lib/messaging/client.rb
|
57
67
|
- lib/messaging/railties.rb
|
58
|
-
-
|
68
|
+
- lib/messaging_client.rb
|
59
69
|
homepage: ''
|
60
70
|
licenses: []
|
71
|
+
metadata: {}
|
61
72
|
post_install_message:
|
62
73
|
rdoc_options: []
|
63
74
|
require_paths:
|
64
75
|
- lib
|
65
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
77
|
requirements:
|
68
|
-
- -
|
78
|
+
- - ">="
|
69
79
|
- !ruby/object:Gem::Version
|
70
80
|
version: '0'
|
71
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
82
|
requirements:
|
74
|
-
- -
|
83
|
+
- - ">="
|
75
84
|
- !ruby/object:Gem::Version
|
76
85
|
version: '0'
|
77
86
|
requirements: []
|
78
87
|
rubyforge_project:
|
79
|
-
rubygems_version:
|
88
|
+
rubygems_version: 2.6.11
|
80
89
|
signing_key:
|
81
|
-
specification_version:
|
90
|
+
specification_version: 4
|
82
91
|
summary: Client library for padma-messaging-ws
|
83
92
|
test_files: []
|
84
|
-
has_rdoc:
|