Skip to content

Commit f00a06e

Browse files
chore: configure new SDK language
1 parent 1cf2488 commit f00a06e

File tree

460 files changed

+6656
-7003
lines changed

Some content is hidden

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

460 files changed

+6656
-7003
lines changed

.github/workflows/publish-gem.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release-doctor.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.release-please-manifest.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Layout/LineLength:
3939
AllowedPatterns:
4040
- "^\\s*#.*$"
4141
- ^require(_relative)?
42-
- "OnebusawaySDK::Internal::Type::BaseModel$"
42+
- "OpenTransit::Internal::Type::BaseModel$"
4343
- "^\\s*[A-Z0-9_]+ = :"
44-
- "OnebusawaySDK::(Models|Resources|Test)::"
44+
- "OpenTransit::(Models|Resources|Test)::"
4545
Max: 110
4646

4747
Layout/MultilineArrayLineBreaks:

.solargraph.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include:
55
- 'Rakefile'
66
- 'examples/**/*.rb'
77
- 'lib/**/*.rb'
8-
- 'test/onebusaway_sdk/resource_namespaces.rb'
9-
- 'test/onebusaway_sdk/test_helper.rb'
8+
- 'test/open_transit/resource_namespaces.rb'
9+
- 'test/open_transit/test_helper.rb'
1010
exclude:
1111
- 'rbi/**/*'

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-6f08502508c8ad25235971add3124a1cde4f1c3ec705d5df455d750e0adcb90b.yml
3-
openapi_spec_hash: 84d082f35446d29c7db3cfcd259e9859
4-
config_hash: c7e112ec9853ad18fe92551ae0d97656
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-4fcbe9547537b22a2d68329e1d94e0c1a6f81b5af734ca213f7b95eef5da7adb.yml
3+
openapi_spec_hash: 417ea17b08e186b15b2986372592185e
4+
config_hash: 4d49adad69ce123e894ca9186440f091

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This will install all the required dependencies.
1414

1515
## Modifying/Adding code
1616

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 of `lib/onebusaway_sdk/helpers/` and `examples/` directory.
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 of `lib/open_transit/helpers/` and `examples/` directory.
1818

1919
## Adding and running examples
2020

@@ -24,7 +24,7 @@ All files in the `examples/` directory are not modified by the generator and can
2424
#!/usr/bin/env ruby
2525
# frozen_string_literal: true
2626

27-
require_relative "../lib/onebusaway_sdk"
27+
require_relative "../lib/open_transit"
2828

2929
# ...
3030
```
@@ -43,17 +43,17 @@ If you’d like to use the repository from source, you can either install from g
4343
To install via git in your `Gemfile`:
4444

4545
```ruby
46-
gem "onebusaway-sdk", git: "https://www.github.com/OneBusAway/ruby-sdk"
46+
gem "open-transit", git: "https://www.github.com/stainless-sdks/open-transit-ruby"
4747
```
4848

4949
Alternatively, reference local copy of the repo:
5050

5151
```bash
52-
$ git clone -- 'https://www.github.com/OneBusAway/ruby-sdk' '<path-to-repo>'
52+
$ git clone -- 'https://www.github.com/stainless-sdks/open-transit-ruby' '<path-to-repo>'
5353
```
5454

5555
```ruby
56-
gem "onebusaway-sdk", path: "<path-to-repo>"
56+
gem "open-transit", path: "<path-to-repo>"
5757
```
5858

5959
## Running commands

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
onebusaway-sdk (0.1.0.pre.alpha.208)
14+
open-transit (0.1.0.pre.alpha.208)
1515
connection_pool
1616

1717
GEM
@@ -194,7 +194,7 @@ DEPENDENCIES
194194
minitest-hooks
195195
minitest-proveit
196196
minitest-rg
197-
onebusaway-sdk!
197+
open-transit!
198198
rake
199199
rbs
200200
redcarpet

README.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
# Onebusaway SDK Ruby API library
22

3-
The Onebusaway SDK Ruby library provides convenient access to the Onebusaway SDK REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/OneBusAway/ruby-sdk#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
3+
The Onebusaway SDK Ruby library provides convenient access to the Onebusaway SDK REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/stainless-sdks/open-transit-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
44

55
It is generated with [Stainless](https://www.stainless.com/).
66

77
## Documentation
88

9-
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/onebusaway-sdk).
9+
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/open-transit).
1010

1111
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org).
1212

1313
## Installation
1414

1515
To use this gem, install via Bundler by adding the following to your application's `Gemfile`:
1616

17-
<!-- x-release-please-start-version -->
18-
1917
```ruby
20-
gem "onebusaway-sdk", "~> 0.1.0.pre.alpha.208"
18+
gem "open-transit", "~> 0.1.0.pre.alpha.208"
2119
```
2220

23-
<!-- x-release-please-end -->
24-
2521
## Usage
2622

2723
```ruby
2824
require "bundler/setup"
29-
require "onebusaway_sdk"
25+
require "open_transit"
3026

