lita-timing 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/timing/sliding_window.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7563312feb0cf2b62113e5b00fc961003df49a44
|
4
|
+
data.tar.gz: 85f81eda81053e75e6ee5c046a91b69386005743
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d25d45d905f4644867fb5cf9cba13fc0b71091d4ed4be279a4e53f20e3181c53340e8b04144680380dc1b169adcf6de3fcaed897ead1730ad69a75edee9ada96
|
7
|
+
data.tar.gz: 885654b5eccf38ff096511072fdf3fa446a8044f4cf0a977d4c68aea935db100361bba431d2bc63c015f483db61d0fb206338da3d602146f44d93a6c7765cb45
|
@@ -11,10 +11,12 @@ module Lita
|
|
11
11
|
def advance(duration_minutes: 30, buffer_minutes: 0, &block)
|
12
12
|
@mutex.syncronise do
|
13
13
|
start_time = Time.now - mins_to_seconds(duration_minutes) - mins_to_seconds(buffer_minutes)
|
14
|
-
|
14
|
+
last_time = get_last_time
|
15
15
|
|
16
16
|
return unless start_time > last_time
|
17
17
|
|
18
|
+
advance_to = last_time + mins_to_seconds(duration_minutes)
|
19
|
+
|
18
20
|
yield last_time + 1, advance_to
|
19
21
|
|
20
22
|
@redis.set(@name, advance_to.to_i)
|
@@ -27,7 +29,7 @@ module Lita
|
|
27
29
|
mins * 60
|
28
30
|
end
|
29
31
|
|
30
|
-
def
|
32
|
+
def get_last_time
|
31
33
|
Time.at(@redis.get(@name).to_i)
|
32
34
|
end
|
33
35
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-timing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Healy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|