diff options
| author | Mike McQuaid | 2016-11-18 08:10:28 +0000 |
|---|---|---|
| committer | GitHub | 2016-11-18 08:10:28 +0000 |
| commit | 5bbc610d2c82fdb761c95155a23d79887b1f5936 (patch) | |
| tree | 3358306bf14676f8e13e9c1ea9db1619a70fcf86 /Library/Homebrew/utils | |
| parent | 1f956a6b7560dda8fb6107634fa1e1c176311ed0 (diff) | |
| parent | 4278ec38e49285fe4ca4cb71878eef738154276c (diff) | |
| download | brew-5bbc610d2c82fdb761c95155a23d79887b1f5936.tar.bz2 | |
Merge pull request #1534 from woodruffw/use-core-json
utils/json: Replace OkJson with Ruby's core JSON.
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/json.rb | 8 |
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) |
