Posted almost 3 years ago. Visible to the public.

Rake

  • What is rake good for?
  • Take a look at some of the Rake tasks that Rails gives you (rake -T within a Rails project)
  • Find the code that defines the rake stats task in the Rails gems
  • What are some ways how a Rake task can execute another task?
  • What does it mean if a Rake task "depends" on another task? E.g. understand what it means for a Rake task within a Rails app to depend on :environment.
  • Write a Rake task rake public_methods that lists all public methods of all models in app/models.
    • Hint: Don't manually parse the source code. You can ask a Ruby class: Klass.public_methods.
  • Use a namespace to rename your task to rake models:public_methods
  • Give your task a nice description and notice how it appears in rake -T

Author of this card:

Avatar
Henning Koch
Last edit:
almost 3 years ago
by Henning Koch
Posted by Henning Koch to makandra Curriculum
This website uses cookies to improve usability and analyze traffic.
Accept or learn more