Ruby 3.0.0 リファレンスマニュアル > ライブラリ一覧 > rakeライブラリ > Rake::FileTaskクラス > timestamp

instance method Rake::FileTask#timestamp

timestamp -> Time | Rake::LateTime[permalink][rdoc]

ファイルタスクのタイムスタンプを返します。


# Rakefile での記載例とする

task default: "test.txt"
file "test.txt" do |task|
  Rake.application.options.build_all = false
  task.timestamp # => #<Rake::LateTime:0x2ba58f0>
end