class DTK::Client::Operation::Module::Install::PrintHelper
Constants
- INDENT_BUMP
Attributes
source_term[R]
Public Class Methods
new(opts = {})
click to toggle source
opts can have keys:
:source - required; can have values: :local or remote :indent_length :module_ref
# File lib/client/operation/module/install/print_helper.rb, line 27 def initialize(opts = {}) @indent_length = opts[:indent_length] || 0 @module_ref = opts[:module_ref] @source_term = Term.source(opts[:source]) end
Public Instance Methods
dependent_module_update_prompt()
click to toggle source
For prompts
# File lib/client/operation/module/install/print_helper.rb, line 90 def dependent_module_update_prompt "#{indent}Do you want to update dependent module '#{pretty_print_module}' from the #{Term::DTKN_CATALOG}?" end
print_continuation_installing_base_module()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 43 def print_continuation_installing_base_module print_continuation "Installing module '#{pretty_print_module}' from #{source_term}", :color => :yellow end
print_continuation_installing_dependency()
click to toggle source
Continuation messages, which dont have carriage return
# File lib/client/operation/module/install/print_helper.rb, line 39 def print_continuation_installing_dependency print_continuation "Installing dependent module '#{pretty_print_module}'" end
print_continuation_pulling_base_module()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 47 def print_continuation_pulling_base_module print_continuation "Pulling base module '#{pretty_print_module}' from #{source_term}", :color => :yellow end
print_continuation_pulling_dependency_update()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 51 def print_continuation_pulling_dependency_update print_continuation "Pulling update to dependent module '#{pretty_print_module}'" end
print_done_message()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 85 def print_done_message OsUtil.print('Done.', :yellow) end
print_getting_dependencies()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 61 def print_getting_dependencies OsUtil.print_info("Getting dependent module info for '#{pretty_print_module}' from #{Term::DTKN_CATALOG} #{Term::CONTINUATION}") end
print_installing_dependencies()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 65 def print_installing_dependencies OsUtil.print_info("Installing dependent modules from #{Term::DTKN_CATALOG} #{Term::CONTINUATION}") end
print_pulling_dependencies()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 69 def print_pulling_dependencies OsUtil.print_info("Pulling dependent modules from #{Term::DTKN_CATALOG} #{Term::CONTINUATION}") end
print_terminated_installation()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 77 def print_terminated_installation OsUtil.print_warning("Terminated installation of module '#{pretty_print_module}'") end
print_terminated_pulling()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 81 def print_terminated_pulling OsUtil.print_warning("Terminated pulling of module '#{pretty_print_module}'") end
print_using_installed_dependent_module()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 73 def print_using_installed_dependent_module OsUtil.print("Using installed dependent module '#{pretty_print_module}'") end
print_warning(msg)
click to toggle source
End: Continuation messages
# File lib/client/operation/module/install/print_helper.rb, line 57 def print_warning(msg) OsUtil.print_warning(msg) end
set_module_ref!(module_ref)
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 33 def set_module_ref!(module_ref) @module_ref = module_ref self end
Private Instance Methods
increase_indent!()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 121 def increase_indent! @indent_length += INDENT_BUMP end
indent()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 116 def indent ' ' * @indent_length end
pretty_print_module()
click to toggle source
# File lib/client/operation/module/install/print_helper.rb, line 112 def pretty_print_module @module_ref.pretty_print end
print_continuation(msg, opts = {})
click to toggle source
opts can have keys:
:color
# File lib/client/operation/module/install/print_helper.rb, line 100 def print_continuation(msg, opts = {}) print_without_cr("#{@indent}#{msg} #{Term::CONTINUATION} ", :color => opts[:color]) end
print_without_cr(msg, opts = {})
click to toggle source
print without carriage return opts can have keys:
:color
# File lib/client/operation/module/install/print_helper.rb, line 107 def print_without_cr(msg, opts = {}) # Using print to avoid adding cr at the end. print(opts[:color] ? msg.colorize(opts[:color]) : msg) end