Class: BuildEnvironment Private

Inherits:
Object
  • Object
show all
Defined in:
Library/Homebrew/build_environment.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Settings for the build environment.

Defined Under Namespace

Modules: DSL

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*settings) ⇒ BuildEnvironment

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of BuildEnvironment.


7
8
9
# File 'Library/Homebrew/build_environment.rb', line 7

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

Class Method Details

.dump(env, f = $stdout) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'Library/Homebrew/build_environment.rb', line 56

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[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) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


52
53
54
# File 'Library/Homebrew/build_environment.rb', line 52

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

Instance Method Details

#<<(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


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

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

#merge(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


11
12
13
14
# File 'Library/Homebrew/build_environment.rb', line 11

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

#std?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

21
22
23
# File 'Library/Homebrew/build_environment.rb', line 21

def std?
  @settings.include? :std
end

#userpaths?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

25
26
27
# File 'Library/Homebrew/build_environment.rb', line 25

def userpaths?
  @settings.include? :userpaths
end