Sha256: e58efc2df3e78bd99b0228a42e4e79921347205a60fad083f40255a73decef60

Contents?: true

Size: 1.94 KB

Versions: 8

Compression:

Stored size: 1.94 KB

Contents

# Copyright (c) 2023 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 =         ','
      CONTRAST_DOT =  'contrast.'
      DASH =          '-'
      DOUBLE_QUOTE =  '"'
      EQUALS =        '='
      EXCLAMATION =   '!'
      HTTP_SCORE =    'HTTP_'
      HTTP_START =    'http:'
      HTTPS_START =   'https:'
      NEW_LINE =      "\n"
      NIL_STRING =    'nil'
      NIL_64_STRING = 'bmls'
      PERIOD =        '.'
      POUND_SIGN =    '#'
      QUESTION_MARK = '?'
      RETURN =        "\r"
      SEMICOLON =     ';'
      SINGLE_QUOTE =  '\''
      SLASH =         '/'
      SPACE =         ' '
      UNDERSCORE =    '_'
      DOUBLE_UNDERSCORE = '__'
      AT =            '@'
      LEFT_ANGLE =    '<'
      COLON_SLASH_SLASH = '://'
      DOLLAR_SIGN = '$'
      AMPERSAND = '&'
      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:]]/
      WHITE_SPACE_REGEXP = /\s/
      NOT_WHITE_SPACE_REGEXP = /[^\s]/

      # 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

8 entries across 8 versions & 1 rubygems

Version Path
contrast-agent-7.6.1 lib/contrast/utils/object_share.rb
contrast-agent-7.6.0 lib/contrast/utils/object_share.rb
contrast-agent-7.5.0 lib/contrast/utils/object_share.rb
contrast-agent-7.4.1 lib/contrast/utils/object_share.rb
contrast-agent-7.4.0 lib/contrast/utils/object_share.rb
contrast-agent-7.3.2 lib/contrast/utils/object_share.rb
contrast-agent-7.3.1 lib/contrast/utils/object_share.rb
contrast-agent-7.3.0 lib/contrast/utils/object_share.rb