31-
onebusaway_sdk = OnebusawaySDK::Client.new(
27+
onebusaway_sdk = OpenTransit::Client.new(
3228
api_key: ENV["ONEBUSAWAY_API_KEY"] # This is the default and can be omitted
3329
)
3430

@@ -39,17 +35,17 @@ puts(current_time)
3935

4036
### Handling errors
4137

42-
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `OnebusawaySDK::Errors::APIError` will be thrown:
38+
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `OpenTransit::Errors::APIError` will be thrown:
4339

4440
```ruby
4541
begin
4642
current_time = onebusaway_sdk.current_time.retrieve
47-
rescue OnebusawaySDK::Errors::APIConnectionError => e
43+
rescue OpenTransit::Errors::APIConnectionError => e
4844
puts("The server could not be reached")
4945
puts(e.cause) # an underlying Exception, likely raised within `net/http`
50-
rescue OnebusawaySDK::Errors::RateLimitError => e
46+
rescue OpenTransit::Errors::RateLimitError => e
5147
puts("A 429 status code was received; we should back off a bit.")
52-
rescue OnebusawaySDK::Errors::APIStatusError => e
48+
rescue OpenTransit::Errors::APIStatusError => e
5349
puts("Another non-200-range status code was received")
5450
puts(e.status)
5551
end
@@ -81,7 +77,7 @@ You can use the `max_retries` option to configure or disable this:
8177

8278
```ruby
8379
# Configure the default for all requests:
84-
onebusaway_sdk = OnebusawaySDK::Client.new(
80+
onebusaway_sdk = OpenTransit::Client.new(
8581
max_retries: 0 # default is 2
8682
)
8783

@@ -95,23 +91,23 @@ By default, requests will time out after 60 seconds. You can use the timeout opt
9591

9692
```ruby
9793
# Configure the default for all requests:
98-
onebusaway_sdk = OnebusawaySDK::Client.new(
94+
onebusaway_sdk = OpenTransit::Client.new(
9995
timeout: nil # default is 60
10096
)
10197

10298
# Or, configure per-request:
10399
onebusaway_sdk.current_time.retrieve(request_options: {timeout: 5})
104100
```
105101

106-
On timeout, `OnebusawaySDK::Errors::APITimeoutError` is raised.
102+
On timeout, `OpenTransit::Errors::APITimeoutError` is raised.
107103

108104
Note that requests that time out are retried by default.
109105

110106
## Advanced concepts
111107

112108
### BaseModel
113109

114-
All parameter and response objects inherit from `OnebusawaySDK::Internal::Type::BaseModel`, which provides several conveniences, including:
110+
All parameter and response objects inherit from `OpenTransit::Internal::Type::BaseModel`, which provides several conveniences, including:
115111

116112
1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.
117113

@@ -162,9 +158,9 @@ response = client.request(
162158

163159
### Concurrency & connection pooling
164160

165-
The `OnebusawaySDK::Client` instances are threadsafe, but only are fork-safe when there are no in-flight HTTP requests.
161+
The `OpenTransit::Client` instances are threadsafe, but only are fork-safe when there are no in-flight HTTP requests.
166162

167-
Each instance of `OnebusawaySDK::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
163+
Each instance of `OpenTransit::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
168164

169165
When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.
170166

@@ -187,7 +183,7 @@ Or, equivalently:
187183
onebusaway_sdk.current_time.retrieve
188184

189185
# You can also splat a full Params class:
190-
params = OnebusawaySDK::CurrentTimeRetrieveParams.new
186+
params = OpenTransit::CurrentTimeRetrieveParams.new
191187
onebusaway_sdk.current_time.retrieve(**params)
192188
```
193189

@@ -197,18 +193,18 @@ Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::E
197193

198194
```ruby
199195
# :stop_name_wrong
200-
puts(OnebusawaySDK::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG)
196+
puts(OpenTransit::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG)
201197

202-
# Revealed type: `T.all(OnebusawaySDK::ReportProblemWithStopRetrieveParams::Code, Symbol)`
203-
T.reveal_type(OnebusawaySDK::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG)
198+
# Revealed type: `T.all(OpenTransit::ReportProblemWithStopRetrieveParams::Code, Symbol)`
199+
T.reveal_type(OpenTransit::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG)
204200
```
205201

206202
Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
207203

208204
```ruby
209205
# Using the enum constants preserves the tagged type information:
210206
onebusaway_sdk.report_problem_with_stop.retrieve(
211-
code: OnebusawaySDK::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG,
207+
code: OpenTransit::ReportProblemWithStopRetrieveParams::Code::STOP_NAME_WRONG,
212208
#
213209
)
214210

@@ -231,4 +227,4 @@ Ruby 3.2.0 or higher.
231227

232228
## Contributing
233229

234-
See [the contributing documentation](https://github.com/OneBusAway/ruby-sdk/tree/main/CONTRIBUTING.md).
230+
See [the contributing documentation](https://github.com/stainless-sdks/open-transit-ruby/tree/main/CONTRIBUTING.md).

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ multitask(:"build:gem") do
147147
sig/*
148148
GLOB
149149

150-
sh(*%w[gem build -- onebusaway_sdk.gemspec])
150+
sh(*%w[gem build -- open_transit.gemspec])
151151
rm_rf(ignore_file)
152152
end
153153

0 commit comments

Comments
 (0)