このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ

Ruby 2.2.0 リファレンスマニュアル

instance method Rake::Application#original_dir

original_dir -> String[permalink][rdoc]

rake コマンドを実行したディレクトリを返します。

# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
  Rake.application.original_dir # => "/path/to/dir"
end