Skip to content

Commit

Permalink
[rb] update Rubocop definitions to target 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 8, 2021
1 parent de90992 commit ad886d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rb/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require:
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 2.6
Exclude:
- 'lib/selenium/devtools/**/*'

Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/remote/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def convert_locator(how, what)
# @see https://mathiasbynens.be/notes/css-escapes
def escape_css(string)
string = string.gsub(ESCAPE_CSS_REGEXP) { |match| "\\#{match}" }
string = "\\#{UNICODE_CODE_POINT + Integer(string[0])} #{string[1..-1]}" if string[0]&.match?(/[[:digit:]]/)
string = "\\#{UNICODE_CODE_POINT + Integer(string[0])} #{string[1..]}" if string[0]&.match?(/[[:digit:]]/)

string
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def reset_driver!(time = 0)

# TODO: optimize since this approach is not assured on IE
def ensure_single_window
driver_instance.window_handles[1..-1].each do |handle|
driver_instance.window_handles[1..].each do |handle|
driver_instance.switch_to.window(handle)
driver_instance.close
end
Expand Down

0 comments on commit ad886d6

Please sign in to comment.