Skip to content

Commit d9ce7ce

Browse files
chore: improve documentation
1 parent 177d5da commit d9ce7ce

File tree

1,141 files changed

+95859
-0
lines changed

Some content is hidden

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

1,141 files changed

+95859
-0
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This file is used to automatically assign reviewers to PRs
2+
# For more information see: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
3+
4+
* @openai/sdks-team

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
- next
10+
11+
jobs:
12+
lint:
13+
name: lint
14+
runs-on: ubuntu-latest
15+
if: github.repository == 'openai/openai-ruby'
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
bundler-cache: false
23+
ruby-version: '3.1'
24+
- run: |-
25+
bundle install
26+
27+
- name: Run lints
28+
run: ./scripts/lint
29+
test:
30+
name: test
31+
runs-on: ubuntu-latest
32+
if: github.repository == 'openai/openai-ruby'
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Set up Ruby
37+
uses: ruby/setup-ruby@v1
38+
with:
39+
bundler-cache: false
40+
ruby-version: '3.1'
41+
- run: |-
42+
bundle install
43+
44+
- name: Run tests
45+
run: ./scripts/test
46+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Create releases
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *' # every day at 5am UTC
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
name: release
12+
if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-ruby'
13+
runs-on: ubuntu-latest
14+
environment: publish
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: stainless-api/trigger-release-please@v1
20+
id: release
21+
with:
22+
repo: ${{ github.event.repository.full_name }}
23+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
24+
25+
- name: Update RubyDocs
26+
if: ${{ steps.release.outputs.releases_created }}
27+
run: |
28+
curl -i -H "Content-Type: application/json" -X POST -d '{"repository":{"url":"https://github.com/openai/openai-ruby"}}' https://www.rubydoc.info/checkout

