Skip to content

Commit 32b784a

Browse files
committed
Merge branch 'feature/mock'
2 parents 5986ec0 + af7f072 commit 32b784a

Some content is hidden

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

60 files changed

+28270
-166
lines changed

.github/workflows/ci_ruby.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
CI: true
2121
strategy:
2222
matrix:
23-
ruby-version: ['2.7', '3.0', '3.1', '3.2']
23+
ruby-version: ['3.2', '3.3', '3.4']
2424
steps:
2525
- name: Checkout code
2626
uses: actions/checkout@v3
@@ -31,3 +31,19 @@ jobs:
3131
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
3232
- name: Run unit tests
3333
run: bundle exec rake test
34+
typecheck_and_lint:
35+
runs-on: ubuntu-latest
36+
env:
37+
CI: true
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v3
41+
- name: Install Ruby and gems
42+
uses: ruby/setup-ruby@v1
43+
with:
44+
ruby-version: '3.4'
45+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
46+
- name: Lint
47+
run: bundle exec rubocop --parallel --color
48+
- name: Typecheck
49+
run: bundle exec srb tc

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/pkg/
77
/spec/reports/
88
/tmp/
9+
.byebug_history

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
inherit_gem:
2-
rubocop-espago: rubocop.yml
2+
rubocop-espago: sorbet.yml
33

44
AllCops:
5-
TargetRubyVersion: 2.7
5+
TargetRubyVersion: 3.2

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.0
1+
3.4.2

Gemfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ source 'https://rubygems.org'
55
# Specify your gem's dependencies in data_plane_api.gemspec
66
gemspec
77

8+
gem 'byebug', '~> 12.0' # debugger
89
gem 'minitest', '~> 5.0' # Tests framework
910
gem 'rake', '~> 13.0' # Ruby automation tasks
1011
gem 'rubocop', '~> 1.21' # Ruby linter
1112
gem 'rubocop-espago', '~> 1.0' # Custom Ruby linter config
12-
gem 'solargraph' # Ruby language server
13+
gem 'rubocop-sorbet', '~> 0.10.0' # Rubocop config for sorbet
1314
gem 'shoulda-context', '~> 2.0' # Testing utilities
14-
gem 'vcr' # Save HTTP interactions to files during tests
15-
gem 'webmock' # Mock network interactions
15+
gem 'sorbet', '~> 0.5' # static typechecker
16+
gem 'tapioca', '~> 0.16.11', require: false # RBI generator
17+
gem 'vcr', '~> 6.3.1' # Save HTTP interactions to files during tests
18+
gem 'webmock', '~> 3.25.1' # Mock network interactions

Gemfile.lock

Lines changed: 88 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,105 +2,134 @@ PATH
22
remote: .
33
specs:
44
data_plane_api (0.1.2)
5+
booleans (~> 0.1.3)
56
faraday (> 1, < 3)
7+
sorbet-runtime (~> 0.5)
68

