Permalink
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
2 parents 5d3307a + c59de60 commit b686d1453de5069332b95cfe466a8051545447ed @jeremyboles committed Mar 10, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/rapnd.rb
  2. +1 −1 lib/rapnd/daemon.rb
  3. +1 −1 spec/rapnd_spec.rb
View
2 lib/rapnd.rb
@@ -8,7 +8,7 @@ module Rapnd
extend self
def queue(queue_name, message)
- self.redis.lpush(queue_name, Marshal.dump(message))
+ self.redis.lpush(queue_name, message.to_json)
end
def redis
View
2 lib/rapnd/daemon.rb
@@ -56,7 +56,7 @@ def run!
begin
message = @redis.blpop(self.queue, 1)
if message
- notification = Rapnd::Notification.new(Marshal.load(message.last))
+ notification = Rapnd::Notification.new(JSON(message.last).symbolize_keys)
self.connect! unless self.connected
@logger.info "Sending #{notification.device_token}: #{notification.json_payload}"
self.apple.write(notification.to_bytes)
View
2 spec/rapnd_spec.rb
@@ -14,7 +14,7 @@
Rapnd.queue('test_queue', {:alert => 'Hi!'})
@redis.llen('test_queue').should == 1
- Marshal.load(@redis.lpop('test_queue')).should == {:alert => 'Hi!'}
+ JSON(@redis.lpop('test_queue')).symbolize_keys.should == {:alert => 'Hi!'}
end
it 'gets a redis connection' do

0 comments on commit b686d14

Please sign in to comment.