From dc73659dd130af0481e8e0cea216f5676ea2b765 Mon Sep 17 00:00:00 2001 From: Thibault Couraud Date: Tue, 16 Nov 2021 13:32:05 -0500 Subject: [PATCH 1/7] Setter returns passed value --- lib/potlock/client.rb | 1 + spec/client_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/potlock/client.rb b/lib/potlock/client.rb index a506e96..1bc65f0 100644 --- a/lib/potlock/client.rb +++ b/lib/potlock/client.rb @@ -30,6 +30,7 @@ def get def set(&block) value = lock!(&block) redis.set(key, value) + value rescue Redlock::LockError => _e raise Potlock::LockError end diff --git a/spec/client_spec.rb b/spec/client_spec.rb index 28e0b36..a67aa93 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -65,6 +65,10 @@ end describe "#set" do + it "returns the passed value" do + expect(subject.set { "RESPONSE" }).to eq("RESPONSE") + end + context "given a free lock" do it "stores value in Redis" do expect(redis.get(key)).to be_nil From c69f21676e66b968449e75f62a011913fb35ce20 Mon Sep 17 00:00:00 2001 From: Thibault Couraud Date: Tue, 16 Nov 2021 13:33:22 -0500 Subject: [PATCH 2/7] Update CHANGELOG.md --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a6d1e..884eb13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## [0.1.0] - 2021-09-29 +## [0.1.2] - 2021-11-16 + +- dc73659 Setter returns passed value + +## [0.1.1] - 2021-09-29 - ebbcda8 Update Gemfile.lock - d07268d Bump version From f3fe2579e7a3339964bcf375e031cfa64d206c73 Mon Sep 17 00:00:00 2001 From: Thibault Couraud Date: Tue, 16 Nov 2021 13:34:58 -0500 Subject: [PATCH 3/7] Bump version to 0.1.2 --- lib/potlock/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/potlock/version.rb b/lib/potlock/version.rb index 11054dc..5f9f4e0 100644 --- a/lib/potlock/version.rb +++ b/lib/potlock/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Potlock - VERSION = "0.1.1" + VERSION = "0.1.2" end From 91f92c333fdd70e024742d6e31eaa9454c1f06bf Mon Sep 17 00:00:00 2001 From: Thibault Couraud Date: Tue, 16 Nov 2021 13:35:58 -0500 Subject: [PATCH 4/7] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 884eb13..6d72298 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [0.1.2] - 2021-11-16 +- f3fe257 Bump version to 0.1.2 - dc73659 Setter returns passed value ## [0.1.1] - 2021-09-29 From 336f4729b8cb6f44470c716545867c3b1aa6c638 Mon Sep 17 00:00:00 2001 From: Thibault Couraud Date: Tue, 16 Nov 2021 13:38:52 -0500 Subject: [PATCH 5/7] Update Gemfile.lock --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e657e65..5ff64cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - potlock (0.1.1) + potlock (0.1.2) redlock (~> 1.2) GEM @@ -16,8 +16,8 @@ GEM ast (~> 2.4.1) rainbow (3.0.0) rake (13.0.6) - redis (4.4.0) - redlock (1.2.1) + redis (4.5.1) + redlock (1.2.2) redis (>= 3.0.0, < 5.0) regexp_parser (2.1.1) rexml (3.2.5) From 1faf6da914e9bf2972cf2a43b14a4118151dc3f9 Mon Sep 17 00:00:00 2001 From: Thibault Couraud Date: Tue, 16 Nov 2021 15:45:35 -0500 Subject: [PATCH 6/7] Bump version to 0.2.0 --- Gemfile.lock | 6 +++--- lib/potlock/version.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5ff64cd..78631a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - potlock (0.1.2) + potlock (0.2.0) redlock (~> 1.2) GEM @@ -16,8 +16,8 @@ GEM ast (~> 2.4.1) rainbow (3.0.0) rake (13.0.6) - redis (4.5.1) - redlock (1.2.2) + redis (4.4.0) + redlock (1.2.1) redis (>= 3.0.0, < 5.0) regexp_parser (2.1.1) rexml (3.2.5) diff --git a/lib/potlock/version.rb b/lib/potlock/version.rb index 5f9f4e0..d4b6db5 100644 --- a/lib/potlock/version.rb +++ b/lib/potlock/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Potlock - VERSION = "0.1.2" + VERSION = "0.2.0" end From 45e2bf1c6eb230d9b3295f82ac26cce092d44798 Mon Sep 17 00:00:00 2001 From: Thibault Couraud Date: Tue, 16 Nov 2021 15:46:38 -0500 Subject: [PATCH 7/7] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d72298..f5c6e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -## [0.1.2] - 2021-11-16 +## [0.2.0] - 2021-11-16 +- 1faf6da Bump version to 0.2.0 - f3fe257 Bump version to 0.1.2 - dc73659 Setter returns passed value