class ChefCLI::Policyfile::SolutionDependencies

def add_policyfile_dep_from_lock_data(entry)

def add_policyfile_dep_from_lock_data(entry)
  unless entry.is_a?(Array) && entry.size == 2
    msg = %Q{lockfile solution_dependencies Policyfile dependencies entry must be like [ "$COOKBOOK_NAME", "$CONSTRAINT" ] (got: #{entry.inspect})}
    raise InvalidLockfile, msg
  end
  cookbook_name, constraint = entry
  unless cookbook_name.is_a?(String) && !cookbook_name.empty?
    msg = "lockfile solution_dependencies Policyfile dependencies entry. Cookbook name portion must be a string (got: #{entry.inspect})"
    raise InvalidLockfile, msg
  end
  unless constraint.is_a?(String) && !constraint.empty?
    msg = "malformed lockfile solution_dependencies Policyfile dependencies entry. Version constraint portion must be a string (got: #{entry.inspect})"
    raise InvalidLockfile, msg
  end
  add_policyfile_dep(cookbook_name, constraint)
rescue Semverse::InvalidConstraintFormat
  msg = "malformed lockfile solution_dependencies Policyfile dependencies entry. Version constraint portion must be a valid version constraint (got: #{entry.inspect})"
  raise InvalidLockfile, msg
end