diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a24f4d52..ffb31d80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,8 @@ jobs: - rails_7_2 - rails_7_1 - rails_7_0 + - dalli5 + - dalli4 - dalli3 - redis_5 - redis_4 @@ -67,6 +69,18 @@ jobs: ruby: '3.0' - gemfile: active_support_8_0_redis_cache_store ruby: '2.7' + - gemfile: dalli5 + ruby: '3.2' + - gemfile: dalli5 + ruby: '3.1' + - gemfile: dalli5 + ruby: '3.0' + - gemfile: dalli5 + ruby: '2.7' + - gemfile: dalli4 + ruby: '3.0' + - gemfile: dalli4 + ruby: '2.7' - gemfile: rails_8_1 ruby: '3.1' - gemfile: rails_8_1 diff --git a/Appraisals b/Appraisals index 9ca0281a..e5fbcf26 100644 --- a/Appraisals +++ b/Appraisals @@ -28,6 +28,14 @@ appraise "rails_7-0" do gem "railties", "~> 7.0.0" end +appraise "dalli5" do + gem "dalli", "~> 5.0" +end + +appraise "dalli4" do + gem "dalli", "~> 4.0" +end + appraise "dalli3" do gem "dalli", "~> 3.0" end diff --git a/gemfiles/dalli4.gemfile b/gemfiles/dalli4.gemfile new file mode 100644 index 00000000..ab4d6d2d --- /dev/null +++ b/gemfiles/dalli4.gemfile @@ -0,0 +1,12 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "dalli", "~> 4.0" + +group :maintenance, optional: true do + gem "bake" + gem "bake-gem" +end + +gemspec path: "../" diff --git a/gemfiles/dalli5.gemfile b/gemfiles/dalli5.gemfile new file mode 100644 index 00000000..03d77b99 --- /dev/null +++ b/gemfiles/dalli5.gemfile @@ -0,0 +1,12 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "dalli", "~> 5.0" + +group :maintenance, optional: true do + gem "bake" + gem "bake-gem" +end + +gemspec path: "../" diff --git a/lib/rack/attack/store_proxy/dalli_proxy.rb b/lib/rack/attack/store_proxy/dalli_proxy.rb index 48198bb2..fa1c59c6 100644 --- a/lib/rack/attack/store_proxy/dalli_proxy.rb +++ b/lib/rack/attack/store_proxy/dalli_proxy.rb @@ -34,7 +34,7 @@ def read(key) def write(key, value, options = {}) rescuing do with do |client| - client.set(key, value, options.fetch(:expires_in, 0), raw: true) + client.set(key, value.to_s, options.fetch(:expires_in, 0), raw: true) end end end