Module: Skytap::Commands::Help::ClassMethods
- Defined in:
- lib/skytap/commands/help.rb
Instance Method Summary collapse
- #banner ⇒ Object
- #banner_prefix ⇒ Object
- #default_description ⇒ Object
- #description ⇒ Object
- #short_desc ⇒ Object
- #subcommand_banners ⇒ Object
Instance Method Details
#banner ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/skytap/commands/help.rb', line 13 def b = "#{} - #{short_desc}" if plugin b.color(:cyan) else b end end |
#banner_prefix ⇒ Object
8 9 10 11 |
# File 'lib/skytap/commands/help.rb', line 8 def parent_prefix = parent.try(:banner_prefix) "#{parent_prefix.try(:+, ' ')}#{self.command_name}" end |
#default_description ⇒ Object
26 27 28 |
# File 'lib/skytap/commands/help.rb', line 26 def default_description nil end |
#description ⇒ Object
22 23 24 |
# File 'lib/skytap/commands/help.rb', line 22 def description spec['description'] || default_description end |
#short_desc ⇒ Object
30 31 32 |
# File 'lib/skytap/commands/help.rb', line 30 def short_desc description.split("\n\n").first.split("\n").join(' ') if description end |
#subcommand_banners ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/skytap/commands/help.rb', line 34 def subcommands.inject([]) do |acc, klass| acc << klass. unless klass.container acc.concat(klass.) acc end end |