Class: InEnv

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_make_script/utils.rb

Instance Method Summary collapse

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

#enterObject



125
126
127
128
# File 'lib/ruby_make_script/utils.rb', line 125

def enter
    @v0 = ENV[@k]
    ENV[@k] = @v
end

#exitObject



130
131
132
# File 'lib/ruby_make_script/utils.rb', line 130

def exit
    ENV[@k] = @v0
end