diff options
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/search.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index b2febbdba..7319b1d90 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -61,7 +61,7 @@ module Homebrew extend self count = local_results.length + tap_results.length if count == 0 and not blacklisted? query - puts "No formula found for #{query.inspect}. Searching open pull requests..." + puts "No formula found for #{query.inspect}." begin GitHub.find_pull_requests(rx) { |pull| puts pull } rescue GitHub::Error => e diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index f3ac5e447..97dd708af 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -254,6 +254,9 @@ module GitHub extend self Error = Class.new(StandardError) def open url, headers={}, &block + # This is a no-op if the user is opting out of using the GitHub API. + return if ENV['HOMEBREW_NO_GITHUB_API'] + require 'net/https' # for exception classes below default_headers = {'User-Agent' => HOMEBREW_USER_AGENT} @@ -296,6 +299,9 @@ module GitHub extend self end def find_pull_requests rx + return if ENV['HOMEBREW_NO_GITHUB_API'] + puts "Searching open pull requests..." + query = rx.source.delete('.*').gsub('\\', '') each_issue_matching(query) do |issue| |
