Class: Rake::Delphi::EnvVariables
- Inherits:
-
Array
- Object
- Array
- Rake::Delphi::EnvVariables
- Defined in:
- lib/rake/delphi/envvariables.rb
Instance Method Summary collapse
- #add(var, value) ⇒ Object
- #expand(value) ⇒ Object
- #expand_vars ⇒ Object
-
#initialize(regpath, delphidir) ⇒ EnvVariables
constructor
A new instance of EnvVariables.
Constructor Details
#initialize(regpath, delphidir) ⇒ EnvVariables
Returns a new instance of EnvVariables.
15 16 17 18 19 20 |
# File 'lib/rake/delphi/envvariables.rb', line 15 def initialize(regpath, delphidir) _dir = delphidir.gsub(/\/$/, '') add('DELPHI', _dir) add('BDS', _dir) end |
Instance Method Details
#add(var, value) ⇒ Object
22 23 24 |
# File 'lib/rake/delphi/envvariables.rb', line 22 def add(var, value) self << EnvVariable.new(var, value) end |
#expand(value) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/rake/delphi/envvariables.rb', line 26 def (value) self.each do |ev| value.gsub!("$(#{ev.name})", ev.value) end value end |
#expand_vars ⇒ Object
33 34 35 36 37 38 |
# File 'lib/rake/delphi/envvariables.rb', line 33 def self.map! do |v| v.value = (v.value) v end end |