pushable-engine 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/pushable/consoles_controller.rb +8 -0
- data/app/models/pushable/messenger.rb +8 -1
- data/lib/pushable/version.rb +1 -1
- metadata +17 -4
- data/README.rdoc +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a20e3ab72bb629e5ff474d6cb9b870f987633637
|
4
|
+
data.tar.gz: db849405459d821a2a7401df049baf56b0c76b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c358a06749899be88a5b1e6f3342df4f12cbc3b0899cf3cad8b363e8e4aa36a3f2daefd978ea8359810ffefda1759341225b34bb55ca8ef12733016c3f11e1ef
|
7
|
+
data.tar.gz: def5de7cfcf1768b7d1ba1df122a84081a817662cba551b61d6ca09e76e3df1af39e0b7f340a293272ffedfa3004df186475cc25317dd488ef5be2a78c5e723b
|
@@ -2,6 +2,14 @@ module Pushable
|
|
2
2
|
class ConsolesController < ::ActionController::Base
|
3
3
|
layout 'pushable/application'
|
4
4
|
|
5
|
+
class ::ExampleMessage < Pushable::Message
|
6
|
+
def other
|
7
|
+
{ foo: bar, bar: baz }
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Pushable::Console << Pushable::Stub.new(ExampleMessage, bar: :string, baz: :integer)
|
12
|
+
|
5
13
|
def show
|
6
14
|
@push = Pushable::ConsolePush.new
|
7
15
|
@stubs = Pushable::Console.stubs
|
@@ -8,13 +8,20 @@ module Pushable
|
|
8
8
|
|
9
9
|
def send_gcm(tokens, payload)
|
10
10
|
return unless tokens.any?
|
11
|
+
Rails.logger.info "[GCM] Sending to #{tokens.size} tokens..."
|
12
|
+
Rails.logger.info "[GCM] Payload: #{payload}"
|
11
13
|
service = GCM::Service.new
|
12
14
|
notification = GCM::Notification.new(payload)
|
13
|
-
service.deliver notification, tokens
|
15
|
+
result = service.deliver notification, tokens
|
16
|
+
result.responses.each do |resp|
|
17
|
+
Rails.logger.info "[GCM] Response: #{resp.message}"
|
18
|
+
end
|
14
19
|
end
|
15
20
|
|
16
21
|
def send_apns(tokens, payload)
|
17
22
|
return unless tokens.any?
|
23
|
+
Rails.logger.info "[APNS] Sending to #{tokens.size} tokens..."
|
24
|
+
Rails.logger.info "[APNS] Payload: #{payload}"
|
18
25
|
service = APNS::Service.new
|
19
26
|
notification = APNS::Notification.new(payload)
|
20
27
|
service.deliver notification, tokens
|
data/lib/pushable/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushable-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Logan Serman
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '4'
|
19
|
+
version: '4.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
|
-
version: '4'
|
26
|
+
version: '4.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activejob
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.2'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: responders
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +144,6 @@ extensions: []
|
|
130
144
|
extra_rdoc_files: []
|
131
145
|
files:
|
132
146
|
- MIT-LICENSE
|
133
|
-
- README.rdoc
|
134
147
|
- Rakefile
|
135
148
|
- app/assets/javascripts/pushable/application.js
|
136
149
|
- app/assets/javascripts/pushable/consoles.js
|
data/README.rdoc
DELETED