Skip to content

Commit

Permalink
switch out json for multi_json
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Anderton committed Jan 15, 2013
1 parent 019b1ea commit 5e7861d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -11,7 +11,7 @@ begin
gemspec.homepage = "http://github.com/defensio/defensio-ruby"
gemspec.authors = ["The Defensio Team", "Carl Mercier"]
gemspec.add_dependency('httparty', '>= 0.5.0')
gemspec.add_dependency('json')
gemspec.add_dependency('multi_json', '~> 1.5.0')
end
Jeweler::GemcutterTasks.new
rescue LoadError
Expand Down
6 changes: 3 additions & 3 deletions defensio.gemspec
Expand Up @@ -35,14 +35,14 @@ Gem::Specification.new do |s|

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<httparty>, [">= 0.5.0"])
s.add_runtime_dependency(%q<json>, [">= 0"])
s.add_runtime_dependency(%q<multi_json>, ["~> 1.5.0"])
else
s.add_dependency(%q<httparty>, [">= 0.5.0"])
s.add_dependency(%q<json>, [">= 0"])
s.add_dependency(%q<multi_json>, ["~> 1.5.0"])
end
else
s.add_dependency(%q<httparty>, [">= 0.5.0"])
s.add_dependency(%q<json>, [">= 0"])
s.add_dependency(%q<multi_json>, ["~> 1.5.0"])
end
end

4 changes: 2 additions & 2 deletions lib/defensio.rb
Expand Up @@ -6,7 +6,7 @@
require 'rubygems'
require 'httparty'
require 'uri'
require 'json'
require 'multi_json'

class Defensio
# You shouldn't modify these values unless you really know what you are doing. And then again...
Expand Down Expand Up @@ -121,7 +121,7 @@ def api_path(action = nil, id = nil)

def parse_body(str)
if FORMAT == :json
return JSON.parse(str)[ROOT_NODE]
return MultiJson.load(str)[ROOT_NODE]
else
raise(NotImplementedError, "This library doesn't support this format: #{FORMAT}")
end
Expand Down

0 comments on commit 5e7861d

Please sign in to comment.