Method: FileSystem.in_dir

Defined in:
lib/atk/file_system.rb

.in_dir(path_to_somewhere) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
# File 'lib/atk/file_system.rb', line 132

def self.in_dir(path_to_somewhere)
    # save the current working dir
    current_dir = Dir.pwd
    # switch dirs
    Dir.chdir(path_to_somewhere)
    # do the thing
    output = yield
    # switch back
    Dir.chdir(current_dir)
    return output
end