Skip to content

Commit

Permalink
Add RBS files to Ruby (#12844)
Browse files Browse the repository at this point in the history
Co-authored-by: aguspe <agustin.pe94@gmail.com>
  • Loading branch information
aguspe and aguspe authored Nov 20, 2023
1 parent eb0a321 commit b9ef666
Show file tree
Hide file tree
Showing 49 changed files with 1,502 additions and 29 deletions.
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
1 change: 1 addition & 0 deletions rb/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Dir["#{__dir__}/*.gemspec"].each do |spec|
end

gem 'debug', '~> 1.7', require: false, platforms: %i[mri mingw x64_mingw]
gem 'steep', '~> 1.5.0', require: false, platforms: %i[mri mingw x64_mingw]
118 changes: 93 additions & 25 deletions rb/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,78 @@ PATH
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.4)
abbrev (0.1.1)
activesupport (7.1.2)
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.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.4)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crack (0.4.5)
rexml
csv (3.2.8)
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
diff-lcs (1.5.0)
drb (2.2.0)
ruby2_keywords
ffi (1.16.3)
fileutils (1.7.2)
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)
io-console (0.6.0-java)
irb (1.9.0)
rdoc
reline (>= 0.3.8)
jar-dependencies (0.4.1)
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.6.0)
minitest (5.20.0)
mutex_m (0.2.0)
parallel (1.23.0)
parser (3.2.2.3)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
public_suffix (5.0.1)
racc (1.7.1)
racc (1.7.1-java)
rack (2.2.7)
psych (5.1.1.1)
stringio
psych (5.1.1.1-java)
jar-dependencies (>= 0.1.7)
public_suffix (5.0.4)
racc (1.7.3)
racc (1.7.3-java)
rack (2.2.8)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.1)
reline (0.3.5)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rbs (3.3.0)
abbrev
rdoc (6.6.0)
psych (>= 4.0.0)
regexp_parser (2.8.2)
reline (0.4.0)
io-console (~> 0.5)
rexml (3.2.5)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -50,38 +92,61 @@ GEM
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.54.0)
rubocop (1.57.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.23.1)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-performance (1.18.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rspec (2.22.0)
rubocop (~> 1.33)
rubocop-rspec (2.25.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
unicode-display_width (2.4.2)
webmock (3.18.1)
securerandom (0.3.0)
steep (1.6.0)
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)
stringio (3.0.9)
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.5.0)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand All @@ -92,6 +157,8 @@ GEM
PLATFORMS
java
ruby
universal-java-1.8
universal-java-17
universal-java-18
x64-mingw32

Expand All @@ -105,9 +172,10 @@ DEPENDENCIES
rubocop-rspec (~> 2.16)
selenium-devtools!
selenium-webdriver!
steep (~> 1.6.0)
webmock (~> 3.5)
webrick (~> 1.7)
yard (~> 0.9.11)

BUNDLED WITH
2.2.34
2.4.10
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
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
Loading

0 comments on commit b9ef666

Please sign in to comment.