From 4278ec38e49285fe4ca4cb71878eef738154276c Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 17 Nov 2016 23:16:21 -0500 Subject: utils/json: Replace OkJson with Ruby's core JSON. Removes OkJson from vendor/, as Ruby has included its own JSON parser in corelib since 1.9.x and Homebrew is now guaranteed to be running on 2.x+. --- Library/Homebrew/utils/json.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Library/Homebrew/utils') diff --git a/Library/Homebrew/utils/json.rb b/Library/Homebrew/utils/json.rb index 19d32a1e1..21c5b52b0 100644 --- a/Library/Homebrew/utils/json.rb +++ b/Library/Homebrew/utils/json.rb @@ -1,4 +1,4 @@ -require "vendor/okjson" +require "json" module Utils module JSON @@ -7,13 +7,13 @@ module Utils Error = Class.new(StandardError) def load(str) - Vendor::OkJson.decode(str) - rescue Vendor::OkJson::Error => e + ::JSON.load(str) + rescue ::JSON::ParserError => e raise Error, e.message end def dump(obj) - Vendor::OkJson.encode(stringify_keys(obj)) + ::JSON.generate(obj) end def stringify_keys(obj) -- cgit v1.2.3