mercurius 0.1.0 → 0.1.1

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: e9a83b6fe0b488197398d7f81294ff118c63509c
4
- data.tar.gz: d641b9ab3f5b2651b7454f72d3399f932b2e9ef8
3
+ metadata.gz: 4de527c701af4d667d9f2faefe38feb819745e59
4
+ data.tar.gz: b6a80534b22197f71f66211884c6b33a90c23e35
5
5
  SHA512:
6
- metadata.gz: 54ef3d103e7d6a1f18bf198c7369f0a3a901eeec99bd045199f49336d5a93ad39d9992d4c5058363454f290bd17a6c25b96d59aa90a986bf602ccc5afc8c5ad8
7
- data.tar.gz: cf40a5d26640d9de5cfc936a8fc9b7060693553d36110d828d3a2084db5787a595daf84ae3d1c4d1f18e16fd99b26bb876ddc14a1949e18f4ae141582e59549e
6
+ metadata.gz: 7340a047c92fd8aa5d0e7ccd006789ba989f6b9c740591e5ac19246a0ea5818fe1a7210ba2cf77f89272e4eb70b383bdb5668611a1cc295018efd739164a9c8b
7
+ data.tar.gz: 321d03a0ede631f0a4a114c5456c9ee9c2a71ae08aebf4c050fe6f529b3b2b6a33e0f54a181c29a66e0c05d1e8c0ec1101b3ed0c68c171ba653715b8cbd0a570
data/README.md CHANGED
@@ -41,11 +41,11 @@ You can deliver the gcm_notification in the following manners:
41
41
 
42
42
  The typical APNS configuration is set automatically, but you need to set the host with with either:
43
43
 
44
- APNS.set_mode(:develop) # gateway.sandbox.push.apple.com
44
+ APNS.mode = :development # gateway.sandbox.push.apple.com
45
45
 
46
46
  or
47
47
 
48
- APNS.set_mode(:production) # gateway.push.apple.com
48
+ APNS.mode = :production # gateway.push.apple.com
49
49
 
50
50
  Next, you'll need to set your PEM information. This can either be with a file or with a text buffer:
51
51
 
@@ -1,3 +1,5 @@
1
+ require 'socket'
2
+
1
3
  module APNS
2
4
  class Connection
3
5
  attr_reader :host, :port, :pem
@@ -27,6 +29,10 @@ module APNS
27
29
  @ssl.write data
28
30
  end
29
31
 
32
+ def read
33
+ @ssl.read
34
+ end
35
+
30
36
  private
31
37
 
32
38
  def ssl_context_for_pem(pem)
@@ -1,6 +1,6 @@
1
1
  module APNS
2
2
  HOSTS = {
3
- develop: 'gateway.sandbox.push.apple.com',
3
+ development: 'gateway.sandbox.push.apple.com',
4
4
  production: 'gateway.push.apple.com',
5
5
  }
6
6
 
@@ -11,10 +11,9 @@ module APNS
11
11
  class << self
12
12
  attr_accessor :host, :port, :pem
13
13
 
14
- def set_mode(mode)
15
- host = HOSTS.fetch(mode, nil)
16
- raise InvalidApnsModeError.new if host.nil?
17
- @host = host
14
+ def mode=(mode)
15
+ raise InvalidApnsModeError.new unless HOSTS.include? mode.to_sym
16
+ @host = HOSTS[mode.to_sym]
18
17
  end
19
18
 
20
19
  end
@@ -1,3 +1,3 @@
1
1
  module Mercurius
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -1,12 +1,12 @@
1
1
  describe APNS do
2
2
 
3
- it 'sets up the develop mode' do
4
- APNS.set_mode(:develop)
5
- expect(APNS.host).to eq APNS::HOSTS[:develop]
3
+ it 'sets up the development mode' do
4
+ APNS.mode = :development
5
+ expect(APNS.host).to eq APNS::HOSTS[:development]
6
6
  end
7
7
 
8
8
  it 'sets up the production mode' do
9
- APNS.set_mode(:production)
9
+ APNS.mode = :production
10
10
  expect(APNS.host).to eq APNS::HOSTS[:production]
11
11
  end
12
12
 
@@ -4,7 +4,7 @@ describe GCM::Service do
4
4
 
5
5
  it 'should default to the GCM module configs' do
6
6
  expect(service.host).to eq GCM.host
7
- expect(service.key).to GCM.key
7
+ expect(service.key).to eq GCM.key
8
8
  end
9
9
 
10
10
  describe '#send' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercurius
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Beck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-06 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json