diff options
| author | Mike McQuaid | 2018-01-18 08:29:56 +0000 | 
|---|---|---|
| committer | GitHub | 2018-01-18 08:29:56 +0000 | 
| commit | 892e1b5b4fb2ec1b71b9486d65a8932f713af8a0 (patch) | |
| tree | 6767f47c5eaaa3681a73cf0375fec702f7f3eb9a /Library/Homebrew/compat/json.rb | |
| parent | e97b0ce00fc76b4fa32394279e7d84ed098b2164 (diff) | |
| parent | 2cbce1fbf0a7a361f2be8b3545998f1a36ab3588 (diff) | |
| download | brew-892e1b5b4fb2ec1b71b9486d65a8932f713af8a0.tar.bz2 | |
Merge pull request #3652 from MikeMcQuaid/add-more-deprecations-disables
Add more deprecations, disable some existing ones.
Diffstat (limited to 'Library/Homebrew/compat/json.rb')
| -rw-r--r-- | Library/Homebrew/compat/json.rb | 30 | 
1 files changed, 6 insertions, 24 deletions
| diff --git a/Library/Homebrew/compat/json.rb b/Library/Homebrew/compat/json.rb index c8bf1c292..18763b8a6 100644 --- a/Library/Homebrew/compat/json.rb +++ b/Library/Homebrew/compat/json.rb @@ -4,34 +4,16 @@ module Utils    module JSON      module_function -    Error = Class.new(StandardError) - -    def load(str) -      odeprecated "Utils::JSON.load", "JSON.parse" -      ::JSON.parse(str) -    rescue ::JSON::ParserError => e -      raise Error, e.message +    def load(_) +      odisabled "Utils::JSON.load", "JSON.parse"      end -    def dump(obj) -      odeprecated "Utils::JSON.dump", "JSON.generate" -      ::JSON.generate(obj) +    def dump(_) +      odisabled "Utils::JSON.dump", "JSON.generate"      end -    def stringify_keys(obj) -      odeprecated "Utils::JSON.stringify_keys" -      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 +    def stringify_keys(_) +      odisabled "Utils::JSON.stringify_keys"      end    end  end | 
