Class: Anvil::SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- Anvil::SubCommandBase
show all
- Defined in:
- lib/anvil/subcommand.rb
Class Method Summary
collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
5
6
7
|
# File 'lib/anvil/subcommand.rb', line 5
def self.banner(command, namespace = nil, subcommand = false)
"#{basename} #{subcommand_prefix} #{command.usage}"
end
|
.subcommand_prefix ⇒ Object
9
10
11
|
# File 'lib/anvil/subcommand.rb', line 9
def self.subcommand_prefix
name.gsub(%r{.*::}, "").gsub(%r{^[A-Z]}) { |match| match[0].downcase }.gsub(%r{[A-Z]}) { |match| "-#{match[0].downcase}" }
end
|