# Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true # rubocop:disable Security/Object/Freeze module Contrast module Utils # A utility class where a series of commonly used Strings and other # commonly used objects can be store and frozen to prevent unnecessary # duplication. module ObjectShare # Strings ASTERISK = '*' BACK_SLASH = '\\' EMPTY_STRING = '' COLON = ':' COMMA = ',' DASH = '-' DOUBLE_QUOTE = '"' EQUALS = '=' EXCLAMATION = '!' HTTP_SCORE = 'HTTP_' HTTP_START = 'http:' HTTPS_START = 'https:' NEW_LINE = "\n" NIL_STRING = 'nil' PERIOD = '.' POUND_SIGN = '#' QUESTION_MARK = '?' RETURN = "\r" SEMICOLON = ';' SINGLE_QUOTE = '\'' SLASH = '/' SPACE = ' ' UNDERSCORE = '_' DOUBLE_UNDERSCORE = '__' AT = '@' LEFT_ANGLE = '<' COLON_SLASH_SLASH = '://' DOLLAR_SIGN = '$' CARROT = '^' WRITE_FLAG = 'w' PARENT_PATH = '..' RUBY = 'Ruby' CACHE = 'cache' CONTRAST_PATCHED_METHOD_START = 'cs__patched_' CONTRAST_MODULE_START = 'Contrast::' ANONYMOUS_CLASS_MARKER = '#<' DOUBLE_COLON = '::' EMPTY_ARRAY = [].freeze EMPTY_HASH = {}.freeze # RegExps DIGIT_REGEXP = /[[:digit:]]/.freeze WHITE_SPACE_REGEXP = /\s/.freeze NOT_WHITE_SPACE_REGEXP = /[^\s]/.freeze # Messages OVERRIDE_MESSAGE = 'A security filter prevented original response from being returned.' # Configs TRUE = 'true' FALSE = 'false' CLASS = 'Class' MODULE = 'Module' OBJECT_KEY = 'O' RETURN_KEY = 'R' UNKNOWN = 'unknown' INDEX = 'index' end end end # rubocop:enable Security/Object/Freeze