Class: XcodeRequirement Private
- Inherits:
-
Requirement
- Object
- Requirement
- XcodeRequirement
- Defined in:
- requirements/xcode_requirement.rb,
extend/os/linux/requirements/xcode_requirement.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
A requirement on Xcode.
Constant Summary
Constants included from Dependable
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
private
Attributes inherited from Requirement
Attributes included from Dependable
Instance Method Summary collapse
-
#display_s ⇒ Object
private
-
#initialize(tags = []) ⇒ XcodeRequirement
constructor
private
A new instance of XcodeRequirement.
-
#inspect ⇒ String
private
-
#message ⇒ String
private
-
#xcode_installed_version ⇒ Boolean
Methods inherited from Requirement
#==, #env, env, #env_proc, expand, #fatal?, #hash, #mktemp, #modify_build_environment, #option_names, prune, prune?, #satisfied?, #satisfied_result_parent, satisfy
Methods included from BuildEnvironment::DSL
Methods included from Cachable
Methods included from Dependable
#build?, #option_tags, #optional?, #options, #prune_from_option?, #prune_if_build_and_not_dependent?, #recommended?, #required?, #test?
Constructor Details
#initialize(tags = []) ⇒ XcodeRequirement
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Returns a new instance of XcodeRequirement.
19 20 21 22 |
# File 'requirements/xcode_requirement.rb', line 19 def initialize( = []) @version = .shift if .first.to_s.match?(/(\d\.)+\d/) super() end |
Instance Attribute Details
#version ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
12 13 14 |
# File 'requirements/xcode_requirement.rb', line 12 def version @version end |
Instance Method Details
#display_s ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
58 59 60 61 62 |
# File 'requirements/xcode_requirement.rb', line 58 def display_s return "#{name.capitalize} (on macOS)" unless @version "#{name.capitalize} >= #{@version} (on macOS)" end |
#inspect ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
54 55 56 |
# File 'requirements/xcode_requirement.rb', line 54 def inspect "#<#{self.class.name}: version>=#{@version.inspect} #{.inspect}>" end |
#message ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'requirements/xcode_requirement.rb', line 33 def version = " #{@version}" if @version = <<~EOS A full installation of Xcode.app#{version} is required to compile this software. Installing just the Command Line Tools is not sufficient. EOS if @version && Version.new(MacOS::Xcode.latest_version) < Version.new(@version) + <<~EOS Xcode#{version} cannot be installed on macOS #{MacOS.version}. You must upgrade your version of macOS. EOS else + <<~EOS Xcode can be installed from the App Store. EOS end end |
#xcode_installed_version ⇒ Boolean
8 9 10 |
# File 'extend/os/linux/requirements/xcode_requirement.rb', line 8 def xcode_installed_version true end |