It provides a clear structure for processing command line arguments,
Thor is like rake on steroids, with support for command line arguments, lack of a DSL in favor of plain old classes (class Spoons < Thor), system wide tasks (like sake), and support for remote tasks.
Yehuda Katz, Thor's author, has a great writeup on the hows and why of Thor.
# module: random class Amazing < Thor desc "describe NAME", "say that someone is amazing" method_options :forcefully => :boolean def describe(name) ret = "#{name} is amazing" puts options["forcefully"] ? ret.upcase : ret end desc "hello", "say hello" def hello puts "Hello" end end
$ thor amazing:hello
$ thor install task.thor
will install task.thor Thor file. You can also install thor tasks from a url:
$ thor install http://merbivore.com/merb.thor
In both cases, Thor will prompt you before installing the tasks.
You can also have thor alias the task:
$ thor install task.thor --as my_awesome_task
You can update installed tasks really easily:
$ thor update my_awesome_task
and Thor will remember where you got the task from, and redownload it.
You can get a list of all installed thor tasks on your system with:
$ thor installed