aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-04-05 13:06:36 -0400
committerMax Howell2012-04-05 13:06:36 -0400
commit4f16573afa069d13c1fe5d4a7ebcf52cc403bed4 (patch)
treed25961701e719716d7be0f0135d7acb882e64b50 /Library
parentdef4bd870e4902f522cd5d8c13022f9384a0b56b (diff)
downloadhomebrew-4f16573afa069d13c1fe5d4a7ebcf52cc403bed4.tar.bz2
Use GitHub API 3 in `brew search`
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/search.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index 4ab87d3a0..7e19a72bd 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -50,12 +50,12 @@ module Homebrew extend self
return [] if (HOMEBREW_LIBRARY/"Taps/#{user.downcase}-#{repo.downcase}").directory?
require 'open-uri'
- require 'yaml'
+ require 'vendor/multi_json'
results = []
- open "http://github.com/api/v2/yaml/blob/all/#{user}/homebrew-#{repo}/master" do |f|
+ open "https://api.github.com/repos/#{user}/homebrew-#{repo}/git/trees/HEAD?recursive=1" do |f|
user.downcase! if user == "Homebrew" # special handling for the Homebrew organization
- YAML::load(f.read)["blobs"].each do |file, _|
+ MultiJson.decode(f.read)["tree"].map{ |hash| hash['path'] }.compact.each do |file|
name = File.basename(file, '.rb')
if file =~ /\.rb$/ and name =~ rx
results << "#{user}/#{repo}/#{name}"