aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/json.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/utils/json.rb')
-rw-r--r--Library/Homebrew/utils/json.rb34
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