diff options
| author | William Woodruff | 2016-11-20 12:43:13 -0500 |
|---|---|---|
| committer | William Woodruff | 2016-11-20 15:02:47 -0500 |
| commit | 54d18cee17a7af49b5858dd752bf2eda59014472 (patch) | |
| tree | 2284b6927c1bbeda86df183e34ab188f8fdbc716 /Library/Homebrew/utils | |
| parent | 7fbab8be9c1aa7b3a5a57ab1362fc128d12135ed (diff) | |
| download | brew-54d18cee17a7af49b5858dd752bf2eda59014472.tar.bz2 | |
compat: deprecate Utils::JSON in favor of corelib JSON.
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/json.rb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/Library/Homebrew/utils/json.rb b/Library/Homebrew/utils/json.rb deleted file mode 100644 index 21c5b52b0..000000000 --- a/Library/Homebrew/utils/json.rb +++ /dev/null @@ -1,34 +0,0 @@ -require "json" - -module Utils - module JSON - module_function - - Error = Class.new(StandardError) - - def load(str) - ::JSON.load(str) - rescue ::JSON::ParserError => e - raise Error, e.message - end - - def dump(obj) - ::JSON.generate(obj) - end - - def stringify_keys(obj) - case obj - when Array - obj.map { |val| stringify_keys(val) } - when Hash - obj.inject({}) do |result, (key, val)| - key = key.respond_to?(:to_s) ? key.to_s : key - val = stringify_keys(val) - result.merge!(key => val) - end - else - obj - end - end - end -end |
