Class: XcodeRequirement Private

Inherits:
Requirement show all
Extended by:
T::Sig
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

Dependable::RESERVED_TAGS

Instance Attribute Summary collapse

Attributes inherited from Requirement

#cask, #download, #name, #tags

Instance Method Summary collapse

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

#env

Methods included from Cachable

#cache, #clear_cache

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.



18
19
20
21
# File 'requirements/xcode_requirement.rb', line 18

def initialize(tags = [])
  @version = tags.shift if tags.first.to_s.match?(/(\d\.)+\d/)
  super(tags)
end

Instance Attribute Details

#versionObject (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.



14
15
16
# File 'requirements/xcode_requirement.rb', line 14

def version
  @version
end

Instance Method Details

#display_sObject

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.



57
58
59
60
61
# File 'requirements/xcode_requirement.rb', line 57

def display_s
  return name.capitalize unless @version

  "#{name.capitalize} >= #{@version}"
end

#inspectString

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:



53
54
55
# File 'requirements/xcode_requirement.rb', line 53

def inspect
  "#<#{self.class.name}: version>=#{@version.inspect} #{tags.inspect}>"
end

#messageString

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:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'requirements/xcode_requirement.rb', line 32

def message
  version = " #{@version}" if @version
  message = <<~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)
    message + <<~EOS

      Xcode#{version} cannot be installed on macOS #{MacOS.version}.
      You must upgrade your version of macOS.
    EOS
  else
    message + <<~EOS

      Xcode can be installed from the App Store.
    EOS
  end
end

#xcode_installed_versionBoolean

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:

  • (Boolean)


10
11
12
# File 'extend/os/linux/requirements/xcode_requirement.rb', line 10

def xcode_installed_version
  true
end