Class: InDir

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

Instance Method Summary collapse

Constructor Details

#initialize(path, err = true) ⇒ InDir

Returns a new instance of InDir.



89
90
91
92
# File 'lib/ruby_make_script/utils.rb', line 89

def initialize(path, err=true)
    @path = path
    @err = err
end

Instance Method Details

#enterObject



94
95
96
97
98
99
100
101
# File 'lib/ruby_make_script/utils.rb', line 94

def enter
    @orig = Dir.pwd
    if @err
        cd @path
    else
        cd? @path
    end
end

#exitObject



103
104
105
106
107
108
109
# File 'lib/ruby_make_script/utils.rb', line 103

def exit
    if @err
        cd @orig
    else
        cd? @orig
    end
end