From a92d23b80a940fb5625837d2a94dddb86f040887 Mon Sep 17 00:00:00 2001 From: Sergii Demianchuk Date: Fri, 14 Feb 2025 02:08:46 -0500 Subject: [PATCH] [Fix] Deprecation warning on Ruby 3.4 --- .circleci/config.yml | 1 + lib/openai/compatibility.rb | 11 ----------- lib/ruby/openai.rb | 1 - spec/compatibility_spec.rb | 33 --------------------------------- spec/spec_helper.rb | 1 - 5 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 lib/openai/compatibility.rb delete mode 100644 spec/compatibility_spec.rb diff --git a/.circleci/config.yml b/.circleci/config.yml index ca10a419..ae170e4a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,3 +44,4 @@ workflows: - cimg/ruby:3.1-node - cimg/ruby:3.2-node - cimg/ruby:3.3-node + - cimg/ruby:3.4-node diff --git a/lib/openai/compatibility.rb b/lib/openai/compatibility.rb deleted file mode 100644 index 471a6e00..00000000 --- a/lib/openai/compatibility.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Ruby - module OpenAI - VERSION = ::OpenAI::VERSION - - Error = ::OpenAI::Error - AuthenticationError = ::OpenAI::AuthenticationError - ConfigurationError = ::OpenAI::ConfigurationError - Configuration = ::OpenAI::Configuration - MiddlewareErrors = ::OpenAI::MiddlewareErrors - end -end diff --git a/lib/ruby/openai.rb b/lib/ruby/openai.rb index ef94a50c..1f6860a8 100644 --- a/lib/ruby/openai.rb +++ b/lib/ruby/openai.rb @@ -1,2 +1 @@ require_relative "../openai" -require_relative "../openai/compatibility" diff --git a/spec/compatibility_spec.rb b/spec/compatibility_spec.rb deleted file mode 100644 index 04191368..00000000 --- a/spec/compatibility_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -RSpec.describe "compatibility" do - context "for moved constants" do - describe "::Ruby::OpenAI::VERSION" do - it "is mapped to ::OpenAI::VERSION" do - expect(Ruby::OpenAI::VERSION).to eq(OpenAI::VERSION) - end - end - - describe "::Ruby::OpenAI::Error" do - it "is mapped to ::OpenAI::Error" do - expect(Ruby::OpenAI::Error).to eq(OpenAI::Error) - expect(Ruby::OpenAI::Error.new).to be_a(OpenAI::Error) - expect(OpenAI::Error.new).to be_a(Ruby::OpenAI::Error) - end - end - - describe "::Ruby::OpenAI::ConfigurationError" do - it "is mapped to ::OpenAI::ConfigurationError" do - expect(Ruby::OpenAI::ConfigurationError).to eq(OpenAI::ConfigurationError) - expect(Ruby::OpenAI::ConfigurationError.new).to be_a(OpenAI::ConfigurationError) - expect(OpenAI::ConfigurationError.new).to be_a(Ruby::OpenAI::ConfigurationError) - end - end - - describe "::Ruby::OpenAI::Configuration" do - it "is mapped to ::OpenAI::Configuration" do - expect(Ruby::OpenAI::Configuration).to eq(OpenAI::Configuration) - expect(Ruby::OpenAI::Configuration.new).to be_a(OpenAI::Configuration) - expect(OpenAI::Configuration.new).to be_a(Ruby::OpenAI::Configuration) - end - end - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9519aade..deea1f03 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ require "bundler/setup" require "dotenv/load" require "openai" -require "openai/compatibility" require "vcr" require "byebug"