Class: DTK::Client::Operation::Module::Install::PrintHelper

Inherits:
Object
  • Object
show all
Includes:
Mixin
Defined in:
lib/client/operation/module/install/print_helper.rb

Defined Under Namespace

Modules: Term

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ PrintHelper

opts can have keys: :source - required; can have values: :local or remote :indent_length :module_ref



27
28
29
30
31
# 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

Instance Method Details

#dependent_module_update_promptObject

For prompts



90
91
92
# 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


43
44
45
# 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

Continuation messages, which dont have carriage return



39
40
41
# 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


47
48
49
# 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


51
52
53
# 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


85
86
87
# File 'lib/client/operation/module/install/print_helper.rb', line 85

def print_done_message
  OsUtil.print('Done.', :yellow)
end


61
62
63
# 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


65
66
67
# 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


69
70
71
# 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


77
78
79
# 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


81
82
83
# 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


73
74
75
# 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

End: Continuation messages



57
58
59
# 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) ⇒ Object



33
34
35
36
# File 'lib/client/operation/module/install/print_helper.rb', line 33

def set_module_ref!(module_ref)
  @module_ref = module_ref
  self
end