diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a6d1e..f5c6e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -## [0.1.0] - 2021-09-29 +## [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 + +## [0.1.1] - 2021-09-29 - ebbcda8 Update Gemfile.lock - d07268d Bump version diff --git a/Gemfile.lock b/Gemfile.lock index e657e65..78631a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - potlock (0.1.1) + potlock (0.2.0) redlock (~> 1.2) GEM 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/lib/potlock/version.rb b/lib/potlock/version.rb index 11054dc..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.1" + VERSION = "0.2.0" 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