Skip to content

Commit 904b5ab

Browse files
authored
Merge pull request alexrudall#190 from alexrudall/3.3.0
3.3.0
2 parents 16c74e2 + 70851da commit 904b5ab

File tree

7 files changed

+24
-16
lines changed

7 files changed

+24
-16
lines changed

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Style/Documentation:
99

1010
Layout/LineLength:
1111
Max: 100
12+
Exclude:
13+
- "**/*.gemspec"
1214

1315
Metrics/BlockLength:
1416
Exclude:

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.3.0] - 2023-02-15
9+
10+
### Changed
11+
12+
- Replace ::Ruby::OpenAI namespace with ::OpenAI - thanks [@kmcphillips](https://github.com/kmcphillips) for this work!
13+
- To upgrade, change `require 'ruby/openai'` to `require 'openai'` and change all references to `Ruby::OpenAI` to `OpenAI`.
14+
815
## [3.2.0] - 2023-02-13
916

1017
### Added

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
ruby-openai (3.2.0)
4+
ruby-openai (3.3.0)
55
httparty (>= 0.18.1)
66

77
GEM

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ and require with:
3737

3838
## Upgrading
3939

40-
The `::Ruby::OpenAI` module has been removed and all classes have been moved under the top level `::OpenAI` module.
41-
42-
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.
43-
40+
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`.
4441

4542
## Usage
4643

lib/openai/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module OpenAI
2-
VERSION = "3.2.0".freeze
2+
VERSION = "3.3.0".freeze
33
end

ruby-openai.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ Gem::Specification.new do |spec|
2626
spec.require_paths = ["lib"]
2727

2828
spec.add_dependency "httparty", ">= 0.18.1"
29+
30+
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`."
2931
end

spec/compatibility_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
context "for moved constants" do
33
describe "::Ruby::OpenAI::VERSION" do
44
it "is mapped to ::OpenAI::VERSION" do
5-
expect(::Ruby::OpenAI::VERSION).to eq(::OpenAI::VERSION)
5+
expect(Ruby::OpenAI::VERSION).to eq(OpenAI::VERSION)
66
end
77
end
88

99
describe "::Ruby::OpenAI::Error" do
1010
it "is mapped to ::OpenAI::Error" do
11-
expect(::Ruby::OpenAI::Error).to eq(::OpenAI::Error)
12-
expect(::Ruby::OpenAI::Error.new).to be_a(::OpenAI::Error)
13-
expect(::OpenAI::Error.new).to be_a(::Ruby::OpenAI::Error)
11+
expect(Ruby::OpenAI::Error).to eq(OpenAI::Error)
12+
expect(Ruby::OpenAI::Error.new).to be_a(OpenAI::Error)
13+
expect(OpenAI::Error.new).to be_a(Ruby::OpenAI::Error)
1414
end
1515
end
1616

1717
describe "::Ruby::OpenAI::ConfigurationError" do
1818
it "is mapped to ::OpenAI::ConfigurationError" do
19-
expect(::Ruby::OpenAI::ConfigurationError).to eq(::OpenAI::ConfigurationError)
20-
expect(::Ruby::OpenAI::ConfigurationError.new).to be_a(::OpenAI::ConfigurationError)
21-
expect(::OpenAI::ConfigurationError.new).to be_a(::Ruby::OpenAI::ConfigurationError)
19+
expect(Ruby::OpenAI::ConfigurationError).to eq(OpenAI::ConfigurationError)
20+
expect(Ruby::OpenAI::ConfigurationError.new).to be_a(OpenAI::ConfigurationError)
21+
expect(OpenAI::ConfigurationError.new).to be_a(Ruby::OpenAI::ConfigurationError)
2222
end
2323
end
2424

2525
describe "::Ruby::OpenAI::Configuration" do
2626
it "is mapped to ::OpenAI::Configuration" do
27-
expect(::Ruby::OpenAI::Configuration).to eq(::OpenAI::Configuration)
28-
expect(::Ruby::OpenAI::Configuration.new).to be_a(::OpenAI::Configuration)
29-
expect(::OpenAI::Configuration.new).to be_a(::Ruby::OpenAI::Configuration)
27+
expect(Ruby::OpenAI::Configuration).to eq(OpenAI::Configuration)
28+
expect(Ruby::OpenAI::Configuration.new).to be_a(OpenAI::Configuration)
29+
expect(OpenAI::Configuration.new).to be_a(Ruby::OpenAI::Configuration)
3030
end
3131
end
3232
end

0 commit comments

Comments
 (0)