Sha256: 713cc99b2087fd145a66d05d0f1373355d7e89468386b16a5cb40f80baf6a9f9

Contents?: true

Size: 959 Bytes

Versions: 21

Compression:

Stored size: 959 Bytes

Contents

# frozen_string_literal: true

module Capybara
  module Selenium
    module DeprecationSuppressor
      def initialize(*)
        @suppress_for_capybara = false
        super
      end

      def deprecate(*args, **opts, &block)
        return if @suppress_for_capybara

        if opts.empty?
          super(*args, &block) # support Selenium 3
        else
          super
        end
      end

      def suppress_deprecations
        prev_suppress_for_capybara, @suppress_for_capybara = @suppress_for_capybara, true
        yield
      ensure
        @suppress_for_capybara = prev_suppress_for_capybara
      end
    end

    module ErrorSuppressor
      def for_code(*)
        ::Selenium::WebDriver.logger.suppress_deprecations do
          super
        end
      end
    end
  end
end

Selenium::WebDriver::Logger.prepend Capybara::Selenium::DeprecationSuppressor
Selenium::WebDriver::Error.singleton_class.prepend Capybara::Selenium::ErrorSuppressor

Version data entries

21 entries across 15 versions & 3 rubygems

Version Path
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/selenium/logger_suppressor.rb
capybara-3.37.1 lib/capybara/selenium/logger_suppressor.rb
capybara-3.37.0 lib/capybara/selenium/logger_suppressor.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/capybara-3.36.0/lib/capybara/selenium/logger_suppressor.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/capybara-3.36.0/lib/capybara/selenium/logger_suppressor.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/capybara-3.36.0/lib/capybara/selenium/logger_suppressor.rb
capybara-3.36.0 lib/capybara/selenium/logger_suppressor.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/selenium/logger_suppressor.rb
capybara-3.35.3 lib/capybara/selenium/logger_suppressor.rb