From 85e979631b691e5e8e278482b0fc98f7ddbbcafa Mon Sep 17 00:00:00 2001 From: Erik Berlin Date: Tue, 29 Apr 2025 16:08:57 -0700 Subject: [PATCH] Bump minimum supported Ruby version to 3.2 Ruby 3.1 is no longer supported as of March 31, 2025. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-releases.yml | 2 +- .github/workflows/publish-gem.yml | 2 +- .rubocop.yml | 2 +- .ruby-version | 2 +- README.md | 6 +++--- examples/advanced_streaming.rb | 4 ++-- lib/openai/internal/type/base_stream.rb | 4 ++-- openai.gemspec | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2c0c8f7..5923e599 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.1' + ruby-version: '3.2' - run: |- bundle install @@ -33,7 +33,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.1' + ruby-version: '3.2' - run: |- bundle install diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index c1ea30fa..b9e97dc6 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -29,7 +29,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.1' + ruby-version: '3.2' - run: |- bundle install diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 7502f1c2..0e942b1c 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml index c88b94f1..bb81142c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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: diff --git a/.ruby-version b/.ruby-version index fd2a0186..a3ec5a4b 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.0 +3.2 diff --git a/README.md b/README.md index 33a1ebe9..f1a0a15a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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" @@ -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 diff --git a/examples/advanced_streaming.rb b/examples/advanced_streaming.rb index 1d3cf073..75a656d7 100755 --- a/examples/advanced_streaming.rb +++ b/examples/advanced_streaming.rb @@ -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 @@ -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) diff --git a/lib/openai/internal/type/base_stream.rb b/lib/openai/internal/type/base_stream.rb index ebcb564c..58f90fc6 100644 --- a/lib/openai/internal/type/base_stream.rb +++ b/lib/openai/internal/type/base_stream.rb @@ -7,7 +7,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 @@ -22,7 +22,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 diff --git a/openai.gemspec b/openai.gemspec index 64c1b6d9..a26c3c68 100644 --- a/openai.gemspec +++ b/openai.gemspec @@ -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",