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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebd69051f02f3a9b071894c529a1f8368b279810
4
- data.tar.gz: e514daea0faffad2604c124e52fa7bbac9c9871c
3
+ metadata.gz: 7563312feb0cf2b62113e5b00fc961003df49a44
4
+ data.tar.gz: 85f81eda81053e75e6ee5c046a91b69386005743
5
5
  SHA512:
6
- metadata.gz: 7f44239929f965ce57d97839366b7b200b1173bb88597aaa52ee5f65e0de44aa157a98745ec64bb53c163e6cdc5a1ed64c4aac6afa15627963e61d1f8bea7eb9
7
- data.tar.gz: 5d5b54431727d312c634801198ea19709901bc596c237e86753b4327249cf06dd883c07a462d0ae6887171cfb576982ad1dfc977a3d3a8b3e14d6d23c0647683
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
- advance_to = start_time + mins_to_seconds(duration_minutes)
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 last_time
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.0
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-08 00:00:00.000000000 Z
11
+ date: 2016-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake