class Webgen::CLI::ShowExtensionsCommand

The CLI command for showing available extension.

Private Instance Methods

format_extension_info(name, data, has_selector) click to toggle source
   # File lib/webgen/cli/commands/show_extensions.rb
36 def format_extension_info(name, data, has_selector)
37   author = (!data['author'] || data['author'].empty? ? 'unknown' : data['author'])
38 
39   indentation = (has_selector ? 0 : name.count('.')*2)
40   puts(" "*indentation + Utils.light(Utils.blue(name)))
41   if command_parser.verbose
42     print(" "*(indentation + 2) + "Bundle:  ")
43     puts(Utils.format(data['bundle'], 78, indentation + 11, false))
44     print(" "*(indentation + 2) + "Author:  ")
45     puts(Utils.format(author, 78, indentation + 11, false))
46     print(" "*(indentation + 2) + "Summary: ")
47     puts(Utils.format(data['summary'], 78, indentation + 11, false))
48   else
49     puts(Utils.format(data['summary'], 78, indentation + 2, true).join("\n"))
50   end
51   puts
52 end