houston 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/apn +2 -2
- data/houston-0.2.1.gem +0 -0
- data/lib/houston.rb +1 -1
- data/lib/houston/notification.rb +7 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 601337973b7324c434f6b47e5ed2ace4146c0fed
|
4
|
+
data.tar.gz: 29531ef75c6009a69268d969e9177ef3dd02af9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f961aab88ab247bda590f79cad03ff48e397233219ceb83239b1f4699e5bc08ee8025537c9ec8d610157c4ee19d498f84375c783d2c6f54546f477bcb0c6845
|
7
|
+
data.tar.gz: 6b723519ed7b15a5c52f71cc2f8505ada1e03ccc30a062a2634e618cf654da5dbc55421d4a202d2559d926b50fddcde0c3ecd4411409bec363db085f8796d17b
|
data/Gemfile.lock
CHANGED
data/bin/apn
CHANGED
@@ -17,7 +17,7 @@ program :help_formatter, :compact
|
|
17
17
|
default_command :help
|
18
18
|
|
19
19
|
command :push do |c|
|
20
|
-
c.syntax = 'apn push
|
20
|
+
c.syntax = 'apn push TOKEN [...]'
|
21
21
|
c.summary = 'Sends an Apple Push Notification to specified devices'
|
22
22
|
c.description = ''
|
23
23
|
|
@@ -72,7 +72,7 @@ command :push do |c|
|
|
72
72
|
@notifications = []
|
73
73
|
args.each do |token|
|
74
74
|
notification = Houston::Notification.new(@data || {})
|
75
|
-
notification.
|
75
|
+
notification.token = token
|
76
76
|
notification.alert = @alert if @alert
|
77
77
|
notification.badge = @badge if @badge
|
78
78
|
notification.sound = @sound if @sound
|
data/houston-0.2.1.gem
ADDED
Binary file
|
data/lib/houston.rb
CHANGED
data/lib/houston/notification.rb
CHANGED
@@ -2,11 +2,14 @@ require 'json'
|
|
2
2
|
|
3
3
|
module Houston
|
4
4
|
class Notification
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :token, :alert, :badge, :sound, :content_available, :custom_data
|
6
6
|
attr_reader :sent_at
|
7
7
|
|
8
|
+
alias :device :token
|
9
|
+
alias :device= :token=
|
10
|
+
|
8
11
|
def initialize(options = {})
|
9
|
-
@
|
12
|
+
@token = options.delete(:token) || options.delete(:device)
|
10
13
|
@alert = options.delete(:alert)
|
11
14
|
@badge = options.delete(:badge)
|
12
15
|
@sound = options.delete(:sound)
|
@@ -28,9 +31,9 @@ module Houston
|
|
28
31
|
|
29
32
|
def message
|
30
33
|
json = payload.to_json
|
31
|
-
|
34
|
+
hex_token = [@token.gsub(/[<\s>]/, '')].pack('H*')
|
32
35
|
|
33
|
-
[0, 0, 32,
|
36
|
+
[0, 0, 32, hex_token, 0, json.bytes.count, json].pack('ccca*cca*')
|
34
37
|
end
|
35
38
|
|
36
39
|
def mark_as_sent!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: houston
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattt Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- ./apple_push_notification_production.pem
|
78
78
|
- ./Gemfile
|
79
79
|
- ./Gemfile.lock
|
80
|
+
- ./houston-0.2.1.gem
|
80
81
|
- ./houston.gemspec
|
81
82
|
- ./lib/houston/client.rb
|
82
83
|
- ./lib/houston/connection.rb
|