Class: BuildEnvironment Private

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

Instance Method Summary collapse

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:



11
12
13
# File 'build_environment.rb', line 11

def initialize(*settings)
  @settings = Set.new(settings)
end

Class Method Details

.dump(env, f = $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 (T.untyped)
  • f (IO) (defaults to: $stdout)


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'build_environment.rb', line 69

def self.dump(env, f = $stdout)
  keys = self.keys(env)
  keys -= %w[CC CXX OBJC OBJCXX] if env["CC"] == env["HOMEBREW_CC"]

  keys.each do |key|
    value = env.fetch(key)
    s = +"#{key}: #{value}"
    case key
    when "CC", "CXX", "LD"
      s << " => #{Pathname.new(value).realpath}" if File.symlink?(value)
    end
    s.freeze
    f.puts s
  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 (T.untyped)

Returns:



64
65
66
# File 'build_environment.rb', line 64

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

Instance Method Details

#<<(o) ⇒ 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:

Returns:

  • (T.self_type)


22
23
24
25
# File 'build_environment.rb', line 22

def <<(o)
  @settings << o
  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:

Returns:

  • (T.self_type)


16
17
18
19
# File 'build_environment.rb', line 16

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)


28
29
30
# File 'build_environment.rb', line 28

def std?
  @settings.include? :std
end

#userpaths?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)


33
34
35
# File 'build_environment.rb', line 33

def userpaths?
  @settings.include? :userpaths
end