houston 0.3.1 → 1.0.0

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: 3d3d7c2deeb66daf14b1609f872e8f24a12d37b2
4
- data.tar.gz: 963d314d027fa39d54131aaf143d9e7166614258
3
+ metadata.gz: fc1f9887759e151475336ef952b607870f3b29b3
4
+ data.tar.gz: 1e09658a9c4177061c0e5137385779dcbee858e1
5
5
  SHA512:
6
- metadata.gz: 287dc940a01fb051b6ed57cbd7b06721c7209ba84018cc43c7f310ad356ef8b8f9935d1144a240182aad426fa8ce25a68d66de0ccc91336258a55581d7c45349
7
- data.tar.gz: 6a4f60cce353cb06f94dd5de2ab4a18b0e32e57f2b697784090683160aa0adbbc25ad4c1a14e3112c93a20fee037b79579aeca8ab241ec7c0bd07b3b5a2d934b
6
+ metadata.gz: 537b0cd3c221e84bc6b156e33eebb07d65edf5c5eb79430b4755f48ad8a7d2fd6532570619d07d12fd17d0d8861b2b64b300b297f498469cacc9cf18e42e75bd
7
+ data.tar.gz: 35b91cd235c889a02b2e18828f99c8ea5bcd0a3a67c85f30f69fb467466a97334676bf8365bd15df6fa518303251cc802491cc080359d4f63df91648e25bee02
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- houston (0.3.1)
4
+ houston (1.0.0)
5
5
  commander (~> 4.1)
6
6
  json
7
7
 
@@ -11,7 +11,7 @@ GEM
11
11
  commander (4.1.5)
12
12
  highline (~> 1.6.11)
13
13
  highline (1.6.19)
14
- json (1.8.0)
14
+ json (1.8.1)
15
15
  rake (0.9.6)
16
16
  rspec (0.9.4)
17
17
 
data/houston-0.3.1.gem ADDED
Binary file
data/houston.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "houston"
3
+ require "houston/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "houston"
data/lib/houston.rb CHANGED
@@ -1,7 +1,4 @@
1
- module Houston
2
- VERSION = "0.3.1"
3
- end
4
-
1
+ require 'houston/version'
5
2
  require 'houston/client'
6
3
  require 'houston/notification'
7
4
  require 'houston/connection'
@@ -44,6 +44,7 @@ module Houston
44
44
  notifications.each_with_index do |notification, index|
45
45
  next unless notification.kind_of?(Notification)
46
46
  next if notification.sent?
47
+ next unless notification.valid?
47
48
 
48
49
  notification.id = index
49
50
 
@@ -2,6 +2,8 @@ require 'json'
2
2
 
3
3
  module Houston
4
4
  class Notification
5
+ MAXIMUM_PAYLOAD_SIZE = 256
6
+
5
7
  attr_accessor :token, :alert, :badge, :sound, :content_available, :custom_data, :id, :expiry
6
8
  attr_reader :sent_at
7
9
 
@@ -51,5 +53,9 @@ module Houston
51
53
  def sent?
52
54
  !!@sent_at
53
55
  end
56
+
57
+ def valid?
58
+ payload.to_json.bytesize <= MAXIMUM_PAYLOAD_SIZE
59
+ end
54
60
  end
55
61
  end
@@ -0,0 +1,3 @@
1
+ module Houston
2
+ VERSION = "1.0.0"
3
+ end
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.3.1
4
+ version: 1.0.0
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-10-04 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -76,10 +76,12 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - ./Gemfile
78
78
  - ./Gemfile.lock
79
+ - ./houston-0.3.1.gem
79
80
  - ./houston.gemspec
80
81
  - ./lib/houston/client.rb
81
82
  - ./lib/houston/connection.rb
82
83
  - ./lib/houston/notification.rb
84
+ - ./lib/houston/version.rb
83
85
  - ./lib/houston.rb
84
86
  - ./LICENSE
85
87
  - ./Rakefile