.github/workflows/publish-gem.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# workflow for re-running publishing to rubygems.org in case it fails for some reason
2+
# you can run this workflow by navigating to https://www.github.com/openai/openai-python/actions/workflows/publish-gem.yml
3+
name: Publish Gem
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
name: publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Ruby
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
bundler-cache: false
18+
ruby-version: '3.1'
19+
- run: |-
20+
bundle install
21+
22+
- name: Publish to RubyGems.org
23+
run: |
24+
bash ./bin/publish-gem
25+
env:
26+
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
27+
RUBYGEMS_HOST: ${{ secrets.OPENAI_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
28+
GEM_HOST_API_KEY: ${{ secrets.OPENAI_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Doctor
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
environment: publish
13+
if: github.repository == 'openai/openai-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Check release environment
19+
run: |
20+
bash ./bin/check-release-environment
21+
env:
22+
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
23+
RUBYGEMS_HOST: ${{ secrets.OPENAI_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
24+
GEM_HOST_API_KEY: ${{ secrets.OPENAI_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.prism.log
2+
.idea/
3+
.ruby-lsp/
4+
.yardoc/
5+
doc/
6+
sorbet/
7+
Brewfile.lock.json
8+
bin/tapioca
9+
*.gem

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1-alpha.0"
3+
}

.rubocop.yml

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
---
2+
# Explicitly disable pending cops for now. This is the default behaviour but
3+
# this avoids a large warning every time we run it.
4+
# Stop RuboCop nagging about rubocop-rake.
5+
# Ensure that RuboCop validates according to the lowest version of Ruby that we support.
6+
AllCops:
7+
Exclude:
8+
- "bin/*"
9+
NewCops: enable
10+
SuggestExtensions: false
11+
TargetRubyVersion: 3.1.0
12+
13+
# Don't require this extra line break, it can be excessive.
14+
Layout/EmptyLineAfterGuardClause:
15+
Enabled: false
16+
17+
# Don't leave complex assignment values hanging off to the right.
18+
Layout/EndAlignment:
19+
EnforcedStyleAlignWith: variable
20+
21+
Layout/FirstArrayElementLineBreak:
22+
Enabled: true
23+
24+
Layout/FirstHashElementLineBreak:
25+
Enabled: true
26+
27+
Layout/FirstMethodArgumentLineBreak:
28+
Enabled: true
29+
30+
Layout/FirstMethodParameterLineBreak:
31+
Enabled: true
32+
33+
# Set a reasonable line length; rely on other cops to correct long lines.
34+
Layout/LineLength:
35+
AllowedPatterns:
36+
- "^\\s*#.*$"
37+
- ^require(_relative)?
38+
- "OpenAI::(Models|Resources)::"
39+
Max: 110
40+
41+
Layout/MultilineArrayLineBreaks:
42+
Enabled: true
43+
44+
# Start the assignment on the same line variable is mentioned.
45+
Layout/MultilineAssignmentLayout:
46+
EnforcedStyle: same_line
47+
48+
Layout/MultilineHashKeyLineBreaks:
49+
Enabled: true
50+
51+
Layout/MultilineMethodArgumentLineBreaks:
52+
Enabled: true
53+
54+
Layout/MultilineMethodParameterLineBreaks:
55+
Enabled: true
56+
57+
# Prefer compact hash literals.
58+
Layout/SpaceInsideHashLiteralBraces:
59+
EnforcedStyle: no_space
60+
61+
# Fairly useful in tests for pattern assertions.
62+
Lint/EmptyInPattern:
63+
Exclude:
64+
- "test/**/*"
65+
66+
Lint/MissingSuper:
67+
Exclude:
68+
- "**/*.rbi"
69+
70+
# Disabled for safety reasons, this option changes code semantics.
71+
Lint/UnusedMethodArgument:
72+
AutoCorrect: false
73+
74+
Metrics/AbcSize:
75+
Enabled: false
76+
77+
Metrics/ClassLength:
78+
Enabled: false
79+
80+
Metrics/CyclomaticComplexity:
81+
Enabled: false
82+
83+
Metrics/MethodLength:
84+
Enabled: false
85+
86+
Metrics/ParameterLists:
87+
Enabled: false
88+
89+
Metrics/PerceivedComplexity:
90+
Enabled: false
91+
92+
Naming/BlockForwarding:
93+
Exclude:
94+
- "**/*.rbi"
95+
96+
Naming/MethodParameterName:
97+
Exclude:
98+
- "**/*.rbi"
99+
100+
Naming/VariableNumber:
101+
Enabled: false
102+
103+
# Nothing wrong with inline private methods.
104+
Style/AccessModifierDeclarations:
105+
Enabled: false
106+
107+
Style/AccessorGrouping:
108+
Exclude:
109+
- "**/*.rbi"
110+
111+
# Behaviour of alias_method is more predictable.
112+
Style/Alias:
113+
EnforcedStyle: prefer_alias_method
114+
115+
# And/or have confusing precedence, avoid them.
116+
Style/AndOr:
117+
EnforcedStyle: always
118+
119+
Style/BisectedAttrAccessor:
120+
Exclude:
121+
- "**/*.rbi"
122+
123+
# We prefer nested modules in lib/, but are currently using compact style for tests.
124+
Style/ClassAndModuleChildren:
125+
Exclude:
126+
- "test/**/*"
127+
128+
# We should go back and add these docs, but ignore for now.
129+
Style/Documentation:
130+
Enabled: false
131+
132+
# Allow explicit empty elses, for clarity.
133+
Style/EmptyElse:
134+
Enabled: false
135+
136+
Style/EmptyMethod:
137+
Exclude:
138+
- "**/*.rbi"
139+
140+
# We commonly use ENV['KEY'], it's OK.
141+
Style/FetchEnvVar:
142+
Enabled: false
143+
144+
# Just to be safe, ensure nobody is mutating our internal strings.
145+
Style/FrozenStringLiteralComment:
146+
EnforcedStyle: always
147+
Exclude:
148+
- "**/*.rbi"
149+
150+
# Nothing wrong with clear if statements.
151+
Style/IfUnlessModifier:
152+
Enabled: false
153+
154+
# Rubocop is pretty bad about mangling single line lambdas.
155+
Style/Lambda:
156+
Enabled: false
157+
158+
# Prefer consistency in method calling syntax.
159+
Style/MethodCallWithArgsParentheses:
160+
AllowedMethods:
161+
- raise
162+
Enabled: true
163+
Exclude:
164+
- "**/*.gemspec"
165+
166+
# Perfectly fine.
167+
Style/MultipleComparison:
168+
Enabled: false
169+
170+
Style/MutableConstant:
171+
Exclude:
172+
- "**/*.rbi"
173+
174+
# Not all parameters should be named.
175+
Style/NumberedParameters:
176+
Enabled: false
177+
178+
Style/NumberedParametersLimit:
179+
Max: 2
180+
181+
# Reasonable to use brackets for errors with long messages.
182+
Style/RaiseArgs:
183+
Enabled: false
184+
185+
# Be explicit about `RuntimeError`s.
186+
Style/RedundantException:
187+
Enabled: false
188+
189+
Style/RedundantInitialize:
190+
Exclude:
191+
- "**/*.rbi"
192+
193+
# Prefer slashes for regex literals.
194+
Style/RegexpLiteral:
195+
EnforcedStyle: slashes
196+
197+
# Allow explicit ifs, especially for imperative use.
198+
Style/SafeNavigation:
199+
Enabled: false
200+
201+
# We use these sparingly, where we anticipate future branches for the
202+
# inner conditional.
203+
Style/SoleNestedConditional:
204+
Enabled: false
205+
206+
# Prefer double quotes so that interpolation can be easily added.
207+
Style/StringLiterals:
208+
EnforcedStyle: double_quotes
209+
210+
# Prefer explicit symbols for clarity; you can search for `:the_symbol`.
211+
Style/SymbolArray:
212+
EnforcedStyle: brackets

.stats.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
configured_endpoints: 80
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-c8579861bc21d4d2155a5b9e8e7d54faee8083730673c4d32cbbe573d7fb4116.yml

.yardopts

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

0 commit comments

Comments
 (0)