pushr-gcm 1.0.0.pre.4 → 1.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pushr-gcm/version.rb +1 -1
- data/lib/pushr/configuration_gcm.rb +3 -3
- data/lib/pushr/daemon/gcm.rb +1 -1
- data/lib/pushr/feedback_gcm.rb +3 -5
- data/lib/pushr/message_gcm.rb +5 -5
- 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: eacd1d24b8a94657b4329e960f0e6a5864fb7b5a
|
4
|
+
data.tar.gz: be1116d4b35743ca8db413c4d6d557a421a7034b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b46ec7bcade405d6df91d789a648a868db8fb0ed95b102e068a4b11ef958dbdac3649ffafc09299cd397adc1601e87d88acf1db4f93e89437b446124c255fce6
|
7
|
+
data.tar.gz: f900c4a5fda73b443594d5ddaa544a0530c284610ad2a05ec2f04d690802560d4595d42e7d10609fbf7e2789a0dda29a8cb9ece9b77e97792374dd264df9ccf1
|
data/lib/pushr-gcm/version.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module Pushr
|
2
2
|
class ConfigurationGcm < Pushr::Configuration
|
3
|
-
attr_accessor :
|
3
|
+
attr_accessor :api
|
4
4
|
validates :api, presence: true
|
5
5
|
|
6
6
|
def name
|
7
7
|
:gcm
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
|
10
|
+
def to_hash
|
11
|
+
{ type: self.class.to_s, app: app, enabled: enabled, connections: connections, api: api }
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/pushr/daemon/gcm.rb
CHANGED
@@ -13,7 +13,7 @@ module Pushr
|
|
13
13
|
connection = GcmSupport::ConnectionGcm.new(configuration, i + 1)
|
14
14
|
connection.connect
|
15
15
|
|
16
|
-
handler = MessageHandler.new("pushr:#{configuration.
|
16
|
+
handler = MessageHandler.new("pushr:#{configuration.key}", connection, configuration.app, i + 1)
|
17
17
|
handler.start
|
18
18
|
@handlers << handler
|
19
19
|
end
|
data/lib/pushr/feedback_gcm.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
module Pushr
|
2
2
|
class FeedbackGcm < Pushr::Feedback
|
3
|
-
attr_accessor :
|
4
|
-
|
3
|
+
attr_accessor :device, :follow_up, :failed_at, :update_to
|
5
4
|
validates :follow_up, inclusion: { in: %w(delete update), message: '%{value} is not a valid follow-up' }
|
6
5
|
|
7
|
-
def
|
8
|
-
|
9
|
-
MultiJson.dump(hsh)
|
6
|
+
def to_hash
|
7
|
+
{ type: 'Pushr::FeedbackGcm', app: app, device: device, follow_up: follow_up, failed_at: failed_at, update_to: update_to }
|
10
8
|
end
|
11
9
|
end
|
12
10
|
end
|
data/lib/pushr/message_gcm.rb
CHANGED
@@ -2,6 +2,8 @@ module Pushr
|
|
2
2
|
class MessageGcm < Pushr::Message
|
3
3
|
POSTFIX = 'gcm'
|
4
4
|
|
5
|
+
attr_accessor :registration_ids, :notification_key, :collapse_key, :delay_while_idle, :time_to_live, :data,
|
6
|
+
:restricted_package_name, :dry_run
|
5
7
|
validates :registration_ids, presence: true
|
6
8
|
validate :registration_ids_array
|
7
9
|
validate :data_size
|
@@ -9,9 +11,6 @@ module Pushr
|
|
9
11
|
validates :time_to_live, numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 2419200 },
|
10
12
|
allow_blank: true
|
11
13
|
|
12
|
-
attr_accessor :type, :app, :registration_ids, :notification_key, :collapse_key, :delay_while_idle, :time_to_live, :data,
|
13
|
-
:restricted_package_name, :dry_run
|
14
|
-
|
15
14
|
def to_message
|
16
15
|
hsh = {}
|
17
16
|
hsh['registration_ids'] = registration_ids
|
@@ -21,10 +20,11 @@ module Pushr
|
|
21
20
|
MultiJson.dump(hsh)
|
22
21
|
end
|
23
22
|
|
24
|
-
def
|
23
|
+
def to_hash
|
25
24
|
hsh = { type: self.class.to_s, app: app, registration_ids: registration_ids, notification_key: notification_key,
|
26
25
|
collapse_key: collapse_key, delay_while_idle: delay_while_idle, time_to_live: time_to_live, data: data }
|
27
|
-
|
26
|
+
hsh[Pushr::Core.external_id_tag] = external_id if external_id
|
27
|
+
hsh
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushr-gcm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Pesman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|