aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/json.rb
diff options
context:
space:
mode:
authorWilliam Woodruff2016-11-17 23:16:21 -0500
committerWilliam Woodruff2016-11-17 23:16:21 -0500
commit4278ec38e49285fe4ca4cb71878eef738154276c (patch)
tree20cb659ded85c2e7a4ab219eb540800eba23ff27 /Library/Homebrew/utils/json.rb
parent649c7ab48ae013f07a29a706b63d4d778e456b24 (diff)
downloadbrew-4278ec38e49285fe4ca4cb71878eef738154276c.tar.bz2
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+.
Diffstat (limited to 'Library/Homebrew/utils/json.rb')
-rw-r--r--Library/Homebrew/utils/json.rb8
1 files changed, 4 insertions, 4 deletions
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)