module Thor::Actions
def thor(task, *args)
#=> thor list --all --substring=rails
thor :list, :all => true, :substring => 'rails'
#=> thor install http://gist.github.com/103208
thor :install, "http://gist.github.com/103208"
==== Examples
Other options are given as parameter to Thor.
config
args
task
==== Parameters
switches.
Run a thor command. A hash of options can be given and it's converted to
def thor(task, *args) config = args.last.is_a?(Hash) ? args.pop : {} verbose = config.key?(:verbose) ? config.delete(:verbose) : true pretend = config.key?(:pretend) ? config.delete(:pretend) : false capture = config.key?(:capture) ? config.delete(:capture) : false args.unshift task args.push Thor::Options.to_switches(config) command = args.join(' ').strip run command, :with => :thor, :verbose => verbose, :pretend => pretend, :capture => capture end