Skip to content

Bump minimum supported Ruby version to 3.2 #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
ruby-version: '3.2'
- run: |-
bundle install

Expand All @@ -36,7 +36,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
ruby-version: '3.2'
- run: |-
bundle install

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
ruby-version: '3.2'

- run: |
bundle install

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
ruby-version: '3.2'
- run: |-
bundle install

Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AllCops:
- "bin/*"
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.1.0
TargetRubyVersion: 3.2

# Whether MFA is required or not should be left to the token configuration.
Gemspec/RequireMFA:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0
3.2
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenAI Ruby API library

The OpenAI Ruby library provides convenient access to the OpenAI REST API from any Ruby 3.1.0+ application.
The OpenAI Ruby library provides convenient access to the OpenAI REST API from any Ruby 3.2+ application.

## Documentation

Expand Down Expand Up @@ -91,7 +91,7 @@ end

### File uploads

Request parameters that correspond to file uploads can be passed as `StringIO`, or a [`Pathname`](https://rubyapi.org/3.1/o/pathname) instance.
Request parameters that correspond to file uploads can be passed as `StringIO`, or a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance.

```ruby
require "pathname"
Expand Down Expand Up @@ -271,7 +271,7 @@ This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` typ

## Requirements

Ruby 3.1.0 or higher.
Ruby 3.2 or higher.

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions examples/advanced_streaming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
temperature: 0.0
)

# the `stream` itself is an `https://rubyapi.org/3.1/o/enumerable`
# the `stream` itself is an `https://rubyapi.org/3.2/o/enumerable`
# which means that you can work with the stream almost as if it is an array
all_choices =
stream
Expand Down Expand Up @@ -49,7 +49,7 @@

stream_of_choices =
stream
# calling `#lazy` will return a deferred `https://rubyapi.org/3.1/o/enumerator/lazy`
# calling `#lazy` will return a deferred `https://rubyapi.org/3.2/o/enumerator/lazy`
.lazy
# each successive calls to methods that return another `enumerable` will not consume the stream
# but rather, return a transformed stream. (see link above)
Expand Down
4 changes: 2 additions & 2 deletions lib/openai/internal/type/base_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Type
#
# This module provides a base implementation for streaming responses in the SDK.
#
# @see https://rubyapi.org/3.1/o/enumerable
# @see https://rubyapi.org/3.2/o/enumerable
module BaseStream
include Enumerable

Expand All @@ -24,7 +24,7 @@ class << self
#
# @return [Proc]
#
# @see https://rubyapi.org/3.1/o/objectspace#method-c-define_finalizer
# @see https://rubyapi.org/3.2/o/objectspace#method-c-define_finalizer
def defer_closing(stream) = ->(_id) { OpenAI::Internal::Util.close_fused!(stream) }
end

Expand Down
2 changes: 1 addition & 1 deletion openai.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.metadata["homepage_uri"] = s.homepage
s.metadata["source_code_uri"] = "https://github.com/openai/openai-ruby"
s.metadata["rubygems_mfa_required"] = false.to_s
s.required_ruby_version = ">= 3.0.0"
s.required_ruby_version = ">= 3.2"

s.files = Dir[
"lib/**/*.rb",
Expand Down