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

Add RBS files to Ruby #12844

Merged
merged 22 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0c98d81
Started generating RBS files and modifying types
Pexpe Sep 30, 2023
360e144
Improve types in driver added RBS files for Element, Navigation and T…
Pexpe Oct 1, 2023
5029445
Expand support for driver and starting adding manager, timeouts, vers…
Pexpe Oct 2, 2023
c5eabb8
Updated driver and window, and starting working on action builder, ke…
Pexpe Oct 4, 2023
c9e35f2
Update driver add input_device, navigation and pointer actions
Pexpe Oct 5, 2023
ce82619
Update driver added remote, remote-response, devtools-response, virtu…
Pexpe Oct 7, 2023
ea5f748
Updated atoms, bridge, chrome, chromium and features
Pexpe Oct 7, 2023
9b57c31
Expanded the features RBS for chrome and chromium, and added has_cast…
Pexpe Oct 8, 2023
a2e1128
Last update for the first RBS support PR
Pexpe Oct 22, 2023
d5d4d0b
Update Steepfile
Pexpe Oct 22, 2023
3af8488
Remove comments and static values
Pexpe Oct 29, 2023
3acc6b2
Resolve conflicts
Pexpe Oct 22, 2023
3c04d66
Resolve conflicts and rebase
Pexpe Oct 22, 2023
8039d4d
Update local_driver.rb
aguspe Oct 29, 2023
ff1baa9
Update selenium-webdriver.gemspec to add support for Jruby
Pexpe Nov 5, 2023
6c31948
Revert 4.2.0 and add exact version support for Jruby
Pexpe Nov 6, 2023
d920a7b
Merge branch 'trunk' into add_rbs_files_to_ruby
aguspe Nov 6, 2023
100bc50
Merge branch 'trunk' into add_rbs_files_to_ruby
aguspe Nov 17, 2023
e54c555
Exclude Steep for Jruby, update Gemfile.lock
Pexpe Nov 17, 2023
1eea737
Exclude Steep for Jruby, update Gemfile.lock
Pexpe Nov 17, 2023
9c24d25
Apply the changes suggested by p0deje, added steep 1.6.0 and removed rbs
Pexpe Nov 18, 2023
f3cde2c
Reverting to steep 1.5.0
Pexpe Nov 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ GTAGS
/rb/.idea
rb/bin/
rb/lib/selenium/devtools/v1*
rb/.gem_rbs_collection/
.sonar/
.idea/sonarIssues.xml
.idea/inspectionProfiles/profiles_settings.xml
Expand Down
55 changes: 55 additions & 0 deletions rb/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,49 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.1.1)
bigdecimal (3.1.4)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crack (0.4.5)
rexml
csv (3.2.7)
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
diff-lcs (1.5.0)
drb (2.1.1)
ruby2_keywords
ffi (1.16.3)
fileutils (1.7.1)
hashdiff (1.0.1)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.6.0)
irb (1.7.0)
reline (>= 0.3.0)
json (2.6.3)
json (2.6.3-java)
language_server-protocol (3.17.0.3)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.5.3)
minitest (5.20.0)
mutex_m (0.1.2)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
Expand All @@ -37,6 +64,10 @@ GEM
rack (2.2.7)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rbs (3.2.2)
regexp_parser (2.8.1)
reline (0.3.5)
io-console (~> 0.5)
Expand Down Expand Up @@ -79,7 +110,29 @@ GEM
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
securerandom (0.2.2)
steep (1.5.3)
activesupport (>= 5.1)
concurrent-ruby (>= 1.1.10)
csv (>= 3.0.9)
fileutils (>= 1.1.0)
json (>= 2.1.0)
language_server-protocol (>= 3.15, < 4.0)
listen (~> 3.0)
logger (>= 1.3.0)
parser (>= 3.1)
rainbow (>= 2.2.2, < 4.0)
rbs (>= 3.1.0)
securerandom (>= 0.1)
strscan (>= 1.0.0)
terminal-table (>= 2, < 4)
strscan (3.0.7)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
webmock (3.18.1)
addressable (>= 2.8.0)
Expand All @@ -99,12 +152,14 @@ DEPENDENCIES
debug (~> 1.7)
rack (~> 2.0)
rake (~> 13.0)
rbs (~> 3.2.0)
rspec (~> 3.0)
rubocop (~> 1.42)
rubocop-performance (~> 1.15)
rubocop-rspec (~> 2.16)
selenium-devtools!
selenium-webdriver!
steep (~> 1.5)
webmock (~> 3.5)
webrick (~> 1.7)
yard (~> 0.9.11)
Expand Down
4 changes: 4 additions & 0 deletions rb/Steepfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target :lib do
signature 'sig' # Signature directory
check 'lib' # Directory name
end
8 changes: 4 additions & 4 deletions rb/lib/selenium/webdriver/common/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def allow(ids)
# Overrides default #debug to skip ignored messages by provided id
#
# @param [String] message
# @param [Symbol, Array<Sybmol>] id
# @param [Symbol, Array<Symbol>] id
# @yield see #deprecate
#
def debug(message, id: [], &block)
Expand All @@ -123,7 +123,7 @@ def debug(message, id: [], &block)
# Used to supply information of general interest
#
# @param [String] message
# @param [Symbol, Array<Sybmol>] id
# @param [Symbol, Array<Symbol>] id
# @yield see #deprecate
#
def info(message, id: [], &block)
Expand All @@ -134,7 +134,7 @@ def info(message, id: [], &block)
# Used to supply information that suggests an error occurred
#
# @param [String] message
# @param [Symbol, Array<Sybmol>] id
# @param [Symbol, Array<Symbol>] id
# @yield see #deprecate
#
def error(message, id: [], &block)
Expand All @@ -145,7 +145,7 @@ def error(message, id: [], &block)
# Used to supply information that suggests action be taken by user
#
# @param [String] message
# @param [Symbol, Array<Sybmol>] id
# @param [Symbol, Array<Symbol>] id
# @yield see #deprecate
#
def warn(message, id: [], &block)
Expand Down
82 changes: 82 additions & 0 deletions rb/rbs_collection.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
sources:
- type: git
name: ruby/gem_rbs_collection
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
path: ".gem_rbs_collection"
gems:
- name: ast
version: '2.4'
source:
type: git
name: ruby/gem_rbs_collection
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: base64
version: '0'
source:
type: stdlib
- name: cgi
version: '0'
source:
type: stdlib
- name: json
version: '0'
source:
type: stdlib
- name: logger
version: '0'
source:
type: stdlib
- name: monitor
version: '0'
source:
type: stdlib
- name: optparse
version: '0'
source:
type: stdlib
- name: parallel
version: '1.20'
source:
type: git
name: ruby/gem_rbs_collection
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: rack
version: '2.2'
source:
type: git
name: ruby/gem_rbs_collection
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: rainbow
version: '3.0'
source:
type: git
name: ruby/gem_rbs_collection
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
- name: tempfile
version: '0'
source:
type: stdlib
- name: uri
version: '0'
source:
type: stdlib
- name: yard
version: '0.9'
source:
type: git
name: ruby/gem_rbs_collection
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
remote: https://github.com/ruby/gem_rbs_collection.git
repo_dir: gems
gemfile_lock_path: Gemfile.lock
24 changes: 24 additions & 0 deletions rb/rbs_collection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Download sources
sources:
- type: git
name: ruby/gem_rbs_collection
remote: https://github.com/ruby/gem_rbs_collection.git
revision: main
repo_dir: gems

