Class: WayOfWorking::SubCommands::Base
- Inherits:
-
Thor
- Object
- Thor
- WayOfWorking::SubCommands::Base
- Defined in:
- lib/way_of_working/sub_commands/base.rb
Overview
This base class enables subcommands to work correctly with help. See: github.com/rails/thor/wiki/Subcommands#subcommands-that-work-correctly-with-help
Class Method Summary collapse
Class Method Details
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
10 11 12 |
# File 'lib/way_of_working/sub_commands/base.rb', line 10 def self.(command, _namespace = nil, _subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
14 15 16 17 |
# File 'lib/way_of_working/sub_commands/base.rb', line 14 def self.subcommand_prefix name.gsub(/.*::/, '').gsub(/^[A-Z]/) { |match| match[0].downcase }. gsub(/[A-Z]/) { |match| "-#{match[0].downcase}" } end |