Refactor using Forwardable and DelegateClass.
This commit is contained in:
parent
4fb60d8988
commit
3b4ee58c49
@ -1,6 +1,8 @@
|
|||||||
module Hbc
|
module Hbc
|
||||||
module Artifact
|
module Artifact
|
||||||
class Base
|
class Base
|
||||||
|
extend Predicable
|
||||||
|
|
||||||
def self.artifact_name
|
def self.artifact_name
|
||||||
@artifact_name ||= name.sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase
|
@artifact_name ||= name.sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase
|
||||||
end
|
end
|
||||||
@ -65,13 +67,7 @@ module Hbc
|
|||||||
{}
|
{}
|
||||||
end
|
end
|
||||||
|
|
||||||
def verbose?
|
attr_predicate :force?, :verbose?
|
||||||
@verbose
|
|
||||||
end
|
|
||||||
|
|
||||||
def force?
|
|
||||||
@force
|
|
||||||
end
|
|
||||||
|
|
||||||
def initialize(cask, command: SystemCommand, force: false, verbose: false)
|
def initialize(cask, command: SystemCommand, force: false, verbose: false)
|
||||||
@cask = cask
|
@cask = cask
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
require "forwardable"
|
|
||||||
|
|
||||||
require "hbc/dsl"
|
require "hbc/dsl"
|
||||||
require "hbc/metadata"
|
require "hbc/metadata"
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +1,27 @@
|
|||||||
module Hbc
|
module Hbc
|
||||||
module Checkable
|
module Checkable
|
||||||
def errors
|
def errors
|
||||||
Array(@errors)
|
@errors ||= []
|
||||||
end
|
end
|
||||||
|
|
||||||
def warnings
|
def warnings
|
||||||
Array(@warnings)
|
@warnings ||= []
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_error(message)
|
def add_error(message)
|
||||||
@errors ||= []
|
errors << message
|
||||||
@errors << message
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_warning(message)
|
def add_warning(message)
|
||||||
@warnings ||= []
|
warnings << message
|
||||||
@warnings << message
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def errors?
|
def errors?
|
||||||
Array(@errors).any?
|
errors.any?
|
||||||
end
|
end
|
||||||
|
|
||||||
def warnings?
|
def warnings?
|
||||||
Array(@warnings).any?
|
warnings.any?
|
||||||
end
|
end
|
||||||
|
|
||||||
def result
|
def result
|
||||||
|
|||||||
@ -6,6 +6,7 @@ require "hbc/verify"
|
|||||||
|
|
||||||
module Hbc
|
module Hbc
|
||||||
class Installer
|
class Installer
|
||||||
|
extend Predicable
|
||||||
# TODO: it is unwise for Hbc::Staged to be a module, when we are
|
# TODO: it is unwise for Hbc::Staged to be a module, when we are
|
||||||
# dealing with both staged and unstaged Casks here. This should
|
# dealing with both staged and unstaged Casks here. This should
|
||||||
# either be a class which is only sometimes instantiated, or there
|
# either be a class which is only sometimes instantiated, or there
|
||||||
@ -27,21 +28,7 @@ module Hbc
|
|||||||
@reinstall = false
|
@reinstall = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def skip_cask_deps?
|
attr_predicate :binaries?, :force?, :skip_cask_deps?, :require_sha?, :verbose?
|
||||||
@skip_cask_deps
|
|
||||||
end
|
|
||||||
|
|
||||||
def force?
|
|
||||||
@force
|
|
||||||
end
|
|
||||||
|
|
||||||
def binaries?
|
|
||||||
@binaries
|
|
||||||
end
|
|
||||||
|
|
||||||
def verbose?
|
|
||||||
@verbose
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.print_caveats(cask)
|
def self.print_caveats(cask)
|
||||||
odebug "Printing caveats"
|
odebug "Printing caveats"
|
||||||
@ -75,7 +62,7 @@ module Hbc
|
|||||||
odebug "Hbc::Installer#fetch"
|
odebug "Hbc::Installer#fetch"
|
||||||
|
|
||||||
satisfy_dependencies
|
satisfy_dependencies
|
||||||
verify_has_sha if @require_sha && !force?
|
verify_has_sha if require_sha? && !force?
|
||||||
download
|
download
|
||||||
verify
|
verify
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
require "forwardable"
|
|
||||||
|
|
||||||
module Hbc
|
module Hbc
|
||||||
class URL
|
class URL
|
||||||
FAKE_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10) https://caskroom.github.io".freeze
|
FAKE_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10) https://caskroom.github.io".freeze
|
||||||
|
|||||||
@ -14,14 +14,14 @@ class Object
|
|||||||
end
|
end
|
||||||
|
|
||||||
class Buffer < StringIO
|
class Buffer < StringIO
|
||||||
|
extend Predicable
|
||||||
|
|
||||||
|
attr_predicate :tty?
|
||||||
|
|
||||||
def initialize(tty = false)
|
def initialize(tty = false)
|
||||||
super()
|
super()
|
||||||
@tty = tty
|
@tty = tty
|
||||||
end
|
end
|
||||||
|
|
||||||
def tty?
|
|
||||||
@tty
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# global methods
|
# global methods
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
class Caveats
|
class Caveats
|
||||||
|
extend Forwardable
|
||||||
|
|
||||||
attr_reader :f
|
attr_reader :f
|
||||||
|
|
||||||
def initialize(f)
|
def initialize(f)
|
||||||
@ -25,9 +27,7 @@ class Caveats
|
|||||||
caveats.compact.join("\n")
|
caveats.compact.join("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty?
|
delegate [:empty?, :to_s] => :caveats
|
||||||
caveats.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
class Checksum
|
class Checksum
|
||||||
|
extend Forwardable
|
||||||
|
|
||||||
attr_reader :hash_type, :hexdigest
|
attr_reader :hash_type, :hexdigest
|
||||||
alias to_s hexdigest
|
|
||||||
|
|
||||||
TYPES = [:sha256].freeze
|
TYPES = [:sha256].freeze
|
||||||
|
|
||||||
@ -9,9 +10,7 @@ class Checksum
|
|||||||
@hexdigest = hexdigest
|
@hexdigest = hexdigest
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty?
|
delegate [:empty?, :to_s] => :@hexdigest
|
||||||
hexdigest.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def ==(other)
|
def ==(other)
|
||||||
hash_type == other.hash_type && hexdigest == other.hexdigest
|
hash_type == other.hash_type && hexdigest == other.hexdigest
|
||||||
|
|||||||
@ -169,8 +169,8 @@ module Homebrew
|
|||||||
Homebrew.dump_options_for_formula f
|
Homebrew.dump_options_for_formula f
|
||||||
end
|
end
|
||||||
|
|
||||||
c = Caveats.new(f)
|
caveats = Caveats.new(f)
|
||||||
ohai "Caveats", c.caveats unless c.empty?
|
ohai "Caveats", caveats.to_s unless caveats.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
def decorate_dependencies(dependencies)
|
def decorate_dependencies(dependencies)
|
||||||
|
|||||||
@ -547,6 +547,8 @@ class Reporter
|
|||||||
end
|
end
|
||||||
|
|
||||||
class ReporterHub
|
class ReporterHub
|
||||||
|
extend Forwardable
|
||||||
|
|
||||||
attr_reader :reporters
|
attr_reader :reporters
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@ -564,9 +566,7 @@ class ReporterHub
|
|||||||
@hash.update(report) { |_key, oldval, newval| oldval.concat(newval) }
|
@hash.update(report) { |_key, oldval, newval| oldval.concat(newval) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty?
|
delegate :empty? => :@hash
|
||||||
@hash.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def dump
|
def dump
|
||||||
# Key Legend: Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R)
|
# Key Legend: Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R)
|
||||||
|
|||||||
@ -74,18 +74,13 @@ module Debrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class << self
|
|
||||||
alias original_raise raise
|
|
||||||
end
|
|
||||||
|
|
||||||
@active = false
|
@active = false
|
||||||
@debugged_exceptions = Set.new
|
@debugged_exceptions = Set.new
|
||||||
|
|
||||||
def self.active?
|
|
||||||
@active
|
|
||||||
end
|
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
extend Predicable
|
||||||
|
alias original_raise raise
|
||||||
|
attr_predicate :active?
|
||||||
attr_reader :debugged_exceptions
|
attr_reader :debugged_exceptions
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1,28 +1,11 @@
|
|||||||
class Dependencies
|
require "delegate"
|
||||||
include Enumerable
|
|
||||||
|
|
||||||
def initialize
|
class Dependencies < DelegateClass(Array)
|
||||||
@deps = []
|
def initialize(*args)
|
||||||
|
super(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def each(*args, &block)
|
alias eql? ==
|
||||||
@deps.each(*args, &block)
|
|
||||||
end
|
|
||||||
|
|
||||||
def <<(o)
|
|
||||||
@deps << o
|
|
||||||
self
|
|
||||||
end
|
|
||||||
|
|
||||||
def empty?
|
|
||||||
@deps.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def *(arg)
|
|
||||||
@deps * arg
|
|
||||||
end
|
|
||||||
|
|
||||||
alias to_ary to_a
|
|
||||||
|
|
||||||
def optional
|
def optional
|
||||||
select(&:optional?)
|
select(&:optional?)
|
||||||
@ -44,40 +27,28 @@ class Dependencies
|
|||||||
build + required + recommended
|
build + required + recommended
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :deps
|
|
||||||
protected :deps
|
|
||||||
|
|
||||||
def ==(other)
|
|
||||||
deps == other.deps
|
|
||||||
end
|
|
||||||
alias eql? ==
|
|
||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
"#<#{self.class.name}: #{to_a.inspect}>"
|
"#<#{self.class.name}: #{to_a}>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Requirements
|
class Requirements < DelegateClass(Set)
|
||||||
include Enumerable
|
def initialize(*args)
|
||||||
|
super(Set.new(args))
|
||||||
def initialize
|
|
||||||
@reqs = Set.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def each(*args, &block)
|
|
||||||
@reqs.each(*args, &block)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def <<(other)
|
def <<(other)
|
||||||
if other.is_a?(Comparable)
|
if other.is_a?(Comparable)
|
||||||
@reqs.grep(other.class) do |req|
|
grep(other.class) do |req|
|
||||||
return self if req > other
|
return self if req > other
|
||||||
@reqs.delete(req)
|
delete(req)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@reqs << other
|
super
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
alias to_ary to_a
|
def inspect
|
||||||
|
"#<#{self.class.name}: {#{to_a.join(", ")}}>"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2,6 +2,7 @@ require "dependable"
|
|||||||
|
|
||||||
# A dependency on another Homebrew formula.
|
# A dependency on another Homebrew formula.
|
||||||
class Dependency
|
class Dependency
|
||||||
|
extend Forwardable
|
||||||
include Dependable
|
include Dependable
|
||||||
|
|
||||||
attr_reader :name, :tags, :env_proc, :option_names
|
attr_reader :name, :tags, :env_proc, :option_names
|
||||||
@ -34,9 +35,7 @@ class Dependency
|
|||||||
formula
|
formula
|
||||||
end
|
end
|
||||||
|
|
||||||
def installed?
|
delegate installed?: :to_formula
|
||||||
to_formula.installed?
|
|
||||||
end
|
|
||||||
|
|
||||||
def satisfied?(inherited_options)
|
def satisfied?(inherited_options)
|
||||||
installed? && missing_options(inherited_options).empty?
|
installed? && missing_options(inherited_options).empty?
|
||||||
|
|||||||
@ -3,6 +3,7 @@ require "rexml/document"
|
|||||||
require "time"
|
require "time"
|
||||||
|
|
||||||
class AbstractDownloadStrategy
|
class AbstractDownloadStrategy
|
||||||
|
extend Forwardable
|
||||||
include FileUtils
|
include FileUtils
|
||||||
|
|
||||||
attr_reader :meta, :name, :version, :resource
|
attr_reader :meta, :name, :version, :resource
|
||||||
@ -181,9 +182,7 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
|
|||||||
@clone
|
@clone
|
||||||
end
|
end
|
||||||
|
|
||||||
def head?
|
delegate head?: :version
|
||||||
version.head?
|
|
||||||
end
|
|
||||||
|
|
||||||
# Return last commit's unique identifier for the repository.
|
# Return last commit's unique identifier for the repository.
|
||||||
# Return most recent modified timestamp unless overridden.
|
# Return most recent modified timestamp unless overridden.
|
||||||
|
|||||||
9
Library/Homebrew/extend/predicable.rb
Normal file
9
Library/Homebrew/extend/predicable.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
module Predicable
|
||||||
|
def attr_predicate(*attrs)
|
||||||
|
attrs.each do |attr|
|
||||||
|
define_method attr do
|
||||||
|
instance_variable_get("@#{attr.to_s.sub(/\?$/, "")}") == true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -45,6 +45,7 @@ class Formula
|
|||||||
include Utils::Inreplace
|
include Utils::Inreplace
|
||||||
include Utils::Shell
|
include Utils::Shell
|
||||||
extend Enumerable
|
extend Enumerable
|
||||||
|
extend Forwardable
|
||||||
|
|
||||||
# @!method inreplace(paths, before = nil, after = nil)
|
# @!method inreplace(paths, before = nil, after = nil)
|
||||||
# Actually implemented in {Utils::Inreplace.inreplace}.
|
# Actually implemented in {Utils::Inreplace.inreplace}.
|
||||||
@ -314,37 +315,14 @@ class Formula
|
|||||||
active_spec == head
|
active_spec == head
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
delegate [
|
||||||
def bottle_unneeded?
|
:bottle_unneeded?,
|
||||||
active_spec.bottle_unneeded?
|
:bottle_disabled?,
|
||||||
end
|
:bottle_disable_reason,
|
||||||
|
:bottle_defined?,
|
||||||
# @private
|
:bottled?,
|
||||||
def bottle_disabled?
|
:bottle_specification,
|
||||||
active_spec.bottle_disabled?
|
] => :active_spec
|
||||||
end
|
|
||||||
|
|
||||||
# @private
|
|
||||||
def bottle_disable_reason
|
|
||||||
active_spec.bottle_disable_reason
|
|
||||||
end
|
|
||||||
|
|
||||||
# Does the currently active {SoftwareSpec} have any bottle?
|
|
||||||
# @private
|
|
||||||
def bottle_defined?
|
|
||||||
active_spec.bottle_defined?
|
|
||||||
end
|
|
||||||
|
|
||||||
# Does the currently active {SoftwareSpec} have an installable bottle?
|
|
||||||
# @private
|
|
||||||
def bottled?
|
|
||||||
active_spec.bottled?
|
|
||||||
end
|
|
||||||
|
|
||||||
# @private
|
|
||||||
def bottle_specification
|
|
||||||
active_spec.bottle_specification
|
|
||||||
end
|
|
||||||
|
|
||||||
# The Bottle object for the currently active {SoftwareSpec}.
|
# The Bottle object for the currently active {SoftwareSpec}.
|
||||||
# @private
|
# @private
|
||||||
@ -353,24 +331,21 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
# The description of the software.
|
# The description of the software.
|
||||||
|
# @method desc
|
||||||
# @see .desc
|
# @see .desc
|
||||||
def desc
|
delegate desc: :"self.class"
|
||||||
self.class.desc
|
|
||||||
end
|
|
||||||
|
|
||||||
# The homepage for the software.
|
# The homepage for the software.
|
||||||
|
# @method homepage
|
||||||
# @see .homepage
|
# @see .homepage
|
||||||
def homepage
|
delegate homepage: :"self.class"
|
||||||
self.class.homepage
|
|
||||||
end
|
|
||||||
|
|
||||||
# The version for the currently active {SoftwareSpec}.
|
# The version for the currently active {SoftwareSpec}.
|
||||||
# The version is autodetected from the URL and/or tag so only needs to be
|
# The version is autodetected from the URL and/or tag so only needs to be
|
||||||
# declared if it cannot be autodetected correctly.
|
# declared if it cannot be autodetected correctly.
|
||||||
|
# @method version
|
||||||
# @see .version
|
# @see .version
|
||||||
def version
|
delegate version: :active_spec
|
||||||
active_spec.version
|
|
||||||
end
|
|
||||||
|
|
||||||
def update_head_version
|
def update_head_version
|
||||||
return unless head?
|
return unless head?
|
||||||
@ -394,9 +369,8 @@ class Formula
|
|||||||
# Additional downloads can be defined as {#resource}s.
|
# Additional downloads can be defined as {#resource}s.
|
||||||
# {Resource#stage} will create a temporary directory and yield to a block.
|
# {Resource#stage} will create a temporary directory and yield to a block.
|
||||||
# <pre>resource("additional_files").stage { bin.install "my/extra/tool" }</pre>
|
# <pre>resource("additional_files").stage { bin.install "my/extra/tool" }</pre>
|
||||||
def resource(name)
|
# @method resource
|
||||||
active_spec.resource(name)
|
delegate resource: :active_spec
|
||||||
end
|
|
||||||
|
|
||||||
# An old name for the formula
|
# An old name for the formula
|
||||||
def oldname
|
def oldname
|
||||||
@ -416,68 +390,39 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
# The {Resource}s for the currently active {SoftwareSpec}.
|
# The {Resource}s for the currently active {SoftwareSpec}.
|
||||||
def resources
|
# @method resources
|
||||||
active_spec.resources.values
|
def_delegator :"active_spec.resources", :values, :resources
|
||||||
end
|
|
||||||
|
|
||||||
# The {Dependency}s for the currently active {SoftwareSpec}.
|
# The {Dependency}s for the currently active {SoftwareSpec}.
|
||||||
# @private
|
delegate deps: :active_spec
|
||||||
def deps
|
|
||||||
active_spec.deps
|
|
||||||
end
|
|
||||||
|
|
||||||
# The {Requirement}s for the currently active {SoftwareSpec}.
|
# The {Requirement}s for the currently active {SoftwareSpec}.
|
||||||
# @private
|
delegate requirements: :active_spec
|
||||||
def requirements
|
|
||||||
active_spec.requirements
|
|
||||||
end
|
|
||||||
|
|
||||||
# The cached download for the currently active {SoftwareSpec}.
|
# The cached download for the currently active {SoftwareSpec}.
|
||||||
# @private
|
delegate cached_download: :active_spec
|
||||||
def cached_download
|
|
||||||
active_spec.cached_download
|
|
||||||
end
|
|
||||||
|
|
||||||
# Deletes the download for the currently active {SoftwareSpec}.
|
# Deletes the download for the currently active {SoftwareSpec}.
|
||||||
# @private
|
delegate clear_cache: :active_spec
|
||||||
def clear_cache
|
|
||||||
active_spec.clear_cache
|
|
||||||
end
|
|
||||||
|
|
||||||
# The list of patches for the currently active {SoftwareSpec}.
|
# The list of patches for the currently active {SoftwareSpec}.
|
||||||
# @private
|
def_delegator :active_spec, :patches, :patchlist
|
||||||
def patchlist
|
|
||||||
active_spec.patches
|
|
||||||
end
|
|
||||||
|
|
||||||
# The options for the currently active {SoftwareSpec}.
|
# The options for the currently active {SoftwareSpec}.
|
||||||
# @private
|
delegate options: :active_spec
|
||||||
def options
|
|
||||||
active_spec.options
|
|
||||||
end
|
|
||||||
|
|
||||||
# The deprecated options for the currently active {SoftwareSpec}.
|
# The deprecated options for the currently active {SoftwareSpec}.
|
||||||
# @private
|
delegate deprecated_options: :active_spec
|
||||||
def deprecated_options
|
|
||||||
active_spec.deprecated_options
|
|
||||||
end
|
|
||||||
|
|
||||||
# The deprecated option flags for the currently active {SoftwareSpec}.
|
# The deprecated option flags for the currently active {SoftwareSpec}.
|
||||||
# @private
|
delegate deprecated_flags: :active_spec
|
||||||
def deprecated_flags
|
|
||||||
active_spec.deprecated_flags
|
|
||||||
end
|
|
||||||
|
|
||||||
# If a named option is defined for the currently active {SoftwareSpec}.
|
# If a named option is defined for the currently active {SoftwareSpec}.
|
||||||
def option_defined?(name)
|
# @method option_defined?
|
||||||
active_spec.option_defined?(name)
|
delegate option_defined?: :active_spec
|
||||||
end
|
|
||||||
|
|
||||||
# All the {.fails_with} for the currently active {SoftwareSpec}.
|
# All the {.fails_with} for the currently active {SoftwareSpec}.
|
||||||
# @private
|
delegate compiler_failures: :active_spec
|
||||||
def compiler_failures
|
|
||||||
active_spec.compiler_failures
|
|
||||||
end
|
|
||||||
|
|
||||||
# If this {Formula} is installed.
|
# If this {Formula} is installed.
|
||||||
# This is actually just a check for if the {#installed_prefix} directory
|
# This is actually just a check for if the {#installed_prefix} directory
|
||||||
|
|||||||
@ -17,6 +17,7 @@ require "development_tools"
|
|||||||
|
|
||||||
class FormulaInstaller
|
class FormulaInstaller
|
||||||
include FormulaCellarChecks
|
include FormulaCellarChecks
|
||||||
|
extend Predicable
|
||||||
|
|
||||||
def self.mode_attr_accessor(*names)
|
def self.mode_attr_accessor(*names)
|
||||||
attr_accessor(*names)
|
attr_accessor(*names)
|
||||||
@ -559,11 +560,11 @@ class FormulaInstaller
|
|||||||
|
|
||||||
audit_installed if ARGV.homebrew_developer? && !formula.keg_only?
|
audit_installed if ARGV.homebrew_developer? && !formula.keg_only?
|
||||||
|
|
||||||
c = Caveats.new(formula)
|
caveats = Caveats.new(formula)
|
||||||
|
|
||||||
return if c.empty?
|
return if caveats.empty?
|
||||||
@show_summary_heading = true
|
@show_summary_heading = true
|
||||||
ohai "Caveats", c.caveats
|
ohai "Caveats", caveats.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def finish
|
def finish
|
||||||
@ -879,9 +880,7 @@ class FormulaInstaller
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def hold_locks?
|
attr_predicate :hold_locks?
|
||||||
@hold_locks || false
|
|
||||||
end
|
|
||||||
|
|
||||||
def lock
|
def lock
|
||||||
return unless (@@locked ||= []).empty?
|
return unless (@@locked ||= []).empty?
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class BottleDisableReason
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
if @type == :unneeded
|
if unneeded?
|
||||||
"This formula doesn't require compiling."
|
"This formula doesn't require compiling."
|
||||||
else
|
else
|
||||||
@reason
|
@reason
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
|
require "forwardable"
|
||||||
require "extend/module"
|
require "extend/module"
|
||||||
|
require "extend/predicable"
|
||||||
require "extend/fileutils"
|
require "extend/fileutils"
|
||||||
require "extend/pathname"
|
require "extend/pathname"
|
||||||
require "extend/git_repository"
|
require "extend/git_repository"
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
require "download_strategy"
|
require "download_strategy"
|
||||||
require "checksum"
|
require "checksum"
|
||||||
require "version"
|
require "version"
|
||||||
require "forwardable"
|
|
||||||
|
|
||||||
# Resource is the fundamental representation of an external resource. The
|
# Resource is the fundamental representation of an external resource. The
|
||||||
# primary formula download, along with other declared resources, are instances
|
# primary formula download, along with other declared resources, are instances
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
require "forwardable"
|
|
||||||
require "resource"
|
require "resource"
|
||||||
require "checksum"
|
require "checksum"
|
||||||
require "version"
|
require "version"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user