mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Only "extend self" once on the Homebrew module
This commit is contained in:
parent
1cd31db1a8
commit
10a1952d2c
@ -1,7 +1,6 @@
|
||||
require 'extend/pathname'
|
||||
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def which_versions which_brews=nil
|
||||
brew_links = Array.new
|
||||
version_map = Hash.new
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "cmd/fetch"
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def __cache
|
||||
if ARGV.named.empty?
|
||||
puts HOMEBREW_CACHE
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def __cellar
|
||||
if ARGV.named.empty?
|
||||
puts HOMEBREW_CELLAR
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'extend/ENV'
|
||||
require 'hardware'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def __env
|
||||
ENV.activate_extensions!
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def __prefix
|
||||
if ARGV.named.empty?
|
||||
puts HOMEBREW_PREFIX
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def __repository
|
||||
puts HOMEBREW_REPOSITORY
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ require 'utils'
|
||||
require 'extend/ENV'
|
||||
require 'formula_cellar_checks'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def audit
|
||||
formula_count = 0
|
||||
problem_count = 0
|
||||
|
@ -32,7 +32,7 @@ BOTTLE_ERB = <<-EOS
|
||||
end
|
||||
EOS
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def keg_contains string, keg
|
||||
if not ARGV.homebrew_developer?
|
||||
return quiet_system 'fgrep', '--recursive', '--quiet', '--max-count=1', string, keg
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def cat
|
||||
# do not "fix" this to support multiple arguments, the output would be
|
||||
# unparsable, if the user wants to cat multiple formula they can call
|
||||
|
@ -2,8 +2,7 @@ require 'formula'
|
||||
require 'keg'
|
||||
require 'bottles'
|
||||
|
||||
module Homebrew extend self
|
||||
|
||||
module Homebrew
|
||||
def cleanup
|
||||
# individual cleanup_ methods should also check for the existence of the
|
||||
# appropriate directories before assuming they exist
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def commands
|
||||
# Find commands in Homebrew/cmd
|
||||
cmds = (HOMEBREW_REPOSITORY/"Library/Homebrew/cmd").
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'hardware'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def config
|
||||
dump_verbose_config
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ require 'blacklist'
|
||||
require 'digest'
|
||||
require 'erb'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
|
||||
# Create a formula from a tarball URL
|
||||
def create
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'formula'
|
||||
require 'ostruct'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def deps
|
||||
mode = OpenStruct.new(
|
||||
:installed? => ARGV.include?('--installed'),
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "formula"
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def diy
|
||||
%w[name version].each do |opt|
|
||||
if ARGV.include? "--set-#{opt}"
|
||||
|
@ -1122,7 +1122,7 @@ end
|
||||
end
|
||||
end # end class Checks
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def doctor
|
||||
checks = Checks.new
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'formula'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def edit
|
||||
unless (HOMEBREW_REPOSITORY/'.git').directory?
|
||||
raise <<-EOS.undent
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'formula'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def fetch
|
||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
|
@ -31,7 +31,7 @@ EOS
|
||||
# NOTE Keep lines less than 80 characters! Wrapping is just not cricket.
|
||||
# NOTE The reason the string is at the top is so 25 lines is easy to measure!
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def help
|
||||
puts HOMEBREW_HELP
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def home
|
||||
if ARGV.named.empty?
|
||||
exec_browser HOMEBREW_WWW
|
||||
|
@ -5,7 +5,7 @@ require 'caveats'
|
||||
require 'blacklist'
|
||||
require 'utils/json'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def info
|
||||
# eventually we'll solidify an API, but we'll keep old versions
|
||||
# awhile around for compatibility
|
||||
|
@ -5,7 +5,7 @@ require "cmd/tap"
|
||||
require "formula_installer"
|
||||
require "hardware"
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def install
|
||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
|
@ -13,7 +13,7 @@ class String
|
||||
end
|
||||
end
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def irb
|
||||
if ARGV.include? "--help"
|
||||
puts "'v8'.f # => instance of the Ack formula"
|
||||
|
@ -2,7 +2,7 @@ require 'formula'
|
||||
require 'tab'
|
||||
require 'set'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def leaves
|
||||
installed = Formula.installed
|
||||
deps_of_installed = Set.new
|
||||
|
@ -1,7 +1,6 @@
|
||||
require 'ostruct'
|
||||
|
||||
module Homebrew extend self
|
||||
|
||||
module Homebrew
|
||||
def link
|
||||
raise KegUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
# Links any Applications (.app) found in installed prefixes to /Applications
|
||||
require 'keg'
|
||||
|
||||
module Homebrew extend self
|
||||
|
||||
module Homebrew
|
||||
def linkapps
|
||||
target_dir = ARGV.include?("--local") ? File.expand_path("~/Applications") : "/Applications"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "metafiles"
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def list
|
||||
|
||||
# Use of exec means we don't explicitly exit
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def log
|
||||
if ARGV.named.empty?
|
||||
cd HOMEBREW_REPOSITORY
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'formula'
|
||||
require 'tab'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def missing_deps ff
|
||||
missing = {}
|
||||
ff.each do |f|
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'formula'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def options
|
||||
if ARGV.include? '--all'
|
||||
puts_options Formula.to_a
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'formula'
|
||||
require 'keg'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def outdated
|
||||
outdated_brews do |f, versions|
|
||||
if ($stdout.tty? || ARGV.verbose?) and not ARGV.flag? '--quiet'
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'formula'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def pin
|
||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'formula_installer'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def postinstall
|
||||
ARGV.formulae.each {|f| f.post_install }
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'keg'
|
||||
require 'cmd/tap'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def prune
|
||||
ObserverPathnameExtension.reset_counts!
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'cmd/install'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def reinstall
|
||||
ARGV.formulae.each { |f| reinstall_formula(f) }
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ require 'blacklist'
|
||||
require 'utils'
|
||||
require 'thread'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
|
||||
SEARCH_ERROR_QUEUE = Queue.new
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'extend/ENV'
|
||||
require 'formula'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def sh
|
||||
ENV.activate_extensions!
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
module Homebrew extend self
|
||||
|
||||
module Homebrew
|
||||
def tap
|
||||
if ARGV.empty?
|
||||
each_tap do |user, repo|
|
||||
|
@ -3,7 +3,7 @@ require 'hardware'
|
||||
require 'keg'
|
||||
require 'timeout'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
TEST_TIMEOUT_SECONDS = 5*60
|
||||
|
||||
if defined?(Gem)
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def tests
|
||||
(HOMEBREW_LIBRARY/'Homebrew/test').cd do
|
||||
ENV['TESTOPTS'] = '-v' if ARGV.verbose?
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'keg'
|
||||
require 'formula'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def uninstall
|
||||
raise KegUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def unlink
|
||||
raise KegUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
# Unlinks any Applications (.app) found in installed prefixes from /Applications
|
||||
require 'keg'
|
||||
|
||||
module Homebrew extend self
|
||||
|
||||
module Homebrew
|
||||
def unlinkapps
|
||||
target_dir = ARGV.include?("--local") ? File.expand_path("~/Applications") : "/Applications"
|
||||
|
||||
|
@ -2,8 +2,6 @@ require "stringio"
|
||||
require "formula"
|
||||
|
||||
module Homebrew
|
||||
extend self
|
||||
|
||||
module DATALoader
|
||||
# Original code from http://stackoverflow.com/a/2157556/371237
|
||||
def self.load(path)
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'formula'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def unpin
|
||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
require 'cmd/tap' # for tap_args
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def untap
|
||||
raise "Usage is `brew untap <tap-name>`" if ARGV.empty?
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'cmd/tap'
|
||||
require 'cmd/untap'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def update
|
||||
unless ARGV.named.empty?
|
||||
abort <<-EOS.undent
|
||||
|
@ -1,7 +1,7 @@
|
||||
require 'cmd/install'
|
||||
require 'cmd/outdated'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def upgrade
|
||||
Homebrew.perform_preinstall_checks
|
||||
|
||||
|
@ -4,7 +4,7 @@ require 'formula'
|
||||
# If you want the union, run the command twice and concatenate the results.
|
||||
# The intersection is harder to achieve with shell tools.
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def uses
|
||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
require "formula"
|
||||
require "formula_versions"
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
def versions
|
||||
raise "Please `brew install git` first" unless which "git"
|
||||
raise "Please `brew update` first" unless (HOMEBREW_REPOSITORY/".git").directory?
|
||||
|
@ -93,8 +93,9 @@ HOMEBREW_CURL_ARGS = '-f#LA'
|
||||
|
||||
require 'tap_constants'
|
||||
|
||||
module Homebrew extend self
|
||||
module Homebrew
|
||||
include FileUtils
|
||||
extend self
|
||||
|
||||
attr_accessor :failed
|
||||
alias_method :failed?, :failed
|
||||
|
@ -65,6 +65,7 @@ end
|
||||
|
||||
module Homebrew
|
||||
include FileUtils
|
||||
extend self
|
||||
|
||||
module VersionAssertions
|
||||
def version v
|
||||
|
Loading…
x
Reference in New Issue
Block a user