Permalink
Browse files

Use the JSON gem instead of AS::JSON since the latter doesn't parse \…

…u000a (\n) correctly.
  • Loading branch information...
1 parent c084fde commit 7f37b6bc75f39f6da7749d0be22f158ab1b91ca8 @eventualbuddha eventualbuddha committed Jun 15, 2011
Showing with 5 additions and 4 deletions.
  1. +1 −1 Gemfile
  2. +1 −0 Gemfile.lock
  3. +2 −2 app/models/ssu/daemon.rb
  4. +1 −1 app/models/ssu/sync_job.rb
View
@@ -5,7 +5,7 @@ gem 'rails', '3.0.1'
gem 'resque', '1.10.0'
gem 'system_timer'
gem 'daemon_controller', '0.2.5'
-
+gem 'json'
platforms :mri_18 do
gem "oniguruma", :require => 'oniguruma'
View
@@ -140,6 +140,7 @@ DEPENDENCIES
faker
fastercsv
iconv
+ json
libxml-ruby (= 1.1.3)
machinist
memcache-client
@@ -122,15 +122,15 @@ def request(action, body=nil)
def read
body = socket.readline
begin
- return ActiveSupport::JSON.decode(body.chomp)
+ return JSON.parse(body.chomp)
rescue
Rails.logger.warn { "SSU(#{$$}) Unable to parse JSON response: #{body}" }
raise
end
end
def write(body)
- socket.puts(ActiveSupport::JSON.encode(body))
+ socket.puts(JSON.dump(body))
end
def close
@@ -144,7 +144,7 @@ def wait_for_sync_to_finish
while daemon.running?
self.status = daemon.request('job.status')
- self.statements = daemon.request('statement.list');
+ self.statements = daemon.request('statement.list')
if complete?
return

0 comments on commit 7f37b6b

Please sign in to comment.