class DTK::Client::BaseCommandHelper
Public Class Methods
new(command,context_params=nil)
click to toggle source
# 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
Public Instance Methods
print_external_dependencies(external_dependencies, location)
click to toggle source
# 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
Private Instance Methods
context_params()
click to toggle source
# File lib/commands/common/thor/base_command_helper.rb, line 38 def context_params() @context_params || raise(DtkError, "[ERROR] @context_params is nil") end
get_namespace_and_name(*args)
click to toggle source
# File lib/commands/common/thor/base_command_helper.rb, line 46 def get_namespace_and_name(*args) @command.get_namespace_and_name(*args) end
post(*args)
click to toggle source
# File lib/commands/common/thor/base_command_helper.rb, line 54 def post(*args) @command.post(*args) end
rest_url(*args)
click to toggle source
# File lib/commands/common/thor/base_command_helper.rb, line 50 def rest_url(*args) @command.rest_url(*args) end
retrieve_arguments(mapping, method_info = nil)
click to toggle source
# File lib/commands/common/thor/base_command_helper.rb, line 42 def retrieve_arguments(mapping, method_info = nil) context_params.retrieve_arguments(mapping, method_info || @command.method_argument_names) end