Skip to content

Commit b9ef666

Browse files
authored
Add RBS files to Ruby (#12844)
Co-authored-by: aguspe <[email protected]>
1 parent eb0a321 commit b9ef666

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1502
-29
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ GTAGS
108108
/rb/.idea
109109
rb/bin/
110110
rb/lib/selenium/devtools/v1*
111+
rb/.gem_rbs_collection/
111112
.sonar/
112113
.idea/sonarIssues.xml
113114
.idea/inspectionProfiles/profiles_settings.xml

rb/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Dir["#{__dir__}/*.gemspec"].each do |spec|
66
end
77

88
gem 'debug', '~> 1.7', require: false, platforms: %i[mri mingw x64_mingw]
9+
gem 'steep', '~> 1.5.0', require: false, platforms: %i[mri mingw x64_mingw]

rb/Gemfile.lock

Lines changed: 93 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,78 @@ PATH
1111
GEM
1212
remote: https://rubygems.org/
1313
specs:
14-
addressable (2.8.4)
14+
abbrev (0.1.1)
15+
activesupport (7.1.2)
16+
base64
17+
bigdecimal
18+
concurrent-ruby (~> 1.0, >= 1.0.2)
19+
connection_pool (>= 2.2.5)
20+
drb
21+
i18n (>= 1.6, < 2)
22+
minitest (>= 5.1)
23+
mutex_m
24+
tzinfo (~> 2.0)
25+
addressable (2.8.5)
1526
public_suffix (>= 2.0.2, < 6.0)
1627
ast (2.4.2)
28+
base64 (0.2.0)
29+
bigdecimal (3.1.4)
30+
concurrent-ruby (1.2.2)
31+
connection_pool (2.4.1)
1732
crack (0.4.5)
1833
rexml
34+
csv (3.2.8)
1935
debug (1.8.0)
2036
irb (>= 1.5.0)
2137
reline (>= 0.3.1)
2238
diff-lcs (1.5.0)
39+
drb (2.2.0)
40+
ruby2_keywords
41+
ffi (1.16.3)
42+
fileutils (1.7.2)
2343
hashdiff (1.0.1)
44+
i18n (1.14.1)
45+
concurrent-ruby (~> 1.0)
2446
io-console (0.6.0)
25-
irb (1.7.0)
26-
reline (>= 0.3.0)
47+
io-console (0.6.0-java)
48+
irb (1.9.0)
49+
rdoc
50+
reline (>= 0.3.8)
51+
jar-dependencies (0.4.1)
2752
json (2.6.3)
2853
json (2.6.3-java)
2954
language_server-protocol (3.17.0.3)
55+
listen (3.8.0)
56+
rb-fsevent (~> 0.10, >= 0.10.3)
57+
rb-inotify (~> 0.9, >= 0.9.10)
58+
logger (1.6.0)
59+
minitest (5.20.0)
60+
mutex_m (0.2.0)
3061
parallel (1.23.0)
31-
parser (3.2.2.3)
62+
parser (3.2.2.4)
3263
ast (~> 2.4.1)
3364
racc
34-
public_suffix (5.0.1)
35-
racc (1.7.1)
36-
racc (1.7.1-java)
37-
rack (2.2.7)
65+
psych (5.1.1.1)
66+
stringio
67+
psych (5.1.1.1-java)
68+
jar-dependencies (>= 0.1.7)
69+
public_suffix (5.0.4)
70+
racc (1.7.3)
71+
racc (1.7.3-java)
72+
rack (2.2.8)
3873
rainbow (3.1.1)
39-
rake (13.0.6)
40-
regexp_parser (2.8.1)
41-
reline (0.3.5)
74+
rake (13.1.0)
75+
rb-fsevent (0.11.2)
76+
rb-inotify (0.10.1)
77+
ffi (~> 1.0)
78+
rbs (3.3.0)
79+
abbrev
80+
rdoc (6.6.0)
81+
psych (>= 4.0.0)
82+
regexp_parser (2.8.2)
83+
reline (0.4.0)
4284
io-console (~> 0.5)
43-
rexml (3.2.5)
85+
rexml (3.2.6)
4486
rspec (3.12.0)
4587
rspec-core (~> 3.12.0)
4688
rspec-expectations (~> 3.12.0)
@@ -50,38 +92,61 @@ GEM
5092
rspec-expectations (3.12.3)
5193
diff-lcs (>= 1.2.0, < 2.0)
5294
rspec-support (~> 3.12.0)
53-
rspec-mocks (3.12.5)
95+
rspec-mocks (3.12.6)
5496
diff-lcs (>= 1.2.0, < 2.0)
5597
rspec-support (~> 3.12.0)
5698
rspec-support (3.12.1)
57-
rubocop (1.54.0)
99+
rubocop (1.57.2)
58100
json (~> 2.3)
59101
language_server-protocol (>= 3.17.0)
60102
parallel (~> 1.10)
61-
parser (>= 3.2.2.3)
103+
parser (>= 3.2.2.4)
62104
rainbow (>= 2.2.2, < 4.0)
63105
regexp_parser (>= 1.8, < 3.0)
64106
rexml (>= 3.2.5, < 4.0)
65-
rubocop-ast (>= 1.28.0, < 2.0)
107+
rubocop-ast (>= 1.28.1, < 2.0)
66108
ruby-progressbar (~> 1.7)
67109
unicode-display_width (>= 2.4.0, < 3.0)
68-
rubocop-ast (1.29.0)
110+
rubocop-ast (1.30.0)
69111
parser (>= 3.2.1.0)
70-
rubocop-capybara (2.18.0)
112+
rubocop-capybara (2.19.0)
71113
rubocop (~> 1.41)
72-
rubocop-factory_bot (2.23.1)
114+
rubocop-factory_bot (2.24.0)
73115
rubocop (~> 1.33)
74-
rubocop-performance (1.18.0)
116+
rubocop-performance (1.19.1)
75117
rubocop (>= 1.7.0, < 2.0)
76118
rubocop-ast (>= 0.4.0)
77-
rubocop-rspec (2.22.0)
78-
rubocop (~> 1.33)
119+
rubocop-rspec (2.25.0)
120+
rubocop (~> 1.40)
79121
rubocop-capybara (~> 2.17)
80122
rubocop-factory_bot (~> 2.22)
81123
ruby-progressbar (1.13.0)
124+
ruby2_keywords (0.0.5)
82125
rubyzip (2.3.2)
83-
unicode-display_width (2.4.2)
84-
webmock (3.18.1)
126+
securerandom (0.3.0)
127+
steep (1.6.0)
128+
activesupport (>= 5.1)
129+
concurrent-ruby (>= 1.1.10)
130+
csv (>= 3.0.9)
131+
fileutils (>= 1.1.0)
132+
json (>= 2.1.0)
133+
language_server-protocol (>= 3.15, < 4.0)
134+
listen (~> 3.0)
135+
logger (>= 1.3.0)
136+
parser (>= 3.1)
137+
rainbow (>= 2.2.2, < 4.0)
138+
rbs (>= 3.1.0)
139+
securerandom (>= 0.1)
140+
strscan (>= 1.0.0)
141+
terminal-table (>= 2, < 4)
142+
stringio (3.0.9)
143+
strscan (3.0.7)
144+
terminal-table (3.0.2)
145+
unicode-display_width (>= 1.1.1, < 3)
146+
tzinfo (2.0.6)
147+
concurrent-ruby (~> 1.0)
148+
unicode-display_width (2.5.0)
149+
webmock (3.19.1)
85150
addressable (>= 2.8.0)
86151
crack (>= 0.3.2)
87152
hashdiff (>= 0.4.0, < 2.0.0)
@@ -92,6 +157,8 @@ GEM
92157
PLATFORMS
93158
java
94159
ruby
160+
universal-java-1.8
161+
universal-java-17
95162
universal-java-18
96163
x64-mingw32
97164

@@ -105,9 +172,10 @@ DEPENDENCIES
105172
rubocop-rspec (~> 2.16)
106173
selenium-devtools!
107174
selenium-webdriver!
175+
steep (~> 1.6.0)
108176
webmock (~> 3.5)
109177
webrick (~> 1.7)
110178
yard (~> 0.9.11)
111179

112180
BUNDLED WITH
113-
2.2.34
181+
2.4.10

rb/Steepfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target :lib do
2+
signature 'sig' # Signature directory
3+
check 'lib' # Directory name
4+
end

rb/lib/selenium/webdriver/common/logger.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def allow(ids)
112112
# Overrides default #debug to skip ignored messages by provided id
113113
#
114114
# @param [String] message
115-
# @param [Symbol, Array<Sybmol>] id
115+
# @param [Symbol, Array<Symbol>] id
116116
# @yield see #deprecate
117117
#
118118
def debug(message, id: [], &block)
@@ -123,7 +123,7 @@ def debug(message, id: [], &block)
123123
# Used to supply information of general interest
124124
#
125125
# @param [String] message
126-
# @param [Symbol, Array<Sybmol>] id
126+
# @param [Symbol, Array<Symbol>] id
127127
# @yield see #deprecate
128128
#
129129
def info(message, id: [], &block)
@@ -134,7 +134,7 @@ def info(message, id: [], &block)
134134
# Used to supply information that suggests an error occurred
135135
#
136136
# @param [String] message
137-
# @param [Symbol, Array<Sybmol>] id
137+
# @param [Symbol, Array<Symbol>] id
138138
# @yield see #deprecate
139139
#
140140
def error(message, id: [], &block)
@@ -145,7 +145,7 @@ def error(message, id: [], &block)
145145
# Used to supply information that suggests action be taken by user
146146
#
147147
# @param [String] message
148-
# @param [Symbol, Array<Sybmol>] id
148+
# @param [Symbol, Array<Symbol>] id
149149
# @yield see #deprecate
150150
#
151151
def warn(message, id: [], &block)

rb/rbs_collection.lock.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
sources:
3+
- type: git
4+
name: ruby/gem_rbs_collection
5+
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
6+
remote: https://github.com/ruby/gem_rbs_collection.git
7+
repo_dir: gems
8+
path: ".gem_rbs_collection"
9+
gems:
10+
- name: ast
11+
version: '2.4'
12+
source:
13+
type: git
14+
name: ruby/gem_rbs_collection
15+
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
16+
remote: https://github.com/ruby/gem_rbs_collection.git
17+
repo_dir: gems
18+
- name: base64
19+
version: '0'
20+
source:
21+
type: stdlib
22+
- name: cgi
23+
version: '0'
24+
source:
25+
type: stdlib
26+
- name: json
27+
version: '0'
28+
source:
29+
type: stdlib
30+
- name: logger
31+
version: '0'
32+
source:
33+
type: stdlib
34+
- name: monitor
35+
version: '0'
36+
source:
37+
type: stdlib
38+
- name: optparse
39+
version: '0'
40+
source:
41+
type: stdlib
42+
- name: parallel
43+
version: '1.20'
44+
source:
45+
type: git
46+
name: ruby/gem_rbs_collection
47+
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
48+
remote: https://github.com/ruby/gem_rbs_collection.git
49+
repo_dir: gems
50+
- name: rack
51+
version: '2.2'
52+
source:
53+
type: git
54+
name: ruby/gem_rbs_collection
55+
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
56+
remote: https://github.com/ruby/gem_rbs_collection.git
57+
repo_dir: gems
58+
- name: rainbow
59+
version: '3.0'
60+
source:
61+
type: git
62+
name: ruby/gem_rbs_collection
63+
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
64+
remote: https://github.com/ruby/gem_rbs_collection.git
65+
repo_dir: gems
66+
- name: tempfile
67+
version: '0'
68+
source:
69+
type: stdlib
70+
- name: uri
71+
version: '0'
72+
source:
73+
type: stdlib
74+
- name: yard
75+
version: '0.9'
76+
source:
77+
type: git
78+
name: ruby/gem_rbs_collection
79+
revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
80+
remote: https://github.com/ruby/gem_rbs_collection.git
81+
repo_dir: gems
82+
gemfile_lock_path: Gemfile.lock

rb/rbs_collection.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Download sources
2+
sources:
3+
- type: git
4+
name: ruby/gem_rbs_collection
5+
remote: https://github.com/ruby/gem_rbs_collection.git
6+
revision: main
7+
repo_dir: gems
8+
9+
# You can specify local directories as sources also.
10+
# - type: local
11+
# path: path/to/your/local/repository
12+
13+
# A directory to install the downloaded RBSs
14+
path: .gem_rbs_collection
15+
16+
gems:
17+
# Skip loading rbs gem's RBS.
18+
# It's unnecessary if you don't use rbs as a library.
19+
- name: rbs
20+
ignore: true
21+
- name: steep
22+
ignore: true
23+
- name: selenium-webdriver
24+
ignore: true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Selenium
2+
module DevTools
3+
VERSION: String
4+
end
5+
end

rb/sig/lib/selenium/webdriver.rbs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module Selenium
2+
module WebDriver
3+
class Point
4+
attr_reader x: Integer
5+
attr_reader y: Integer
6+
7+
def initialize: (Integer x, Integer y) -> void
8+
end
9+
10+
class Dimension
11+
attr_reader width: Integer
12+
attr_reader height: Integer
13+
14+
def initialize: (Integer width, Integer height) -> void
15+
end
16+
17+
class Rectangle
18+
attr_reader x: Integer
19+
attr_reader y: Integer
20+
attr_reader width: Integer
21+
attr_reader height: Integer
22+
23+
def initialize: (Integer x, Integer y, Integer width, Integer height) -> void
24+
end
25+
26+
@root: String
27+
28+
def self.root: () -> String
29+
30+
def self.for: (*String args) -> WebDriver::Driver
31+
32+
def self.logger: (**String | Symbol opts) -> WebDriver::Logger
33+
end
34+
end

0 commit comments

Comments
 (0)