Skip to content

Namespaces

mrflip edited this page Mar 4, 2012 · 6 revisions

By default, your Thor tasks are invoked using Ruby namespace. This class has no namespace:

class App < Thor
  # tasks
end

Its tasks are invoked as:

thor app:install name --force

However, you could namespace your class as:

module Sinatra
  class App < Thor
    # tasks
  end
end

And then you should invoke your tasks as:

thor sinatra:app:install name --force

If desired, you can change the namespace:

module Sinatra
  class App < Thor
    namespace :myapp
    # tasks
  end
end

And then your tasks should be invoked as:

thor myapp:install name --force
Clone this wiki locally