Class: SmartMachine::Commands::MachineCommands::SubThor
- Inherits:
-
Thor
- Object
- Thor
- SmartMachine::Commands::MachineCommands::SubThor
- Defined in:
- lib/smart_machine/commands/machine_commands/sub_thor.rb
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
5 6 7 |
# File 'lib/smart_machine/commands/machine_commands/sub_thor.rb', line 5 def self.(command, namespace = nil, subcommand = false) "#{basename} machine #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
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 |