compat: deprecate Utils::JSON in favor of corelib JSON.
This commit is contained in:
parent
7fbab8be9c
commit
54d18cee17
@ -18,3 +18,4 @@ require "compat/language/haskell"
|
||||
require "compat/xcode"
|
||||
require "compat/software_spec"
|
||||
require "compat/utils"
|
||||
require "compat/json"
|
||||
|
@ -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) }
|
@ -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"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user