aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorJack Nagel2013-06-22 16:51:08 -0500
committerJack Nagel2013-06-22 21:34:02 -0500
commit083b3c84d08571dda76e4d9ec553492ca60b8db3 (patch)
tree3f6b9dd8f3d128116a503a42e220ab664d39911c /Library/Homebrew/utils.rb
parentc4272a25cc1e8cd85acadb52db551cad2a5824cb (diff)
downloadbrew-083b3c84d08571dda76e4d9ec553492ca60b8db3.tar.bz2
Add Utils::JSON to wrap the JSON implementation
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 60eead67c..f8b5466f2 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -1,7 +1,7 @@
require 'pathname'
require 'exceptions'
require 'macos'
-require 'vendor/multi_json'
+require 'utils/json'
require 'open-uri'
class Tty
@@ -265,7 +265,7 @@ module GitHub extend self
Kernel.open(url, default_headers.merge(headers), &block)
rescue OpenURI::HTTPError => e
if e.io.meta['x-ratelimit-remaining'].to_i <= 0
- raise "GitHub #{MultiJson.decode(e.io.read)['message']}"
+ raise "GitHub #{Utils::JSON.load(e.io.read)['message']}"
else
raise e
end
@@ -283,7 +283,7 @@ module GitHub extend self
uri = URI.parse("https://api.github.com/legacy/issues/search/mxcl/homebrew/open/#{name}")
GitHub.open uri do |f|
- MultiJson.decode(f.read)['issues'].each do |issue|
+ Utils::JSON.load(f.read)['issues'].each do |issue|
# don't include issues that just refer to the tool in their body
issues << issue['html_url'] if issue['title'].include? name
end
@@ -297,7 +297,7 @@ module GitHub extend self
uri = URI.parse("https://api.github.com/legacy/issues/search/mxcl/homebrew/open/#{query}")
GitHub.open uri do |f|
- MultiJson.decode(f.read)['issues'].each do |pull|
+ Utils::JSON.load(f.read)['issues'].each do |pull|
yield pull['pull_request_url'] if rx.match pull['title'] and pull['pull_request_url']
end
end