Sha256: 904d3452f0b72186768115f22f955a456253da2406248ca7527cd858e9c19649

Contents?: true

Size: 946 Bytes

Versions: 2

Compression:

Stored size: 946 Bytes

Contents

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

cs__scoped_require 'contrast/agent/assess/class_reverter'
cs__scoped_require 'contrast/components/interface'

module Contrast
  module Agent
    module Patching
      module Policy
        # This is how we unpatch out of our customer's code. It provides a way
        # to remove ourselves from those modules which have since had their
        # definition of the patched method revoked, such as when running with
        # FactoryBot
        module PolicyUnpatcher
          include Contrast::Components::Interface
          access_component :logging

          def self.revert_conflicting_patches
            logger.debug_with_time("\t\tRunning reversions") do
              Contrast::Agent::Assess::ClassReverter.unpatch!
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contrast-agent-3.8.5 lib/contrast/agent/patching/policy/policy_unpatcher.rb
contrast-agent-3.8.4 lib/contrast/agent/patching/policy/policy_unpatcher.rb