pushmeup 0.1.3.beta1 → 0.1.4.hf1

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 CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ NEW_README.md
data/README.md CHANGED
@@ -168,26 +168,34 @@ You can use multiple keys to send notifications, to do it just do this changes i
168
168
  # For single notification
169
169
  GCM.send_notification( destination, :identity => :key1 )
170
170
  # Empty notification
171
-
171
+
172
172
  GCM.send_notification( destination, data, :identity => :key1 )
173
173
  # Notification with custom information
174
-
174
+
175
175
  GCM.send_notification( destination, data, :collapse_key => "placar_score_global", :time_to_live => 3600, :delay_while_idle => false, :identity => :key1 )
176
176
  # Notification with custom information and parameters
177
-
177
+
178
178
  # For multiple notifications
179
179
  options1 = {}
180
180
  options2 = {..., :identity => :key2}
181
181
  n1 = GCM::Notification.new(destination1, data1, options1.merge({:identity => :key2}))
182
182
  n2 = GCM::Notification.new(destination2, data2, :identity => :key1)
183
183
  n3 = GCM::Notification.new(destination3, data3, options2)
184
-
184
+
185
185
  GCM.send_notifications( [n1, n2, n3] )
186
186
  # In this case, every notification has his own parameters, options and key
187
187
 
188
- ## Build Status [![Build Status](https://secure.travis-ci.org/NicosKaralis/pushmeup.png?branch=master)](http://travis-ci.org/NicosKaralis/pushmeup) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/NicosKaralis/pushmeup)
188
+ ## Status
189
+
190
+ #### Build Status [![Build Status](https://secure.travis-ci.org/NicosKaralis/pushmeup.png?branch=master)](http://travis-ci.org/NicosKaralis/pushmeup) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/NicosKaralis/pushmeup)
191
+
192
+ #### Dependency Status [![Dependency Status](https://gemnasium.com/NicosKaralis/pushmeup.png?travis)](https://gemnasium.com/NicosKaralis/pushmeup)
193
+
194
+ ## Contributing
195
+
196
+ We would be very pleased if you want to help us!
189
197
 
190
- ## Dependency Status [![Dependency Status](https://gemnasium.com/NicosKaralis/pushmeup.png?travis)](https://gemnasium.com/NicosKaralis/pushmeup)
198
+ Currently we need a lot of testing so if you are good at writing tests please help us
191
199
 
192
200
  ## License
193
201
 
data/Rakefile CHANGED
@@ -5,4 +5,9 @@ require "rspec/core/rake_task"
5
5
  RSpec::Core::RakeTask.new
6
6
 
7
7
  task :default => :spec
8
- task :test => :spec
8
+ task :test => :spec
9
+
10
+ desc "Open an irb session preloaded with this library"
11
+ task :console do
12
+ sh "irb -rubygems -I lib -r pushmeup.rb"
13
+ end
@@ -23,23 +23,22 @@ module APNS
23
23
  sock, ssl = self.open_connection
24
24
 
25
25
  notifications.each do |n|
26
- ssl.write(n.packaged_notification)
27
- end
28
-
26
+ ssl.write(n.packaged_notification)
27
+ end
28
+
29
29
  ssl.close
30
30
  sock.close
31
31
  end
32
32
 
33
33
  def self.feedback
34
- raise "Not implemented yet"
35
34
  sock, ssl = self.feedback_connection
36
35
 
37
36
  apns_feedback = []
38
37
 
39
- while line = sock.gets # Read lines from the socket
38
+ while line = ssl.read(38) # Read lines from the socket
40
39
  line.strip!
41
40
  f = line.unpack('N1n1H140')
42
- apns_feedback << [Time.at(f[0]), f[2]]
41
+ apns_feedback << { :timestamp => Time.at(f[0]), :token => f[2] }
43
42
  end
44
43
 
45
44
  ssl.close
@@ -77,10 +76,10 @@ module APNS
77
76
  puts fhost
78
77
 
79
78
  sock = TCPSocket.new(fhost, 2196)
80
- ssl = OpenSSL::SSL::SSLSocket.new(sock,context)
79
+ ssl = OpenSSL::SSL::SSLSocket.new(sock, context)
81
80
  ssl.connect
82
81
 
83
82
  return sock, ssl
84
83
  end
85
84
 
86
- end
85
+ end
@@ -36,4 +36,4 @@ module APNS
36
36
  end
37
37
 
38
38
  end
39
- end
39
+ end
@@ -1,3 +1,3 @@
1
1
  module Pushmeup
2
- VERSION = "0.1.3.beta1"
2
+ VERSION = "0.1.4.hf1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushmeup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.beta1
4
+ version: 0.1.4.hf1
5
5
  prerelease: 6
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-11-14 00:00:00.000000000 Z
12
+ date: 2013-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  segments:
122
122
  - 0
123
- hash: -3166285605977042609
123
+ hash: -548351084538645532
124
124
  required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  none: false
126
126
  requirements: