Skip to content

Commit 466e85f

Browse files
authored
feat: RBS setup for core appium library (#566)
* RBS setup for core appium library * Update rbs collection yml * Update collections and dependencies
1 parent 33f9ad4 commit 466e85f

27 files changed

+917
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
.idea
1717

1818
.coverage
19+
20+
# for RBS
21+
/.gem_rbs_collection/

Rakefile

+5
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,8 @@ RuboCop::RakeTask.new(:rubocop) do |t|
117117
t.options = %w(-D)
118118
t.fail_on_error = true
119119
end
120+
121+
desc('Run Steep type check')
122+
task :steep do
123+
system('steep check')
124+
end

Steepfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
target :lib do
4+
signature 'sig'
5+
check 'lib' # Directory name
6+
7+
# Standard libraries used in the project
8+
library(
9+
'forwardable'
10+
)
11+
end

appium_lib_core.gemspec

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
3131
spec.add_development_dependency 'rake', '~> 13.0'
3232
spec.add_development_dependency 'rubocop', '1.65.0'
3333
spec.add_development_dependency 'simplecov'
34+
spec.add_development_dependency 'steep', '~> 1.7.0'
3435
spec.add_development_dependency 'webmock', '~> 3.23.0'
3536
spec.add_development_dependency 'yard', '~> 0.9.11'
3637
spec.metadata['rubygems_mfa_required'] = 'true'

rbs_collection.lock.yaml

+252
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
---
2+
path: ".gem_rbs_collection"
3+
gems:
4+
- name: activesupport
5+
version: '7.0'
6+
source:
7+
type: git
8+
name: ruby/gem_rbs_collection
9+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
10+
remote: https://github.com/ruby/gem_rbs_collection.git
11+
repo_dir: gems
12+
- name: addressable
13+
version: '2.8'
14+
source:
15+
type: git
16+
name: ruby/gem_rbs_collection
17+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
18+
remote: https://github.com/ruby/gem_rbs_collection.git
19+
repo_dir: gems
20+
- name: ast
21+
version: '2.4'
22+
source:
23+
type: git
24+
name: ruby/gem_rbs_collection
25+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
26+
remote: https://github.com/ruby/gem_rbs_collection.git
27+
repo_dir: gems
28+
- name: base64
29+
version: '0'
30+
source:
31+
type: stdlib
32+
- name: bigdecimal
33+
version: '0'
34+
source:
35+
type: stdlib
36+
- name: concurrent-ruby
37+
version: '1.1'
38+
source:
39+
type: git
40+
name: ruby/gem_rbs_collection
41+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
42+
remote: https://github.com/ruby/gem_rbs_collection.git
43+
repo_dir: gems
44+
- name: connection_pool
45+
version: '2.4'
46+
source:
47+
type: git
48+
name: ruby/gem_rbs_collection
49+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
50+
remote: https://github.com/ruby/gem_rbs_collection.git
51+
repo_dir: gems
52+
- name: csv
53+
version: '0'
54+
source:
55+
type: stdlib
56+
- name: date
57+
version: '0'
58+
source:
59+
type: stdlib
60+
- name: erb
61+
version: '0'
62+
source:
63+
type: stdlib
64+
- name: ffi
65+
version: 1.17.0
66+
source:
67+
type: rubygems
68+
- name: fileutils
69+
version: '0'
70+
source:
71+
type: stdlib
72+
- name: forwardable
73+
version: '0'
74+
source:
75+
type: stdlib
76+
- name: hashdiff
77+
version: '1.1'
78+
source:
79+
type: git
80+
name: ruby/gem_rbs_collection
81+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
82+
remote: https://github.com/ruby/gem_rbs_collection.git
83+
repo_dir: gems
84+
- name: i18n
85+
version: '1.10'
86+
source:
87+
type: git
88+
name: ruby/gem_rbs_collection
89+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
90+
remote: https://github.com/ruby/gem_rbs_collection.git
91+
repo_dir: gems
92+
- name: json
93+
version: '0'
94+
source:
95+
type: stdlib
96+
- name: listen
97+
version: '3.9'
98+
source:
99+
type: git
100+
name: ruby/gem_rbs_collection
101+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
102+
remote: https://github.com/ruby/gem_rbs_collection.git
103+
repo_dir: gems
104+
- name: logger
105+
version: '0'
106+
source:
107+
type: stdlib
108+
- name: minitest
109+
version: '0'
110+
source:
111+
type: stdlib
112+
- name: monitor
113+
version: '0'
114+
source:
115+
type: stdlib
116+
- name: mutex_m
117+
version: '0'
118+
source:
119+
type: stdlib
120+
- name: optparse
121+
version: '0'
122+
source:
123+
type: stdlib
124+
- name: parallel
125+
version: '1.20'
126+
source:
127+
type: git
128+
name: ruby/gem_rbs_collection
129+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
130+
remote: https://github.com/ruby/gem_rbs_collection.git
131+
repo_dir: gems
132+
- name: parser
133+
version: '3.2'
134+
source:
135+
type: git
136+
name: ruby/gem_rbs_collection
137+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
138+
remote: https://github.com/ruby/gem_rbs_collection.git
139+
repo_dir: gems
140+
- name: rainbow
141+
version: '3.0'
142+
source:
143+
type: git
144+
name: ruby/gem_rbs_collection
145+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
146+
remote: https://github.com/ruby/gem_rbs_collection.git
147+
repo_dir: gems
148+
- name: rake
149+
version: '13.0'
150+
source:
151+
type: git
152+
name: ruby/gem_rbs_collection
153+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
154+
remote: https://github.com/ruby/gem_rbs_collection.git
155+
repo_dir: gems
156+
- name: regexp_parser
157+
version: '2.8'
158+
source:
159+
type: git
160+
name: ruby/gem_rbs_collection
161+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
162+
remote: https://github.com/ruby/gem_rbs_collection.git
163+
repo_dir: gems
164+
- name: ripper
165+
version: '0'
166+
source:
167+
type: stdlib
168+
- name: rubocop
169+
version: '1.57'
170+
source:
171+
type: git
172+
name: ruby/gem_rbs_collection
173+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
174+
remote: https://github.com/ruby/gem_rbs_collection.git
175+
repo_dir: gems
176+
- name: rubocop-ast
177+
version: '1.30'
178+
source:
179+
type: git
180+
name: ruby/gem_rbs_collection
181+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
182+
remote: https://github.com/ruby/gem_rbs_collection.git
183+
repo_dir: gems
184+
- name: rubyzip
185+
version: '2.3'
186+
source:
187+
type: git
188+
name: ruby/gem_rbs_collection
189+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
190+
remote: https://github.com/ruby/gem_rbs_collection.git
191+
repo_dir: gems
192+
- name: securerandom
193+
version: '0'
194+
source:
195+
type: stdlib
196+
- name: simplecov
197+
version: '0.22'
198+
source:
199+
type: git
200+
name: ruby/gem_rbs_collection
201+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
202+
remote: https://github.com/ruby/gem_rbs_collection.git
203+
repo_dir: gems
204+
- name: singleton
205+
version: '0'
206+
source:
207+
type: stdlib
208+
- name: strscan
209+
version: '0'
210+
source:
211+
type: stdlib
212+
- name: thor
213+
version: '1.2'
214+
source:
215+
type: git
216+
name: ruby/gem_rbs_collection
217+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
218+
remote: https://github.com/ruby/gem_rbs_collection.git
219+
repo_dir: gems
220+
- name: time
221+
version: '0'
222+
source:
223+
type: stdlib
224+
- name: timeout
225+
version: '0'
226+
source:
227+
type: stdlib
228+
- name: tzinfo
229+
version: '2.0'
230+
source:
231+
type: git
232+
name: ruby/gem_rbs_collection
233+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
234+
remote: https://github.com/ruby/gem_rbs_collection.git
235+
repo_dir: gems
236+
- name: webmock
237+
version: '3.19'
238+
source:
239+
type: git
240+
name: ruby/gem_rbs_collection
241+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
242+
remote: https://github.com/ruby/gem_rbs_collection.git
243+
repo_dir: gems
244+
- name: yard
245+
version: '0.9'
246+
source:
247+
type: git
248+
name: ruby/gem_rbs_collection
249+
revision: 3670834268f4ea9c10aefeffae7e072b51256375
250+
remote: https://github.com/ruby/gem_rbs_collection.git
251+
repo_dir: gems
252+
gemfile_lock_path: Gemfile.lock

rbs_collection.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Download sources
2+
sources:
3+
- name: ruby/gem_rbs_collection
4+
remote: https://github.com/ruby/gem_rbs_collection.git
5+
revision: main
6+
repo_dir: gems
7+
8+
# A directory to install the downloaded RBSs
9+
path: .gem_rbs_collection
10+
11+
gems:
12+
# Skip loading rbs gem's RBS.
13+
# It's unnecessary if you don't use rbs as a library.
14+
- name: rbs
15+
ignore: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Selenium
2+
module WebDriver
3+
module Support
4+
class AbstractEventListener
5+
end
6+
end
7+
end
8+
end

sig/gems/selenium/capabilities.rbs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Selenium
2+
module WebDriver
3+
module Remote
4+
class Capabilities
5+
end
6+
end
7+
end
8+
end

sig/gems/selenium/default.rbs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module Selenium
2+
module WebDriver
3+
module Remote
4+
module Http
5+
class Default
6+
end
7+
end
8+
end
9+
end
10+
end

sig/gems/selenium/driver.rbs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module Selenium
2+
module WebDriver
3+
class Driver
4+
def capabilities: () -> untyped
5+
end
6+
end
7+
end

sig/gems/selenium/has_session_id.rbs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Selenium
2+
module WebDriver
3+
module DriverExtensions
4+
module HasSessionId
5+
end
6+
end
7+
end
8+
end

sig/gems/selenium/has_web_storage.rbs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Selenium
2+
module WebDriver
3+
module DriverExtensions
4+
module HasWebStorage
5+
end
6+
end
7+
end
8+
end

sig/gems/selenium/uploads_files.rbs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Selenium
2+
module WebDriver
3+
module DriverExtensions
4+
module UploadsFiles
5+
end
6+
end
7+
end
8+
end

sig/lib/appium_lib_core.rbs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Appium
2+
def self.symbolize_keys: (Hash[untyped, untyped] hash, ?nested: bool, ?enable_deprecation_msg: bool)
3+
-> Hash[Symbol, untyped]
4+
5+
module Core
6+
def self.for: (*untyped args) -> Driver
7+
end
8+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Appium
2+
module Core
3+
class Base
4+
class Capabilities < Selenium::WebDriver::Remote::Capabilities
5+
def convert_key: (untyped key) -> untyped
6+
end
7+
end
8+
end
9+
end

0 commit comments

Comments
 (0)