You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This will install all the required dependencies.
14
14
15
15
## Modifying/Adding code
16
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 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.
18
18
19
19
## Adding and running examples
20
20
@@ -24,7 +24,7 @@ All files in the `examples/` directory are not modified by the generator and can
24
24
#!/usr/bin/env ruby
25
25
# frozen_string_literal: true
26
26
27
-
require_relative"../lib/onebusaway_sdk"
27
+
require_relative"../lib/open_transit"
28
28
29
29
# ...
30
30
```
@@ -43,17 +43,17 @@ If you’d like to use the repository from source, you can either install from g
Copy file name to clipboardExpand all lines: README.md
+21-25Lines changed: 21 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,30 @@
1
1
# Onebusaway SDK Ruby API library
2
2
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.
4
4
5
5
It is generated with [Stainless](https://www.stainless.com/).
6
6
7
7
## Documentation
8
8
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).
10
10
11
11
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org).
12
12
13
13
## Installation
14
14
15
15
To use this gem, install via Bundler by adding the following to your application's `Gemfile`:
16
16
17
-
<!-- x-release-please-start-version -->
18
-
19
17
```ruby
20
-
gem "onebusaway-sdk", "~> 0.1.0.pre.alpha.208"
18
+
gem "open-transit", "~> 0.1.0.pre.alpha.208"
21
19
```
22
20
23
-
<!-- x-release-please-end -->
24
-
25
21
## Usage
26
22
27
23
```ruby
28
24
require"bundler/setup"
29
-
require"onebusaway_sdk"
25
+
require"open_transit"
30
26
31
-
onebusaway_sdk =OnebusawaySDK::Client.new(
27
+
onebusaway_sdk =OpenTransit::Client.new(
32
28
api_key:ENV["ONEBUSAWAY_API_KEY"] # This is the default and can be omitted
33
29
)
34
30
@@ -39,17 +35,17 @@ puts(current_time)
39
35
40
36
### Handling errors
41
37
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:
On timeout, `OnebusawaySDK::Errors::APITimeoutError` is raised.
102
+
On timeout, `OpenTransit::Errors::APITimeoutError` is raised.
107
103
108
104
Note that requests that time out are retried by default.
109
105
110
106
## Advanced concepts
111
107
112
108
### BaseModel
113
109
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:
115
111
116
112
1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.
117
113
@@ -162,9 +158,9 @@ response = client.request(
162
158
163
159
### Concurrency & connection pooling
164
160
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.
166
162
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.
168
164
169
165
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.
0 commit comments