= private = protected
chdir(path = nil)
If called as iterator, it restores the current directory when the block ends.
# File lib/shell.rb, line 144 def chdir(path = nil) if iterator? cwd_old = @cwd begin chdir(path) yield ensure chdir(cwd_old) end else path = "~" unless path @cwd = expand_path(path) notify "current dir: #{@cwd}" rehash self end end