Skip to content

Commit

Permalink
Merge pull request #190 from alexrudall/3.3.0
Browse files Browse the repository at this point in the history
3.3.0
  • Loading branch information
alexrudall authored Feb 15, 2023
2 parents 16c74e2 + 70851da commit 904b5ab
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Style/Documentation:

Layout/LineLength:
Max: 100
Exclude:
- "**/*.gemspec"

Metrics/BlockLength:
Exclude:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.0] - 2023-02-15

### Changed

- Replace ::Ruby::OpenAI namespace with ::OpenAI - thanks [@kmcphillips](https://github.com/kmcphillips) for this work!
- To upgrade, change `require 'ruby/openai'` to `require 'openai'` and change all references to `Ruby::OpenAI` to `OpenAI`.

## [3.2.0] - 2023-02-13

### Added
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ruby-openai (3.2.0)
ruby-openai (3.3.0)
httparty (>= 0.18.1)

GEM
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ and require with:

## Upgrading

The `::Ruby::OpenAI` module has been removed and all classes have been moved under the top level `::OpenAI` module.

However, a transitional `::Ruby::OpenAI` module has been added with aliases to the new location of the classes and constants. For now this compatibility layer is available when the gem is loaded with `require 'ruby/openai'` or by default with bundler, but are _not_ available when the gem is loaded with `require 'openai'` or `gem 'ruby-openai', require: 'openai'`. This will be removed in future versions.

The `::Ruby::OpenAI` module has been removed and all classes have been moved under the top level `::OpenAI` module. To upgrade, change `require 'ruby/openai'` to `require 'openai'` and change all references to `Ruby::OpenAI` to `OpenAI`.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion lib/openai/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module OpenAI
VERSION = "3.2.0".freeze
VERSION = "3.3.0".freeze
end
2 changes: 2 additions & 0 deletions ruby-openai.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "httparty", ">= 0.18.1"

spec.post_install_message = "Note if upgrading: The `::Ruby::OpenAI` module has been removed and all classes have been moved under the top level `::OpenAI` module. To upgrade, change `require 'ruby/openai'` to `require 'openai'` and change all references to `Ruby::OpenAI` to `OpenAI`."
end
20 changes: 10 additions & 10 deletions spec/compatibility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
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)
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)
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)
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)
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
Expand Down

0 comments on commit 904b5ab

Please sign in to comment.