Skip to content

Commit

Permalink
[rb] update rubocop and revert incorrect changes
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jan 26, 2024
1 parent 7c1b450 commit eba101d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions rb/Gemfile.lock
Expand Up @@ -98,7 +98,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.60.1)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -170,7 +170,7 @@ DEPENDENCIES
rack (~> 2.0)
rake (~> 13.0)
rspec (~> 3.0)
rubocop (~> 1.42)
rubocop (~> 1.60, >= 1.60.2)
rubocop-performance (~> 1.15)
rubocop-rspec (~> 2.16)
selenium-devtools!
Expand Down
12 changes: 6 additions & 6 deletions rb/lib/selenium/webdriver/bidi/log_inspector.rb
Expand Up @@ -50,28 +50,28 @@ def initialize(driver, browsing_context_ids = nil)
@bidi.session.subscribe('log.entryAdded', browsing_context_ids)
end

def on_console_entry(...)
def on_console_entry(filter_by = nil, &block)
check_valid_filter(filter_by)

on_log do |params|
type = params['type']
console_log_events(params, ...) if type.eql?('console')
console_log_events(params, filter_by, &block) if type.eql?('console')
end
end

def on_javascript_log(...)
def on_javascript_log(filter_by = nil, &block)
check_valid_filter(filter_by)

on_log do |params|
type = params['type']
javascript_log_events(params, ...) if type.eql?('javascript')
javascript_log_events(params, filter_by, &block) if type.eql?('javascript')
end
end

def on_javascript_exception(...)
def on_javascript_exception(&block)
on_log do |params|
type = params['type']
javascript_log_events(params, FilterBy.log_level('error'), ...) if type.eql?('javascript')
javascript_log_events(params, FilterBy.log_level('error'), &block) if type.eql?('javascript')
end
end

Expand Down
4 changes: 2 additions & 2 deletions rb/lib/selenium/webdriver/common/zipper.rb
Expand Up @@ -71,11 +71,11 @@ def zip_file(path)

private

def with_tmp_zip(...)
def with_tmp_zip(&blk)
# Don't use Tempfile since it lacks rb_file_s_rename permission on Windows.
Dir.mktmpdir do |tmp_dir|
zip_path = File.join(tmp_dir, 'webdriver-zip')
Zip::File.open(zip_path, Zip::File::CREATE, ...)
Zip::File.open(zip_path, Zip::File::CREATE, &blk)
end
end

Expand Down
4 changes: 2 additions & 2 deletions rb/lib/selenium/webdriver/devtools/network_interceptor.rb
Expand Up @@ -43,9 +43,9 @@ def initialize(devtools)
@lock = Mutex.new
end

def intercept(...)
def intercept(&block)
devtools.network.on(:loading_failed) { |params| track_cancelled_request(params) }
devtools.fetch.on(:request_paused) { |params| request_paused(params, ...) }
devtools.fetch.on(:request_paused) { |params| request_paused(params, &block) }

devtools.network.set_cache_disabled(cache_disabled: true)
devtools.network.enable
Expand Down
2 changes: 1 addition & 1 deletion rb/selenium-webdriver.gemspec
Expand Up @@ -56,7 +56,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rack', ['~> 2.0']
s.add_development_dependency 'rake', ['~> 13.0']
s.add_development_dependency 'rspec', ['~> 3.0']
s.add_development_dependency 'rubocop', ['~> 1.42']
s.add_development_dependency 'rubocop', ['~> 1.60', '>=1.60.2']
s.add_development_dependency 'rubocop-performance', ['~> 1.15']
s.add_development_dependency 'rubocop-rspec', ['~> 2.16']
s.add_development_dependency 'webmock', ['~> 3.5']
Expand Down

0 comments on commit eba101d

Please sign in to comment.