From 083b3c84d08571dda76e4d9ec553492ca60b8db3 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 22 Jun 2013 16:51:08 -0500 Subject: Add Utils::JSON to wrap the JSON implementation --- Library/Homebrew/utils.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Library/Homebrew/utils.rb') 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 -- cgit v1.2.3