mameapns 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/lib/mameapns/application.rb +16 -0
- data/lib/mameapns/session/deliver.rb +5 -1
- data/lib/mameapns/version.rb +1 -1
- metadata +2 -2
data/lib/mameapns/application.rb
CHANGED
@@ -89,6 +89,22 @@ module Mameapns
|
|
89
89
|
@on_delivery_error = block
|
90
90
|
end
|
91
91
|
|
92
|
+
# To attempt to connect to apns server and close actually
|
93
|
+
# it used to check ssl cert files and ohter configurations.
|
94
|
+
def attempt_to_connect?
|
95
|
+
can_connect = true
|
96
|
+
|
97
|
+
begin
|
98
|
+
@deliver_session.connect?
|
99
|
+
rescue ConnectionError => e
|
100
|
+
can_connect = false
|
101
|
+
ensure
|
102
|
+
@deliver_session.close
|
103
|
+
end
|
104
|
+
|
105
|
+
can_connect
|
106
|
+
end
|
107
|
+
|
92
108
|
[:feedback, :sent, :delivery_error, :exception].each do |event|
|
93
109
|
event_name = "on_#{event}"
|
94
110
|
define_method(event_name) do |&block|
|
data/lib/mameapns/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mameapns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|