em-apns 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Em::Apns
1
+ # EM::APNS
2
2
 
3
- TODO: Write a gem description
3
+ Persistent connections pool to APN service
4
4
 
5
5
  ## Installation
6
6
 
@@ -17,8 +17,22 @@ Or install it yourself as:
17
17
  $ gem install em-apns
18
18
 
19
19
  ## Usage
20
+ 1. Create config file `config/em-apns.yml`
21
+
22
+ ```ruby
23
+ cert: path/to/cert.pem
24
+ key: path/to/key.pem
25
+ pool: 4
26
+ ```
27
+
28
+ 2. Start the daemon `em-apns start -d` from the root folder of your app (`tmp/sockets` and `tmp/pids` are required, also `daemons` gem required for running process in background)
29
+ 3. Send notification from your app (for non rails apps path to sock file is required: `EM::APNS.sock = path/to/sock/file` )
30
+
31
+ ```ruby
32
+ EM::APNS.send_notification(token, alert: alert, custom: data)
33
+ ```
34
+
20
35
 
21
- TODO: Write usage instructions here
22
36
 
23
37
  ## Contributing
24
38
 
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ["lolcoltd@gmail.com"]
7
7
  gem.description = %q{EventMachine-driven Apple Push Notifications Sender daemon}
8
8
  gem.summary = %q{EventMachine-driven Apple Push Notifications Sender daemon}
9
- gem.homepage = ""
9
+ gem.homepage = "https://github.com/playa/em-apns"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -28,7 +28,7 @@ module EM::APNS
28
28
  end
29
29
 
30
30
  def send_notifications(notifications)
31
- UNIXSocket.open(@sock) do |socket|
31
+ UNIXSocket.open(sock) do |socket|
32
32
  notifications.each do |n|
33
33
  socket.puts(n.data)
34
34
  end
@@ -24,6 +24,10 @@ module EM::APNS
24
24
  @pid_file = path
25
25
  end
26
26
 
27
+ opts.on('-r', '--root=PATH', 'Specifies the app root path.') do |path|
28
+ @options[:root] = path
29
+ end
30
+
27
31
  opts.on('-d', '--daemonize', 'Daemonize em-apnsender') do
28
32
  @daemonize = true
29
33
  end
@@ -1,5 +1,5 @@
1
1
  module EM
2
2
  module APNS
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-apns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
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-08-26 00:00:00.000000000 Z
12
+ date: 2012-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -90,7 +90,7 @@ files:
90
90
  - spec/support/certs/key.pem
91
91
  - spec/support/helper_methods.rb
92
92
  - spec/support/mock_server.rb
93
- homepage: ''
93
+ homepage: https://github.com/playa/em-apns
94
94
  licenses: []
95
95
  post_install_message:
96
96
  rdoc_options: []
@@ -122,4 +122,3 @@ test_files:
122
122
  - spec/support/certs/key.pem
123
123
  - spec/support/helper_methods.rb
124
124
  - spec/support/mock_server.rb
125
- has_rdoc: