Class: Porkadot::SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- Porkadot::SubCommandBase
show all
- Defined in:
- lib/porkadot/utils.rb
Class Method Summary
collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
2
3
4
|
# File 'lib/porkadot/utils.rb', line 2
def self.banner(command, namespace = nil, subcommand = false)
"#{basename} #{subcommand_prefix} #{command.usage}"
end
|
.subcommand_prefix ⇒ Object
6
7
8
|
# File 'lib/porkadot/utils.rb', line 6
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
|