push-core 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -47,6 +47,8 @@ Push::ConfigurationApns.create(app: 'app_name', connections: 2, enabled: true,
47
47
  sandbox: false)
48
48
  ```
49
49
 
50
+ The `skip_check_for_error` parameter is optional and can be set to `true` or `false`. If set to `true` the APNS service will not check for errors when sending messages. This option should be used in a production environment and improves performance. In production the errors are reported and handled by the feedback service.
51
+
50
52
  C2DM ([see](https://developers.google.com/android/c2dm/)):
51
53
  ```ruby
52
54
  Push::ConfigurationC2dm.create(app: 'app_name', connections: 2, enabled: true,
@@ -99,7 +99,7 @@ module Push
99
99
  def self.write_pid_file
100
100
  if !config[:pid_file].blank?
101
101
  begin
102
- File.open(configuration[:pid_file], 'w') do |f|
102
+ File.open(config[:pid_file], 'w') do |f|
103
103
  f.puts $$
104
104
  end
105
105
  rescue SystemCallError => e
@@ -1,12 +1,13 @@
1
1
  module Push
2
2
  class DeliveryError < StandardError
3
- attr_reader :code, :description
3
+ attr_reader :code, :description, :notify
4
4
 
5
- def initialize(code, message_id, description, source)
5
+ def initialize(code, message_id, description, source, notify = true)
6
6
  @code = code
7
7
  @message_id = message_id
8
8
  @description = description
9
9
  @source = source
10
+ @notify = notify
10
11
  end
11
12
 
12
13
  def message
@@ -35,6 +35,8 @@ module Push
35
35
  begin
36
36
  connection = @connection_pool.checkout(notification.use_connection)
37
37
  notification.deliver(connection)
38
+ rescue DeliveryError => e
39
+ Push::Daemon.logger.error(e, {:error_notification => e.notify})
38
40
  rescue StandardError => e
39
41
  Push::Daemon.logger.error(e)
40
42
  ensure
@@ -43,7 +43,7 @@ module Push
43
43
  end
44
44
 
45
45
  def open_log
46
- log_file = File.open(File.join(Rails.root, 'log', 'push.log'), 'w')
46
+ log_file = File.open(File.join(Rails.root, 'log', 'push.log'), 'a')
47
47
  log_file.sync = true
48
48
  @logger = ActiveSupport::BufferedLogger.new(log_file, Rails.logger.level)
49
49
  @logger.auto_flushing = Rails.logger.respond_to?(:auto_flushing) ? Rails.logger.auto_flushing : true
@@ -1,3 +1,3 @@
1
1
  module Push
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: push-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-27 00:00:00.000000000 Z
12
+ date: 2012-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70126762372120 !ruby/object:Gem::Requirement
16
+ requirement: &70179854475920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70126762372120
24
+ version_requirements: *70179854475920
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &70126762371220 !ruby/object:Gem::Requirement
27
+ requirement: &70179854475500 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70126762371220
35
+ version_requirements: *70179854475500
36
36
  description: Push daemon for push notification services like APNS (iOS/Apple) and
37
37
  GCM/C2DM (Android).
38
38
  email: