Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 3 contributors
Commits on Jun 24, 2012
@smoku smoku change Marshal serialization to JSON 3e36d8b
Commits on Dec 09, 2012
@Veraticus Veraticus Merge pull request #3 from smoku/master
Change serialization format from Marshal to JSON
c59de60
Commits on Mar 10, 2013
@jeremyboles Merge remote-tracking branch 'upstream/master' b686d14
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

No commit comments for this range

Something went wrong with that request. Please try again.