class Bundler::SelfManager

def resolve_update_version_from(target)

def resolve_update_version_from(target)
  requirement = Gem::Requirement.new(target)
  update_candidate = find_latest_matching_spec(requirement)
  if update_candidate.nil?
    raise InvalidOption, "The `bundle update --bundler` target version (#{target}) does not exist"
  end
  resolved_version = update_candidate.version
  needs_update = requirement.specific? ? !running?(resolved_version) : running_older_than?(resolved_version)
  return unless needs_update
  update_candidate
end