Class: SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- SubCommandBase
- Defined in:
- lib/wanda/sub_command_base.rb
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
4 5 6 |
# File 'lib/wanda/sub_command_base.rb', line 4 def self.(command, _namespace = nil, _subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
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 |