aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb25
-rw-r--r--Library/Homebrew/requirement.rb6
2 files changed, 5 insertions, 26 deletions
diff --git a/Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb b/Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb
index ae4f5b8ed..0c319d1de 100644
--- a/Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb
+++ b/Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb
@@ -1,21 +1,9 @@
require "requirement"
-class XQuartzRequirement < Requirement
- include Comparable
-
- fatal true
+class X11Requirement < Requirement
cask "xquartz"
download "https://xquartz.macosforge.org"
- env { ENV.x11 }
-
- def initialize(name = "x11", tags = [])
- @name = name
- # no-op on version specified as a tag argument
- tags.shift if /(\d\.)+\d/ =~ tags.first
- super(tags)
- end
-
def min_version
MacOS::XQuartz.minimum_version
end
@@ -28,15 +16,4 @@ class XQuartzRequirement < Requirement
def message
"XQuartz #{min_version} (or newer) is required to install this formula. #{super}"
end
-
- def <=>(other)
- return unless other.is_a? X11Requirement
- 0
- end
-
- def inspect
- "#<#{self.class.name}: #{name.inspect} #{tags.inspect}>"
- end
end
-
-X11Requirement = XQuartzRequirement
diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb
index 95807d5ae..91f84157e 100644
--- a/Library/Homebrew/requirement.rb
+++ b/Library/Homebrew/requirement.rb
@@ -170,8 +170,10 @@ class Requirement
attr_rw :fatal, :default_formula
attr_rw :cask, :download
- def satisfy(options = {}, &block)
- @satisfied ||= Requirement::Satisfier.new(options, &block)
+ def satisfy(options = nil, &block)
+ return @satisfied if options.nil? && !block_given?
+ options = {} if options.nil?
+ @satisfied = Requirement::Satisfier.new(options, &block)
end
def env(*settings, &block)