method

namespace

ruby latest stable - Class: Bundler::Thor::Base::ClassMethods

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

namespace(name = nil)
public

Sets the namespace for the Bundler::Thor or Bundler::Thor::Group class. By default the namespace is retrieved from the class name. If your Bundler::Thor class is named Scripts::MyScript, the help method, for example, will be called as:

thor scripts:my_script -h

If you change the namespace:

namespace :my_scripts

You change how your commands are invoked:

thor my_scripts -h

Finally, if you change your namespace to default:

namespace :default

Your commands can be invoked with a shortcut. Instead of:

thor :my_command