Class: BaseSubCommand
Overview
Inspired by github.com/rails/thor/wiki/Subcommands
Class Method Summary collapse
-
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter.
- .subcommand_prefix ⇒ Object
Methods inherited from Thor
Class Method Details
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter
5 6 7 |
# File 'lib/command/base_sub_command.rb', line 5 def self.(command, _namespace = nil, _subcommand = false) # rubocop:disable Style/OptionalBooleanParameter "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
9 10 11 12 13 14 |
# File 'lib/command/base_sub_command.rb', line 9 def self.subcommand_prefix name .gsub(/.*::/, "") .gsub(/^[A-Z]/) { |match| match[0].downcase } .gsub(/[A-Z]/) { |match| "-#{match[0].downcase}" } end |