lib/contrast.rb in contrast-agent-3.13.2 vs lib/contrast.rb in contrast-agent-3.14.0
- old
+ new
@@ -1,8 +1,11 @@
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true
+# Used to prevent deprecation warnings from flooding stdout
+ENV['PB_IGNORE_DEPRECATIONS'] = 'truee'
+
# Top-level namespace for Contrast Security agent
module Contrast
end
# Some developers override various methods on Object, which can often involve
@@ -20,40 +23,27 @@
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'
+require 'contrast/components/interface'
# This needs to be required very early, after component interfaces, and before instrumentation attempts
-cs__scoped_require 'contrast/funchook/funchook'
+require 'contrast/funchook/funchook'
# shared configuration support
-cs__scoped_require 'contrast/config'
-cs__scoped_require 'contrast/configuration'
+require 'contrast/config'
+require 'contrast/configuration'
-cs__scoped_require 'contrast/agent/version'
+require 'contrast/agent/version'
# errors and exceptions
-cs__scoped_require 'contrast/security_exception'
+require 'contrast/security_exception'
# shared utils
-cs__scoped_require 'contrast/utils/timer'
-cs__scoped_require 'contrast/utils/preflight_util'
+require 'contrast/utils/timer'
+require 'contrast/utils/preflight_util'
-cs__scoped_require 'contrast/utils/assess/sampling_util'
-cs__scoped_require 'contrast/agent'
+require 'contrast/utils/assess/sampling_util'
+require 'contrast/agent'