Module: EnvActivation

Defined in:
brew/Library/Homebrew/extend/ENV.rb

Instance Method Summary collapse

Instance Method Details

#activate_extensions!Object



13
14
15
16
17
18
19
# File 'brew/Library/Homebrew/extend/ENV.rb', line 13

def activate_extensions!
  if superenv?
    extend(Superenv)
  else
    extend(Stdenv)
  end
end

#clear_sensitive_environment!Object



32
33
34
35
36
37
38
# File 'brew/Library/Homebrew/extend/ENV.rb', line 32

def clear_sensitive_environment!
  each_key do |key|
    next unless /(cookie|key|token|password)/i =~ key

    delete key
  end
end

#with_build_environmentObject



21
22
23
24
25
26
27
28
29
30
# File 'brew/Library/Homebrew/extend/ENV.rb', line 21

def with_build_environment
  old_env = to_hash.dup
  tmp_env = to_hash.dup.extend(EnvActivation)
  tmp_env.activate_extensions!
  tmp_env.setup_build_environment
  replace(tmp_env)
  yield
ensure
  replace(old_env)
end