Class: SubCommandBase

Inherits:
Thor
  • Object
show all
Defined in:
lib/wanda/sub_command_base.rb

Direct Known Subclasses

Wanda::Rails

Class Method Summary collapse

Class Method Details



4
5
6
# File 'lib/wanda/sub_command_base.rb', line 4

def self.banner(command, _namespace = nil, _subcommand = false)
  "#{basename} #{subcommand_prefix} #{command.usage}"
end

.subcommand_prefixObject



8
9
10
# File 'lib/wanda/sub_command_base.rb', line 8

def self.subcommand_prefix
  name.gsub(/.*::/, '').gsub(/^[A-Z]/) { |match| match[0].downcase }.gsub(/[A-Z]/) { |match| "-#{match[0].downcase}" }
end