Rake and Thor use different goals.
Rake is a generic script build tool that depends on the project. In other words, you put your rakefile in your project folder and in the original project control, and you can create, create and perform other automation tasks specific to your project in this rake file. Rake requires the launch of the rake file.
Thor is a general-purpose command-line command-line tool that makes it easy to reuse scripts in many projects, as well as for setting up a project, etc., as you suggest. Thor allows you to "install" an executable script file that you can call from anywhere on your system, like calling ruby , gem , or rake . However, Thor scripts are more suitable for general purpose, cross-application automation, because Thor script does not rely on the file sitting in your folder specific to your project. Thor script is an entire script packaged and installed for reuse anywhere.
According to your stated needs, you are better off using Thor because you can install the script in one place and work anywhere in your system. You will not be attached to where the rake file or something like that is located.
By the way, Rails 3 uses Thor for almost everything that is not related to the project. You still have the Rake file, and you still run things like " rake db:migrate " or " rake test:units ". Thor is used for things like " rails new ... ", " rails server " and " rails generate ... ". Using Thor AND Rake in Rails 3 is a great illustration of where each of these tools works best.
Derick Bailey Aug 20 '10 at 14:22 2010-08-20 14:22
source share