Method: Rails::Command::Base.namespace

Defined in:
railties/lib/rails/command/base.rb

.namespace(name = nil) ⇒ Object

Convenience method to get the namespace from the class name. It’s the same as Thor default except that the Command at the end of the class is removed.



45
46
47
48
49
50
51
# File 'railties/lib/rails/command/base.rb', line 45

def namespace(name = nil)
  if name
    super
  else
    @namespace ||= super.chomp("_command").sub(/:command:/, ":")
  end
end