Class: Gzr::Commands::SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- Gzr::Commands::SubCommandBase
- Defined in:
- lib/gzr/commands/subcommandbase.rb
Class Method Summary collapse
-
.banner(command, namespace = nil, subcommand = false) ⇒ Object
Workaround so that help displays the right name base on this link github.com/erikhuda/thor/issues/261#issuecomment-69327685.
- .subcommand_prefix ⇒ Object
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
Workaround so that help displays the right name base on this link github.com/erikhuda/thor/issues/261#issuecomment-69327685
32 33 34 |
# File 'lib/gzr/commands/subcommandbase.rb', line 32 def self.(command, namespace = nil, subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
36 37 38 |
# File 'lib/gzr/commands/subcommandbase.rb', line 36 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 |