pushr-core 1.0.0.pre.4 → 1.0.0.pre.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4013d245094a4659d51610f6448da91813c933e
4
- data.tar.gz: dad963d156b9b3d0fda568a7fdbc2426d8ef8230
3
+ metadata.gz: 3a41177751670c857d6199aa6dfca739c39b9d6a
4
+ data.tar.gz: 635ffdff9092a51e835cdf042f51ab06de439fc3
5
5
  SHA512:
6
- metadata.gz: 03bb413cee574cbe9c314fd52352e91ba0265d345afff11b2db1d811800eaede790823367d6c9ab96d33658b178172ba45637424429a34994b18c10947b4f60c
7
- data.tar.gz: 568ff09d71fd0546c0c6508f29d0c5cf2579f80159cb763e75772338132530d36dd353969c3ef87c0c784c1f9f73beaf07f3845e7f7a634cc114a39e340d1912
6
+ metadata.gz: 35b3e2fdae0f25fe02fc96bd7843af22bdf5ff0f83603683541da5d78a089f9a3b97a85d61a8e0683700bdaffb928903830993d11dba3a6ede588e93bfcea696
7
+ data.tar.gz: 0e825ad4237f931e4054bceb9939d4b24497211c7bfdc093bce7b70c4a92103169363d1d18a02db4be65b0f8c0ce9f145bec59e8440fd39a8ab5a4f9feb322ee
data/README.md CHANGED
@@ -42,8 +42,8 @@ it will use that. The configuration is stored in Redis and you add the configura
42
42
 
43
43
  APNS ([see](https://github.com/9to5/pushr-core#generating-certificates)):
44
44
  ```ruby
45
- Pushr::ConfigurationApns.create(app: 'app_name', connections: 2, enabled: true,
46
- certificate: File.read('certificate.pem'), sandbox: false, skip_check_for_error: false)
45
+ Pushr::ConfigurationApns.new(app: 'app_name', connections: 2, enabled: true,
46
+ certificate: File.read('certificate.pem'), sandbox: false, skip_check_for_error: false).save
47
47
  ```
48
48
 
49
49
  The `skip_check_for_error` parameter can be set to `true` or `false`. If set to `true` the APNS service
@@ -53,15 +53,15 @@ sandbox devices in your production environment you should not set `skip_check_fo
53
53
 
54
54
  APNS Feedback:
55
55
  ```ruby
56
- Pushr::ConfigurationApnsFeedback.create(app: 'app_name', connections: 1, enabled: true,
57
- feedback_poll: 60)
56
+ Pushr::ConfigurationApnsFeedback.new(app: 'app_name', connections: 1, enabled: true,
57
+ feedback_poll: 60).save
58
58
  ```
59
59
 
60
60
  Use this configuration to let a thread check for feedback on all APNS Configurations. It checks every `feedback_poll` in seconds.
61
61
 
62
62
  GCM ([see](http://developer.android.com/guide/google/gcm/gs.html)):
63
63
  ```ruby
64
- Pushr::ConfigurationGcm.create(app: 'app_name', connections: 2, enabled: true, api: '<api key here>')
64
+ Pushr::ConfigurationGcm.new(app: 'app_name', connections: 2, enabled: true, api: '<api key here>').save
65
65
  ```
66
66
 
67
67
  You can have each provider per app_name and you can have more than one app_name. Use the instructions below to generate
@@ -101,19 +101,21 @@ Where `<options>` can be:
101
101
 
102
102
  APNS:
103
103
  ```ruby
104
- Pushr::MessageApns.create(
104
+ Pushr::MessageApns.new(
105
105
  app: 'app_name',
106
106
  device: '<APNS device_token here>',
107
107
  alert: 'Hello World',
108
108
  sound: '1.aiff',
109
109
  badge: 1,
110
- expiry: 1.day.to_i,
111
- attributes_for_device: {key: 'MSG'})
110
+ expiry: 1.day.from_now.to_i,
111
+ attributes_for_device: {key: 'MSG'},
112
+ priority: 10,
113
+ content_available: 1).save
112
114
  ```
113
115
 
114
116
  GCM:
115
117
  ```ruby
116
- Pushr::MessageGcm.create(
118
+ Pushr::MessageGcm.new(
117
119
  app: 'app_name',
118
120
  registration_ids: ['<GCM registration_id here>', '<GCM registration_id here>'],
119
121
  notification_key: 'notification_key_name',
@@ -122,7 +124,7 @@ Pushr::MessageGcm.create(
122
124
  time_to_live: 24 * 60 * 60,
123
125
  restricted_package_name: 'com.example.gcm',
124
126
  dry_run: false,
125
- collapse_key: 'MSG')
127
+ collapse_key: 'MSG').save
126
128
  ```
127
129
 
128
130
  ## Feedback processing
@@ -15,11 +15,6 @@ module Pushr
15
15
  # device = feedback.update_to
16
16
  Pushr::Daemon.logger.info('[FeedbackProcessor] Pushr::FeedbackGcm update')
17
17
  end
18
- elsif feedback.instance_of? Pushr::FeedbackC2dm
19
- if feedback.follow_up == 'delete'
20
- # TODO: delete c2dm device
21
- Pushr::Daemon.logger.info('[FeedbackProcessor] Pushr::FeedbackC2dm delete')
22
- end
23
18
  elsif feedback.instance_of? Pushr::FeedbackApns
24
19
  if feedback.follow_up == 'delete'
25
20
  # TODO: delete apns device
@@ -12,7 +12,7 @@ module Pushr
12
12
  end
13
13
 
14
14
  def message
15
- "Unable to deliver message #{@message.inspect}, received #{@source} error #{@code} (#{@description})"
15
+ "Unable to deliver message #{@message.to_json}, received #{@source} error #{@code} (#{@description})"
16
16
  end
17
17
  end
18
18
  end
data/lib/pushr/message.rb CHANGED
@@ -19,11 +19,6 @@ module Pushr
19
19
  end
20
20
  end
21
21
 
22
- def save!
23
- save || fail(RecordNotSaved)
24
- # fail 'x' unless save
25
- end
26
-
27
22
  def self.next(queue_name, timeout = 3)
28
23
  Pushr::Core.redis do |conn|
29
24
  message = conn.blpop(queue_name, timeout: timeout)
data/lib/pushr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pushr
2
- VERSION = '1.0.0.pre.4'
2
+ VERSION = '1.0.0.pre.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushr-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.4
4
+ version: 1.0.0.pre.5
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-05-27 00:00:00.000000000 Z
11
+ date: 2014-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3'
19
+ version: '3.0'
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: '3'
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redis-namespace
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.4.1
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
- version: '0'
40
+ version: 1.4.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: multi_json
43
43
  requirement: !ruby/object:Gem::Requirement