Module: EnvActivation

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

Instance Method Summary collapse

Instance Method Details

#activate_extensions!Object



11
12
13
14
15
16
17
# File 'Library/Homebrew/extend/ENV.rb', line 11

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

#clear_sensitive_environment!Object



30
31
32
33
34
35
# File 'Library/Homebrew/extend/ENV.rb', line 30

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

#with_build_environmentObject



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

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