79
GEM
810
remote: https://rubygems.org/
911
specs:
10-
addressable (2.8.1)
11-
public_suffix (>= 2.0.2, < 6.0)
12-
ast (2.4.2)
13-
backport (1.2.0)
12+
addressable (2.8.7)
13+
public_suffix (>= 2.0.2, < 7.0)
14+
ast (2.4.3)
15+
base64 (0.2.0)
1416
benchmark (0.2.1)
15-
crack (0.4.5)
17+
bigdecimal (3.1.9)
18+
booleans (0.1.3)
19+
sorbet-runtime (>= 0.5)
20+
byebug (12.0.0)
21+
crack (1.0.0)
22+
bigdecimal
1623
rexml
17-
diff-lcs (1.5.0)
18-
e2mmap (0.1.0)
24+
erubi (1.13.1)
1925
faraday (2.7.2)
2026
faraday-net_http (>= 2.0, < 3.1)
2127
ruby2_keywords (>= 0.0.4)
2228
faraday-net_http (3.0.2)
23-
hashdiff (1.0.1)
24-
jaro_winkler (1.5.4)
25-
json (2.6.3)
26-
kramdown (2.4.0)
27-
rexml
28-
kramdown-parser-gfm (1.1.0)
29-
kramdown (~> 2.0)
30-
mini_portile2 (2.8.1)
31-
minitest (5.16.3)
32-
nokogiri (1.13.10)
33-
mini_portile2 (~> 2.8.0)
34-
racc (~> 1.4)
35-
parallel (1.22.1)
36-
parser (3.1.3.0)
29+
hashdiff (1.1.2)
30+
json (2.10.2)
31+
language_server-protocol (3.17.0.4)
32+
lint_roller (1.1.0)
33+
logger (1.7.0)
34+
minitest (5.25.5)
35+
netrc (0.11.0)
36+
parallel (1.26.3)
37+
parser (3.3.7.4)
3738
ast (~> 2.4.1)
38-
public_suffix (5.0.1)
39-
racc (1.6.1)
39+
racc
40+
prism (1.4.0)
41+
public_suffix (6.0.1)
42+
racc (1.8.1)
4043
rainbow (3.1.1)
4144
rake (13.0.6)
42-
regexp_parser (2.6.1)
43-
reverse_markdown (2.1.1)
44-
nokogiri
45-
rexml (3.2.5)
46-
rubocop (1.41.1)
45+
rbi (0.3.1)
46+
prism (~> 1.0)
47+
rbs (>= 3.4.4)
48+
sorbet-runtime (>= 0.5.9204)
49+
rbs (3.9.2)
50+
logger
51+
regexp_parser (2.10.0)
52+
rexml (3.4.1)
53+
rubocop (1.75.2)
4754
json (~> 2.3)
55+
language_server-protocol (~> 3.17.0.2)
56+
lint_roller (~> 1.1.0)
4857
parallel (~> 1.10)
49-
parser (>= 3.1.2.1)
58+
parser (>= 3.3.0.2)
5059
rainbow (>= 2.2.2, < 4.0)
51-
regexp_parser (>= 1.8, < 3.0)
52-
rexml (>= 3.2.5, < 4.0)
53-
rubocop-ast (>= 1.23.0, < 2.0)
60+
regexp_parser (>= 2.9.3, < 3.0)
61+
rubocop-ast (>= 1.44.0, < 2.0)
5462
ruby-progressbar (~> 1.7)
55-
unicode-display_width (>= 1.4.0, < 3.0)
56-
rubocop-ast (1.24.0)
57-
parser (>= 3.1.1.0)
58-
rubocop-espago (1.0.2)
63+
unicode-display_width (>= 2.4.0, < 4.0)
64+
rubocop-ast (1.44.0)
65+
parser (>= 3.3.7.2)
66+
prism (~> 1.4)
67+
rubocop-espago (1.1.8)
5968
rubocop
60-
ruby-progressbar (1.11.0)
69+
rubocop-sorbet (0.10.0)
70+
rubocop (>= 1)
71+
ruby-progressbar (1.13.0)
6172
ruby2_keywords (0.0.5)
6273
shoulda-context (2.0.0)
63-
solargraph (0.48.0)
64-
backport (~> 1.2)
74+
sorbet (0.5.12003)
75+
sorbet-static (= 0.5.12003)
76+
sorbet-runtime (0.5.12003)
77+
sorbet-static (0.5.12003-universal-darwin)
78+
sorbet-static (0.5.12003-x86_64-linux)
79+
sorbet-static-and-runtime (0.5.12003)
80+
sorbet (= 0.5.12003)
81+
sorbet-runtime (= 0.5.12003)
82+
spoom (1.6.1)
83+
erubi (>= 1.10.0)
84+
prism (>= 0.28.0)
85+
rbi (>= 0.2.3)
86+
sorbet-static-and-runtime (>= 0.5.10187)
87+
thor (>= 0.19.2)
88+
tapioca (0.16.11)
6589
benchmark
66-
bundler (>= 1.17.2)
67-
diff-lcs (~> 1.4)
68-
e2mmap
69-
jaro_winkler (~> 1.5)
70-
kramdown (~> 2.3)
71-
kramdown-parser-gfm (~> 1.1)
72-
parser (~> 3.0)
73-
reverse_markdown (>= 1.0.5, < 3)
74-
rubocop (>= 0.52)
75-
thor (~> 1.0)
76-
tilt (~> 2.0)
77-
yard (~> 0.9, >= 0.9.24)
90+
bundler (>= 2.2.25)
91+
netrc (>= 0.11.0)
92+
parallel (>= 1.21.0)
93+
rbi (~> 0.2)
94+
sorbet-static-and-runtime (>= 0.5.11087)
95+
spoom (>= 1.2.0)
96+
thor (>= 1.2.0)
97+
yard-sorbet
7898
thor (1.2.1)
79-
tilt (2.0.11)
80-
unicode-display_width (2.3.0)
81-
vcr (6.1.0)
82-
webmock (3.18.1)
99+
unicode-display_width (3.1.4)
100+
unicode-emoji (~> 4.0, >= 4.0.4)
101+
unicode-emoji (4.0.4)
102+
vcr (6.3.1)
103+
base64
104+
webmock (3.25.1)
83105
addressable (>= 2.8.0)
84106
crack (>= 0.3.2)
85107
hashdiff (>= 0.4.0, < 2.0.0)
86108
webrick (1.7.0)
87109
yard (0.9.28)
88110
webrick (~> 1.7.0)
111+
yard-sorbet (0.9.0)
112+
sorbet-runtime
113+
yard
89114

90115
PLATFORMS
91116
arm64-darwin-20
117+
arm64-darwin-23
92118
x86_64-linux
93119

94120
DEPENDENCIES
121+
byebug (~> 12.0)
95122
data_plane_api!
96123
minitest (~> 5.0)
97124
rake (~> 13.0)
98125
rubocop (~> 1.21)
99126
rubocop-espago (~> 1.0)
127+
rubocop-sorbet (~> 0.10.0)
100128
shoulda-context (~> 2.0)
101-
solargraph
102-
vcr
103-
webmock
129+
sorbet (~> 0.5)
130+
tapioca (~> 0.16.11)
131+
vcr (~> 6.3.1)
132+
webmock (~> 3.25.1)
104133

105134
BUNDLED WITH
106-
2.4.1
135+
2.6.7

bin/export-rbi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
bundle exec spoom srb sigs export

bin/tapioca

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'tapioca' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12+
13+
bundle_binstub = File.expand_path("bundle", __dir__)
14+
15+
if File.file?(bundle_binstub)
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17+
load(bundle_binstub)
18+
else
19+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21+
end
22+
end
23+
24+
require "rubygems"
25+
require "bundler/setup"
26+
27+
load Gem.bin_path("tapioca", "tapioca")

bin/test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
bundle exec rake test

bin/types

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
IFS=$'\n\t'
4+
set -vx
5+
6+
bundle exec tapioca annotations
7+
bundle exec tapioca gems $@
8+
bundle exec tapioca dsl $@

0 commit comments

Comments
 (0)