Class: DTK::Client::BaseCommandHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/common/thor/base_command_helper.rb

Direct Known Subclasses

CommonModule::Import, TaskStatus

Instance Method Summary collapse

Constructor Details

#initialize(command, context_params = nil) ⇒ BaseCommandHelper

Returns a new instance of BaseCommandHelper.



20
21
22
23
24
# File 'lib/commands/common/thor/base_command_helper.rb', line 20

def initialize(command,context_params=nil)
  @command        = command
  @context_params = context_params
  @options        = command.options
end

Instance Method Details



26
27
28
29
30
31
32
33
34
35
# File 'lib/commands/common/thor/base_command_helper.rb', line 26

def print_external_dependencies(external_dependencies, location)
  ambiguous        = external_dependencies["ambiguous"]||[]
  amb_sorted       = ambiguous.map { |k,v| "#{k.split('/').last} (#{v.join(', ')})" }
  inconsistent     = external_dependencies["inconsistent"]||[]
  possibly_missing = external_dependencies["possibly_missing"]||[]

  OsUtil.print("There are inconsistent module dependencies mentioned #{location}: #{inconsistent.join(', ')}", :red) unless inconsistent.empty?
  OsUtil.print("There are missing module dependencies mentioned #{location}: #{possibly_missing.join(', ')}", :yellow) unless possibly_missing.empty?
  OsUtil.print("There are ambiguous module dependencies mentioned #{location}: '#{amb_sorted.join(', ')}'. One of the namespaces should be selected by editing the module_refs file", :yellow) if ambiguous && !ambiguous.empty?
end