From: James Britt Date: 2007-01-16T05:17:11+09:00 Subject: Q: How can a Rake task know the caller's directory? I'm increasingly using rake files for common system tasks. Since Rake will search up a directory tree until it finds a Rakefile, I can have one in my home directory and call tasks from anyplace below that. But tasks that need to know something about the current directory have me stymied. Calling Dir.pwd in a task reflects the directory of the Rakefile. Is there a rake method that returns the path of where the Rakefile search began? E.g., if I'm in /home/james/foo/bar, and the nearest Rakefile is in /home/james, with task :whereami, and I call $ rake whereami what does :whereami have to do to return '/home/james/foo/bar' ? Thanks! -- James Britt