once 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/once.rb +6 -1
- data/lib/once/version.rb +1 -1
- data/spec/once_spec.rb +14 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe6ea9a8339f436782e75748211b744c3c046fb8
|
4
|
+
data.tar.gz: 36774c058a79d7af701bdf7bfe9a154618c264f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8403391dc262b6bcc752783d78d8e8497169bb374fd64d058883df165d27e1c9c8eed3a7031d4e83a3ffb912d3bb0dac415d8589de5cfccc77b50ce5874ad95a
|
7
|
+
data.tar.gz: 6c371fec3539393c4844eb2db382fa6ef7012e40c07ff47d3a34660b0494f1d69918d8bd82acf878bd040d1ddf7cec09b4fbb3398b17f5b2543137cc51c12862
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.2
|
1
|
+
ruby-2.2.2
|
data/lib/once.rb
CHANGED
data/lib/once/version.rb
CHANGED
data/spec/once_spec.rb
CHANGED
@@ -90,4 +90,18 @@ describe Once do
|
|
90
90
|
|
91
91
|
thing_to_execute.should have_received(:execute).twice
|
92
92
|
end
|
93
|
+
|
94
|
+
it "expires the key immediately if an exception is raised" do
|
95
|
+
2.times do
|
96
|
+
begin
|
97
|
+
described_class.do(name: "mycheck", params: {foo: "bar"}) do
|
98
|
+
thing_to_execute.execute
|
99
|
+
raise "BOOM"
|
100
|
+
end
|
101
|
+
rescue
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
thing_to_execute.should have_received(:execute).twice
|
106
|
+
end
|
93
107
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: once
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yan Pritzker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.4.
|
123
|
+
rubygems_version: 2.4.5
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Execute commands only once within a specified period of time
|