Sha256: 7b4fdb50a22e07aa6cdf12705bc243c4a39f282c2638ebbb0bc225ce366ff0c7

Contents?: true

Size: 1.9 KB

Versions: 7

Compression:

Stored size: 1.9 KB

Contents

# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

# Top-level namespace for Contrast Security agent
module Contrast
end

# Some developers override various methods on Object, which can often involve
# changing expected method parity/behavior which in turn prevents us from being
# able to reliably use affected methods.
# We alias these method so that we always have access to them.
#
# Because we use these methods in constructing classes (e.g., calling #freeze
# on constants within class definitions) we do this aliasing ASAP.
class Object
  alias_method :cs__class, :class
  alias_method :cs__freeze, :freeze
  alias_method :cs__frozen?, :frozen?
  alias_method :cs__is_a?, :is_a?
  alias_method :cs__method, :method
  alias_method :cs__respond_to?, :respond_to?
  alias_method :cs__singleton_class, :singleton_class
end

require_relative './contrast/agent/require_state' # rubocop:disable  Kernel/RequireRelative

# We have to do this here BEOFRE we require anything b/c we can't use the
# Contrast require methods without it.
module Kernel
  def cs__scoped_require path
    Contrast::Agent::RequireStates.enter
    require(path) # rubocop:disable  Kernel/Require
  ensure
    Contrast::Agent::RequireStates.exit
  end
end

# component interface for class creation
# config gets built as a consequence of this require
cs__scoped_require 'contrast/components/interface'

# shared configuration support
cs__scoped_require 'contrast/config'
cs__scoped_require 'contrast/configuration'

cs__scoped_require 'contrast/agent/version'

# errors and exceptions
cs__scoped_require 'contrast/security_exception'
cs__scoped_require 'contrast/internal_exception'

# shared utils
cs__scoped_require 'contrast/utils/timer'
cs__scoped_require 'contrast/utils/random_util'
cs__scoped_require 'contrast/utils/preflight_util'

cs__scoped_require 'contrast/agent'

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
contrast-agent-3.10.2 lib/contrast.rb
contrast-agent-3.10.1 lib/contrast.rb
contrast-agent-3.10.0 lib/contrast.rb
contrast-agent-3.9.1 lib/contrast.rb
contrast-agent-3.9.0 lib/contrast.rb
contrast-agent-3.8.5 lib/contrast.rb
contrast-agent-3.8.4 lib/contrast.rb