Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable warning about caching in 4.x when setting `Webdrivers.cache_t… #121

Merged
merged 1 commit into from
May 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/webdrivers/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,22 @@ class NetworkError < StandardError
class << self
attr_accessor :proxy_addr, :proxy_port, :proxy_user, :proxy_pass, :install_dir

attr_writer :cache_time

#
# Returns the amount of time (Seconds) the gem waits between two update checks.
#
def cache_time
@cache_time || 0
end

#
# Set the amount of time (Seconds) the gem waits between two update checks. Disable
# Common.cache_warning.
#
def cache_time=(value)
Common.cache_warning = true
@cache_time = value
end

def logger
@logger ||= Webdrivers::Logger.new
end
Expand Down Expand Up @@ -58,7 +65,7 @@ def net_http_ssl_fix
class Common
class << self
attr_writer :required_version
attr_reader :cache_warning
attr_accessor :cache_warning

def version
Webdrivers.logger.deprecate("#{self.class}#version", "#{self.class}#required_version")
Expand Down