LoginSignup
2
0

More than 5 years have passed since last update.

Railsのrakeタスクの定義箇所を調べる

Posted at

railsのrakeタスクがどこで定義されているか調べたい。

今回はrake time:zones:localの実装がどこで行われているか調べてみた。

rails console上で以下のようにすればよい。

> Rails.application.load_tasks
> Rake.application['time:zones:local'].actions.map(&:source_location)
#=> [["/.../.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.4/lib/rails/tasks/misc.rake", 40]]
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0