Mega Code Archive

 
Categories / Ruby / File Directory
 

Compare a variable storing a directory path with the current directory

ruby_progs = "/Users/Ruby" if not Dir.pwd == ruby_progs   Dir.chdir ruby_progs end