# You can specify local directories as sources also.
# - type: local
# path: path/to/your/local/repository

# A directory to install the downloaded RBSs
path: .gem_rbs_collection

gems:
# Skip loading rbs gem's RBS.
# It's unnecessary if you don't use rbs as a library.
- name: rbs
ignore: true
- name: steep
ignore: true
- name: selenium-webdriver
ignore: true
2 changes: 1 addition & 1 deletion rb/selenium-devtools.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ Gem::Specification.new do |s|

s.require_paths = ['lib']

s.add_runtime_dependency 'selenium-webdriver', '~> 4.2'
s.add_runtime_dependency 'selenium-webdriver', '~> 4.2.0'
titusfortner marked this conversation as resolved.
Show resolved Hide resolved
end
2 changes: 2 additions & 0 deletions rb/selenium-webdriver.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'rubyzip', ['>= 1.2.2', '< 3.0']
s.add_runtime_dependency 'websocket', ['~> 1.0']

s.add_development_dependency 'steep', ['~> 1.5']
s.add_development_dependency 'rack', ['~> 2.0']
s.add_development_dependency 'rake', ['~> 13.0']
s.add_development_dependency 'rbs', ['~> 3.2.0']
s.add_development_dependency 'rspec', ['~> 3.0']
s.add_development_dependency 'rubocop', ['~> 1.42']
s.add_development_dependency 'rubocop-performance', ['~> 1.15']
Expand Down
5 changes: 5 additions & 0 deletions rb/sig/lib/selenium/devtools/version.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Selenium
module DevTools
VERSION: String
end
end
34 changes: 34 additions & 0 deletions rb/sig/lib/selenium/webdriver.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module Selenium
module WebDriver
class Point
attr_reader x: Integer
attr_reader y: Integer

def initialize: (Integer x, Integer y) -> void
end

class Dimension
attr_reader width: Integer
attr_reader height: Integer

def initialize: (Integer width, Integer height) -> void
end

class Rectangle
attr_reader x: Integer
attr_reader y: Integer
attr_reader width: Integer
attr_reader height: Integer

def initialize: (Integer x, Integer y, Integer width, Integer height) -> void
end

@root: String

def self.root: () -> String

def self.for: (*String args) -> WebDriver::Driver

def self.logger: (**String | Symbol opts) -> WebDriver::Logger
end
end
11 changes: 11 additions & 0 deletions rb/sig/lib/selenium/webdriver/atoms.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Selenium
module WebDriver
module Atoms
private

def read_atom: (Symbol function) -> String

def execute_atom: (Symbol function_name, *untyped arguments) -> untyped
end
end
end
13 changes: 13 additions & 0 deletions rb/sig/lib/selenium/webdriver/chrome.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Selenium
module WebDriver
module Chrome
self.@path: String

@path: String

def self.path=: (String path) -> String

def self.path: () -> String?
end
end
end
13 changes: 13 additions & 0 deletions rb/sig/lib/selenium/webdriver/chrome/features.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Selenium
module WebDriver
module Chrome
module Features
include WebDriver::Chromium::Features

CHROME_COMMANDS: Hash[Symbol, Array[Symbol | String]]

def commands: (Symbol command) -> Array[Symbol | String]
end
end
end
end
6 changes: 6 additions & 0 deletions rb/sig/lib/selenium/webdriver/chromium.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Selenium
module WebDriver
module Chromium
end
end
end