Class: Strum::SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- Strum::SubCommandBase
- Defined in:
- lib/strum/sub_command_base.rb
Overview
SubCommand Base class
Class Method Summary collapse
Class Method Details
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
8 9 10 |
# File 'lib/strum/sub_command_base.rb', line 8 def self.(command, _namespace = nil, _subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
12 13 14 15 16 |
# File 'lib/strum/sub_command_base.rb', line 12 def self.subcommand_prefix name.gsub(/.*::/, "") .gsub(/^[A-Z]/) { |match| match[0].downcase } .gsub(/[A-Z]/) { |match| "-#{match[0].downcase}" } end |