Module: Wpxf::Cli::ModuleInfo
- Included in:
- LoadedModule
- Defined in:
- lib/wpxf/cli/module_info.rb
Overview
Helper methods for outputing information about the currently loaded module.
Instance Method Summary collapse
- #formatted_module_description ⇒ Object
- #info ⇒ Object
- #print_author ⇒ Object
- #print_description ⇒ Object
- #print_module_summary ⇒ Object
- #print_references ⇒ Object
Instance Method Details
#formatted_module_description ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/wpxf/cli/module_info.rb', line 16 def formatted_module_description if context.module.module_description_preformatted indent_without_wrap(context.module.module_desc) else remove_new_lines_and_wrap_text(context.module.module_desc).strip end end |
#info ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/wpxf/cli/module_info.rb', line 47 def info return unless module_loaded?(false) print_module_summary puts puts puts print_description puts print_references end |
#print_author ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/wpxf/cli/module_info.rb', line 7 def print_std('Provided by:') indent_cursor do context.module..each do || print_std() end end end |
#print_description ⇒ Object
24 25 26 27 28 29 |
# File 'lib/wpxf/cli/module_info.rb', line 24 def print_description print_std('Description:') indent_cursor do print_std formatted_module_description end end |
#print_module_summary ⇒ Object
31 32 33 34 35 |
# File 'lib/wpxf/cli/module_info.rb', line 31 def print_module_summary print_std(" Name: #{context.module.module_name}") print_std(" Module: #{context.module_path}") print_std(" Disclosed: #{context.module.module_date}") end |
#print_references ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/wpxf/cli/module_info.rb', line 37 def print_references return unless context.module.module_references print_std('References:') indent_cursor do context.module.module_references.each do |ref| print_std Wpxf::Utility::ReferenceInflater.new(ref[0]).inflate(ref[1]) end end end |