Options: verbose
Changes the current directory to the directory dir.
If this method is called with block, resumes to the old working directory after the block execution finished.
FileUtils.cd('/', :verbose => true) # chdir and report it
Source Code
# File fileutils.rb, line 118 def cd(dir, options = {}, &block) # :yield: dir fu_check_options options, OPT_TABLE['cd'] fu_output_message "cd #{dir}" if options[:verbose] Dir.chdir(dir, &block) fu_output_message 'cd -' if options[:verbose] and block end
<code/>and<pre/>for code samples.