# frozen_string_literal: true #-- # gravaty # rubocop:disable Style/AsciiComments # © 2013 Marco Bresciani # rubocop:enable Style/AsciiComments # # This file is part of gravaty. # # gravaty is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # gravaty is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with gravaty. If not, see . # # SPDX-FileCopyrightText: 2013 Marco Bresciani # # SPDX-License-Identifier: GPL-3.0-or-later #++ module Gravaty # Allowed sizes (in pixels) for images requests. Currently a range # from 1 to 2048 (included). ALLOWED_SIZES = (1...2048) # Allowed parameters names. Currently: avatar, callback, default, # force, format, pixelsize, rating, secure and type. ALLOWED_PARAMS = %i[avatar callback default force format pixelsize rating secure type].freeze # Allowed formats (extensions) for avatar requests. Currently: # jp(e)g, png and gif. AVATAR_FORMATS = %w[jpg jpeg png gif].freeze # Currently allowed default builtin options. Currently: 404, mp, # identicon, monsterid,wavatar, retro, robohash and blank. DEFAULT_OPTIONS = %w[404 mp identicon monsterid wavatar retro robohash blank].freeze # Allowed formats (extensions) for default own images. Currently: # jp(e)g, png and gif. IMAGES_FORMATS = %w[jpg jpeg png gif].freeze # Allowed formats (extensions) for profile requests. Currently: json, # xml, php, vcf and qr. PROFILE_FORMATS = %w[json xml php vcf qr].freeze # Formats allowing supplemental options for profile requests. # Currently json and qr. PROFILES = %w[json qr].freeze # Allowed rating options. Currently: g, pg, r and x. RATING_OPTIONS = %w[g pg r x].freeze # Possible XML-RPC API errors. RPC_ERRORS = [-7, -8, -9, -10, -11, -100].freeze # Allowed XML-RPC API methods. RPC_METHODS = %w[grav.exists grav.addresses grav.userimages grav.saveData grav.saveUrl grav.useUserimage grav.removeImage grav.deleteUserimage grav.test].freeze # Default test method for XML-RPC API. RPC_TEST_METHOD = 'grav.test' # Reference URI for XML-RPC API. RPC_URI = 'secure.gravatar.com' end