Spec-Zone.ru › Homebrew

Class: BuildEnvironment Private

Inherits:
Object
  • Object
  • BuildEnvironment
show all
Defined in:
build_environment.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.

Settings for the build environment.

Defined Under Namespace

Modules: DSL

Class Method Summary collapse

  • .dump(env, out = $stdout) ⇒ void private
  • .keys(env) ⇒ Array<String> private

Instance Method Summary collapse

  • #<<(option) ⇒ T.self_type private
  • #initialize(*settings) ⇒ void constructor private
  • #merge(*args) ⇒ T.self_type private
  • #std? ⇒ Boolean private

Constructor Details

#initialize(*settings) ⇒ void

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.

Parameters:

  • settings (Symbol)


7
8
9
# File 'build_environment.rb', line 7

def initialize(*settings)
  @settings = T.let(Set.new(settings), T::Set[Symbol])
end

Class Method Details

.dump(env, out = $stdout) ⇒ void

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.

This method returns an undefined value.

Parameters:

  • env (Hash{String => String, Boolean, PATH, nil})
  • out (IO) (defaults to: $stdout)


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'build_environment.rb', line 71

def self.dump(env, out = $stdout)
  keys = self.keys(env)
  keys -= %w[CCCXXOBJCOBJCXX] if env["CC"] == env["HOMEBREW_CC"]

  keys.each do |key|
    value = env.fetch(key)

    string = "#{key}: #{value}"
    case key
    when "CC", "CXX", "LD"
      value = T.cast(value, String)
      string << " => #{Pathname.new(value).realpath}" if value.present? && File.symlink?(value)
    end
    string.freeze
    out.puts string
  end
end

.keys(env) ⇒ Array<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.

Parameters:

  • env (Hash{String => String, Boolean, PATH, nil})

Returns:

  • (Array<String>)


66
67
68
# File 'build_environment.rb', line 66

def self.keys(env)
  KEYS & env.keys
end

Instance Method Details

#<<(option) ⇒ T.self_type

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.

Parameters:

  • option (Symbol)

Returns:

  • (T.self_type)


18
19
20
21
# File 'build_environment.rb', line 18

def <<(option)
  @settings << option
  self
end

#merge(*args) ⇒ T.self_type

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.

Parameters:

  • args (Enumerable<Symbol>)

Returns:

  • (T.self_type)


12
13
14
15
# File 'build_environment.rb', line 12

def merge(*args)
  @settings.merge(*args)
  self
end

#std? ⇒ Boolean

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)


24
25
26
# File 'build_environment.rb', line 24

def std?
  @settings.include? :std
end

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/BuildEnvironment.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API