Class: InEnv
- Inherits:
-
Object
- Object
- InEnv
- Defined in:
- lib/ruby_make_script/utils.rb
Instance Method Summary collapse
- #enter ⇒ Object
- #exit ⇒ Object
-
#initialize(expr) ⇒ InEnv
constructor
A new instance of InEnv.
Constructor Details
#initialize(expr) ⇒ InEnv
Returns a new instance of InEnv.
121 122 123 |
# File 'lib/ruby_make_script/utils.rb', line 121 def initialize(expr) @k, @v = expr.split('=') end |
Instance Method Details
#enter ⇒ Object
125 126 127 128 |
# File 'lib/ruby_make_script/utils.rb', line 125 def enter @v0 = ENV[@k] ENV[@k] = @v end |
#exit ⇒ Object
130 131 132 |
# File 'lib/ruby_make_script/utils.rb', line 130 def exit ENV[@k] = @v0 end |