module NexusCli::UserActions

def get_user(user)

Returns:
  • (Hash) - a parsed Ruby object representing the user's JSON

Parameters:
  • user (String) -- the name of the user to get
def get_user(user)
  response = nexus.get(nexus_url("service/local/users/#{user}"), :header => DEFAULT_ACCEPT_HEADER)
  case response.status
  when 200
    return JSON.parse(response.content)
  when 404
    raise UserNotFoundException.new(user)
  else
    raise UnexpectedStatusCodeException.new(response.status)
  end
end