aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorWilliam Woodruff2016-11-20 12:43:13 -0500
committerWilliam Woodruff2016-11-20 15:02:47 -0500
commit54d18cee17a7af49b5858dd752bf2eda59014472 (patch)
tree2284b6927c1bbeda86df183e34ab188f8fdbc716 /Library
parent7fbab8be9c1aa7b3a5a57ab1362fc128d12135ed (diff)
downloadbrew-54d18cee17a7af49b5858dd752bf2eda59014472.tar.bz2
compat: deprecate Utils::JSON in favor of corelib JSON.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/compat.rb1
-rw-r--r--Library/Homebrew/compat/json.rb (renamed from Library/Homebrew/utils/json.rb)5
-rw-r--r--Library/Homebrew/utils.rb1
3 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/compat.rb b/Library/Homebrew/compat.rb
index db0ece584..0b81e037a 100644
--- a/Library/Homebrew/compat.rb
+++ b/Library/Homebrew/compat.rb
@@ -18,3 +18,4 @@ require "compat/language/haskell"
require "compat/xcode"
require "compat/software_spec"
require "compat/utils"
+require "compat/json"
diff --git a/Library/Homebrew/utils/json.rb b/Library/Homebrew/compat/json.rb
index 21c5b52b0..c8bf1c292 100644
--- a/Library/Homebrew/utils/json.rb
+++ b/Library/Homebrew/compat/json.rb
@@ -7,16 +7,19 @@ module Utils
Error = Class.new(StandardError)
def load(str)
- ::JSON.load(str)
+ odeprecated "Utils::JSON.load", "JSON.parse"
+ ::JSON.parse(str)
rescue ::JSON::ParserError => e
raise Error, e.message
end
def dump(obj)
+ odeprecated "Utils::JSON.dump", "JSON.generate"
::JSON.generate(obj)
end
def stringify_keys(obj)
+ odeprecated "Utils::JSON.stringify_keys"
case obj
when Array
obj.map { |val| stringify_keys(val) }
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 7a7673d01..89a90bed2 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -9,7 +9,6 @@ require "utils/git"
require "utils/github"
require "utils/hash"
require "utils/inreplace"
-require "utils/json"
require "utils/popen"
require "utils/tty"