diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 64f9ff4..108509e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.8.0" + ".": "2.8.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 17aa7dd..4b79ff0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.8.1 (2026-02-27) + +Full Changelog: [v2.8.0...v2.8.1](https://github.com/moderation-api/sdk-ruby/compare/v2.8.0...v2.8.1) + +### Bug Fixes + +* properly mock time in ruby ci tests ([9ca660b](https://github.com/moderation-api/sdk-ruby/commit/9ca660b7a3fece7435218a33d2ede5bdc7eeb865)) + ## 2.8.0 (2026-02-23) Full Changelog: [v2.7.1...v2.8.0](https://github.com/moderation-api/sdk-ruby/compare/v2.7.1...v2.8.0) diff --git a/Gemfile.lock b/Gemfile.lock index a141186..711d22d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - moderation_api (2.8.0) + moderation_api (2.8.1) cgi connection_pool diff --git a/README.md b/README.md index 571259d..a624b5b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "moderation_api", "~> 2.8.0" +gem "moderation_api", "~> 2.8.1" ``` diff --git a/lib/moderation_api/version.rb b/lib/moderation_api/version.rb index e7bf221..7e26d10 100644 --- a/lib/moderation_api/version.rb +++ b/lib/moderation_api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ModerationAPI - VERSION = "2.8.0" + VERSION = "2.8.1" end diff --git a/test/moderation_api/client_test.rb b/test/moderation_api/client_test.rb index 3649d67..04e2568 100644 --- a/test/moderation_api/client_test.rb +++ b/test/moderation_api/client_test.rb @@ -103,20 +103,22 @@ def test_client_retry_after_seconds end def test_client_retry_after_date + time_now = Time.now + stub_request(:post, "http://localhost/moderate").to_return_json( status: 500, - headers: {"retry-after" => (Time.now + 10).httpdate}, + headers: {"retry-after" => (time_now + 10).httpdate}, body: {} ) moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key", max_retries: 1) + Thread.current.thread_variable_set(:time_now, time_now) assert_raises(ModerationAPI::Errors::InternalServerError) do - Thread.current.thread_variable_set(:time_now, Time.now) moderation_api.content.submit(content: {text: "x", type: :text}) - Thread.current.thread_variable_set(:time_now, nil) end + Thread.current.thread_variable_set(:time_now, nil) assert_requested(:any, /./, times: 2) assert_in_delta(10, Thread.current.thread_variable_get(:mock_sleep).last, 1.0)