Skip to content

Commit

Permalink
Merge pull request #46 from Quiwin/add-multi-json-support
Browse files Browse the repository at this point in the history
Add support to multiple json libraries
  • Loading branch information
keithdoggett committed Oct 28, 2020
2 parents c06cdea + b8400ba commit 7316c96
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rgeo/geo_json.rb
Expand Up @@ -5,4 +5,4 @@
require "rgeo/geo_json/entities"
require "rgeo/geo_json/coder"
require "rgeo/geo_json/interface"
require "json"
require "multi_json"
2 changes: 1 addition & 1 deletion lib/rgeo/geo_json/coder.rb
Expand Up @@ -66,7 +66,7 @@ def decode(input)
input = input.read rescue nil
end
if input.is_a?(String)
input = JSON.parse(input)
input = MultiJson.load(input)
end
return unless input.is_a?(Hash)

Expand Down
1 change: 1 addition & 0 deletions rgeo-geojson.gemspec
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = ">= 2.3.0"

spec.add_dependency "rgeo", ">= 1.0.0"
spec.add_dependency "multi_json", "~> 1.15"

spec.add_development_dependency "minitest", "~> 5.8"
spec.add_development_dependency "rake", "~> 12.0"
Expand Down

0 comments on commit 7316c96

Please sign in to comment.