Class: SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- SubCommandBase
show all
- Defined in:
- lib/trivia_md.rb
Class Method Summary
collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
11
12
13
|
# File 'lib/trivia_md.rb', line 11
def self.banner(command, namespace = nil, subcommand = false)
"#{basename} #{subcommand_prefix} #{command.usage}"
end
|
.subcommand_prefix ⇒ Object
15
16
17
|
# File 'lib/trivia_md.rb', line 15
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
|