Class: SmartMachine::Commands::MachineCommands::SubThor

Inherits:
Thor
  • Object
show all
Defined in:
lib/smart_machine/commands/machine_commands/sub_thor.rb

Direct Known Subclasses

Network

Class Method Summary collapse

Class Method Details



5
6
7
# File 'lib/smart_machine/commands/machine_commands/sub_thor.rb', line 5

def self.banner(command, namespace = nil, subcommand = false)
  "#{basename} machine #{subcommand_prefix} #{command.usage}"
end

.subcommand_prefixObject



9
10
11
# File 'lib/smart_machine/commands/machine_commands/sub_thor.rb', line 9

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