Sha256: eee570c31f1fc5de451c1655e92846969a251ba3a65d303c6851effd1772ffcf

Contents?: true

Size: 1.91 KB

Versions: 1

Compression:

Stored size: 1.91 KB

Contents

# Copyright (c) 2022 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 =      '*'
      AMPERSAND =     '&'
      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 =         '^'
      BANG =           '!'

      WRITE_FLAG =    'w'

      PARENT_PATH =   '..'

      RUBY = 'Ruby'
      CACHE = 'cache'

      CONTRAST_PATCHED_METHOD_START = 'cs__patched_'

      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'

      OBJECT_KEY = 'O'
      RETURN_KEY = 'R'
      UNKNOWN = 'unknown'

      INDEX = 'index'
    end
  end
end
# rubocop:enable Security/Object/Freeze

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contrast-agent-6.0.0 lib/contrast/utils/object_share.rb