Class: BuildEnvironment Private

Inherits:
Object 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

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:



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

def initialize(*settings)
  @settings = Set.new(settings)
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:



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

def self.dump(env, out = $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)

    string = +"#{key}: #{value}"
    case key
    when "CC", "CXX", "LD"
      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:

Returns:



61
62
63
# File 'build_environment.rb', line 61

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:

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:

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