Ruby on Rails: script / my_script vs rake my_namespace: my_task

How to decide to place functions in generatoras a script or rake(or thortask?

Some examples:

In thinking-sphinx, rake ts:startstart the daemon sphinx. But in delayed_job, the scipt/delayed_job startdaemon will launch. More or less the same functionality (apparently), but different approaches.

Are there obvious reasons for choosing between the two, that is, why was script/generate model, say, chosenrake generate:model

+3
source share
2 answers

. Rails 3 script (rails), .

, Rake Rails, Railtie (Railtie docs) rake_tasks.

+1

, / rails script. , .

, script , , , , . , /script, . , , script/generate, rails , , rake.

0

Source: https://habr.com/ru/post/1781790/


All Articles