Skip to content

Commit 89de302

Browse files
fix: invalid enum names
1 parent 8a84596 commit 89de302

313 files changed

Lines changed: 6313 additions & 8049 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
6-
pull_request:
7-
branches:
8-
- main
9-
- next
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
1010

1111
jobs:
1212
lint:
13+
timeout-minutes: 10
1314
name: lint
14-
runs-on: ubuntu-latest
15+
runs-on: ${{ github.repository == 'stainless-sdks/finch-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
16+
1517
steps:
1618
- uses: actions/checkout@v4
1719
- name: Set up Ruby
@@ -25,8 +27,9 @@ jobs:
2527
- name: Run lints
2628
run: ./scripts/lint
2729
test:
30+
timeout-minutes: 10
2831
name: test
29-
runs-on: ubuntu-latest
32+
runs-on: ${{ github.repository == 'stainless-sdks/finch-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
3033
steps:
3134
- uses: actions/checkout@v4
3235
- name: Set up Ruby

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
*.gem
22
.idea/
3+
.ignore
34
.prism.log
45
.ruby-lsp/
56
.yardoc/
6-
Brewfile.lock.json
77
bin/tapioca
8+
Brewfile.lock.json
89
doc/
9-
sorbet/*
10-
!/sorbet/config
10+
sorbet/tapioca/*

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ Style/SafeNavigation:
244244
Style/SignalException:
245245
Exclude:
246246
- Rakefile
247+
- "**/*.rake"
247248

248249
# We use these sparingly, where we anticipate future branches for the
249250
# inner conditional.

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.1.0

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-46640c1b468813b828be61b1af5cb5450f9555c4c757c5a740189906a8d56672.yml
3-
openapi_spec_hash: 1d5845ae61d2c0a143db43d579b048c5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-d31af54a2b29a3535df6342584c2511b59a10a7c11c9c983f1cf209199c6ed0e.yml
3+
openapi_spec_hash: 6643320491f28a8bca49846e1b718c70
44
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6

.yardopts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
--type-name-tag generic:Generic
2+
--default-return void
13
--markup markdown
24
--markup-provider redcarpet
35
--exclude /rbi

CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
## Setting up the environment
2+
3+
This repository contains a `.ruby-version` file, which should work with either [rbenv](https://github.com/rbenv/rbenv) or [asdf](https://github.com/asdf-vm/asdf) with the [ruby plugin](https://github.com/asdf-vm/asdf-ruby).
4+
5+
Please follow the instructions for your preferred version manager to install the Ruby version specified in the `.ruby-version` file.
6+
7+
To set up the repository, run:
8+
9+
```bash
10+
$ ./scripts/bootstrap
11+
```
12+
13+
This will install all the required dependencies.
14+
15+
## Modifying/Adding code
16+
17+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents `examples/` directory.
18+
19+
## Adding and running examples
20+
21+
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
22+
23+
```ruby
24+
#!/usr/bin/env ruby
25+
# frozen_string_literal: true
26+
27+
require_relative "../lib/finch_api"
28+
29+
# ...
30+
```
31+
32+
```bash
33+
$ chmod +x './examples/<your-example>.rb'
34+
35+
# run the example against your api
36+
$ ruby './examples/<your-example>.rb'
37+
```
38+
39+
## Using the repository from source
40+
41+
If you’d like to use the repository from source, you can either install from git or reference a cloned repository:
42+
43+
To install via git in your `Gemfile`:
44+
45+
```ruby
46+
gem "finch-api", git: "https://www.github.com/Finch-API/finch-api-ruby"
47+
```
48+
49+
Alternatively, reference local copy of the repo:
50+
51+
```bash
52+
$ git clone -- 'https://www.github.com/Finch-API/finch-api-ruby' '<path-to-repo>'
53+
```
54+
55+
```ruby
56+
gem "finch-api", path: "<path-to-repo>"
57+
```
58+
59+
## Running commands
60+
61+
Running `rake` by itself will show all runnable commands.
62+
63+
```bash
64+
$ bundle exec rake
65+
```
66+
67+
## Running tests
68+
69+
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
70+
71+
```bash
72+
$ npx prism mock path/to/your/openapi.yml
73+
```
74+
75+
```bash
76+
$ bundle exec rake test
77+
```
78+
79+
## Linting and formatting
80+
81+
This repository uses [rubocop](https://github.com/rubocop/rubocop) for linting and formatting of `*.rb` and `*.rbi` files. [syntax_tree](https://github.com/ruby-syntax-tree/syntax_tree) is used for formatting `*.rbs` files.
82+
83+
There are two separate type checkers supported by this library: [sorbet](https://github.com/sorbet/sorbet) and [steep](https://github.com/soutaro/steep) are used for verifying `*.rbi` and `*.rbs` files respectively.
84+
85+
To lint and typecheck:
86+
87+
```bash
88+
$ bundle exec rake lint
89+
```
90+
91+
To format and fix all lint issues automatically:
92+
93+
```bash
94+
$ bundle exec rake format
95+
```
96+
97+
## Editor Support
98+
99+
### Ruby LSP
100+
101+
[Ruby LSP](https://github.com/Shopify/ruby-lsp) has quite good support for go to definition, but not auto-completion.
102+
103+
This can be installed along side Solargraph.
104+
105+
### Solargraph
106+
107+
[Solargraph](https://solargraph.org) has quite good support for auto-completion, but not go to definition.
108+
109+
This can be installed along side Ruby LSP.
110+
111+
### Sorbet
112+
113+
[Sorbet](https://sorbet.org) should mostly work out of the box when editing this library directly. However, there are a some caveats due to the colocation of `*.rb` and `*.rbi` files in the same project. These issues should not otherwise manifest when this library is used as a dependency.
114+
115+
1. For go to definition usages, sorbet might get confused and may not always navigate to the correct location.
116+
117+
2. For each generic type in `*.rbi` files, a spurious "Duplicate type member" error is present.
118+
119+
## Documentation Preview
120+
121+
To preview the documentation, run:
122+
123+
```bash
124+
$ bundle exec rake docs:preview [PORT=8808]
125+
```

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ group :development, :test do
2323
gem "minitest-hooks"
2424
gem "minitest-proveit"
2525
gem "minitest-rg"
26+
gem "webmock"
2627
end
2728

2829
group :development, :docs do

Gemfile.lock

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
finch-api (0.1.0.pre.alpha.11)
14+
finch-api (0.1.0.pre.alpha.12)
1515
connection_pool
1616

1717
GEM
@@ -29,6 +29,8 @@ GEM
2929
minitest (>= 5.1)
3030
securerandom (>= 0.3)
3131
tzinfo (~> 2.0, >= 2.0.5)
32+
addressable (2.8.7)
33+
public_suffix (>= 2.0.2, < 7.0)
3234
ast (2.4.3)
3335
async (2.23.1)
3436
console (~> 1.29)
@@ -45,6 +47,9 @@ GEM
4547
fiber-annotation
4648
fiber-local (~> 1.1)
4749
json
50+
crack (1.0.0)
51+
bigdecimal
52+
rexml
4853
csv (3.3.3)
4954
drb (2.2.1)
5055
erubi (1.13.1)
@@ -54,6 +59,7 @@ GEM
5459
fiber-storage
5560
fiber-storage (1.0.0)
5661
fileutils (1.7.3)
62+
hashdiff (1.1.2)
5763
i18n (1.14.7)
5864
concurrent-ruby (~> 1.0)
5965
io-event (1.10.0)
@@ -82,6 +88,7 @@ GEM
8288
racc
8389
prettier_print (1.2.1)
8490
prism (1.4.0)
91+
public_suffix (6.0.1)
8592
racc (1.8.1)
8693
rainbow (3.1.1)
8794
rake (13.2.1)
@@ -96,6 +103,7 @@ GEM
96103
logger
97104
redcarpet (3.6.1)
98105
regexp_parser (2.10.0)
106+
rexml (3.4.1)
99107
rubocop (1.75.1)
100108
json (~> 2.3)
101109
language_server-protocol (~> 3.17.0.2)
@@ -165,6 +173,10 @@ GEM
165173
unicode-emoji (~> 4.0, >= 4.0.4)
166174
unicode-emoji (4.0.4)
167175
uri (1.0.3)
176+
webmock (3.25.1)
177+
addressable (>= 2.8.0)
178+
crack (>= 0.3.2)
179+
hashdiff (>= 0.4.0, < 2.0.0)
168180
webrick (1.9.1)
169181
yard (0.9.37)
170182
yard-sorbet (0.9.0)
@@ -191,6 +203,7 @@ DEPENDENCIES
191203
syntax_tree
192204
syntax_tree-rbs!
193205
tapioca
206+
webmock
194207
webrick
195208
yard
196209

0 commit comments

Comments
 (0)