lita-locker 1.0.0 → 1.0.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: 932d1d2d4b5f788199bd0b8d3ea0884987fd8dec
4
- data.tar.gz: f677dbe6a38e68ed8fa1485445bd89e037ea61c5
3
+ metadata.gz: 2815409ac4a6c9435d8bab8f79c9b5ac777c510c
4
+ data.tar.gz: 9bd9b6aabf276f58148e05da2b4b82451ba0769c
5
5
  SHA512:
6
- metadata.gz: cd4694f2fe5c4247b918c1e59afda10d6ab1417c7938eb057d33560eb7d6fff3dc58f4fb63025cf2435c006e7b308c10ce37a342187c4d2d244972551273fe23
7
- data.tar.gz: c0aa1d169d48406afb06f513efcb244b5df5f6b9dd05c22e0215c9efe9505deff2976efcf8fa0dc487d553a87467d7b8937b732f75941daa0fd51c2656c8aac7
6
+ metadata.gz: ba2eb359c367608c8255e387c7393781f60d8872fbb8347d376fd8b6477db9bcc20546befc2ccf90d6a2bf8d4a1ab7effae3883b775313e8e57e3112e2e264e0
7
+ data.tar.gz: bd74d58ac7ead4d092d194ff2e663fa645a2443019addd9283323a1de16fccdb4acd431ee1106ff40449c5f8588e41c239a89cceadb1a93553d00ef3136d85e4
@@ -52,18 +52,20 @@ module Lita
52
52
  )
53
53
 
54
54
  def list(response)
55
- should_rate_limit = false
55
+ after 0 do
56
+ should_rate_limit = false
56
57
 
57
- Label.list.each_slice(10) do |slice|
58
- if should_rate_limit
59
- sleep 1
60
- else
61
- should_rate_limit = true
62
- end
58
+ Label.list.each_slice(5) do |slice|
59
+ if should_rate_limit
60
+ sleep 3
61
+ else
62
+ should_rate_limit = true
63
+ end
63
64
 
64
- slice.each do |n|
65
- l = Label.new(n)
66
- response.reply(unlocked(t('label.desc', name: n, state: l.state.value)))
65
+ slice.each do |n|
66
+ l = Label.new(n)
67
+ response.reply(unlocked(t('label.desc', name: n, state: l.state.value)))
68
+ end
67
69
  end
68
70
  end
69
71
  end
@@ -44,18 +44,20 @@ module Lita
44
44
  )
45
45
 
46
46
  def list(response)
47
- should_rate_limit = false
48
-
49
- Resource.list.each_slice(10) do |slice|
50
- if should_rate_limit
51
- sleep 1
52
- else
53
- should_rate_limit = true
54
- end
55
-
56
- slice.each do |r|
57
- res = Resource.new(r)
58
- response.reply(t('resource.desc', name: r, state: res.state.value))
47
+ after 0 do
48
+ should_rate_limit = false
49
+
50
+ Resource.list.each_slice(5) do |slice|
51
+ if should_rate_limit
52
+ sleep 3
53
+ else
54
+ should_rate_limit = true
55
+ end
56
+
57
+ slice.each do |r|
58
+ res = Resource.new(r)
59
+ response.reply(t('resource.desc', name: r, state: res.state.value))
60
+ end
59
61
  end
60
62
  end
61
63
  end
data/lita-locker.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-locker'
3
- spec.version = '1.0.0'
3
+ spec.version = '1.0.1'
4
4
  spec.authors = ['Eric Sigler']
5
5
  spec.email = ['me@esigler.com']
6
6
  spec.description = '"lock" and "unlock" arbitrary subjects'
@@ -36,6 +36,7 @@ describe Lita::Handlers::LockerLabels, lita_handler: true do
36
36
  send_command('locker label create foobar')
37
37
  send_command('locker label create bazbat')
38
38
  send_command('locker label list')
39
+ sleep 1 # TODO: HAAAACK. Need after to have a more testable behavior.
39
40
  expect(replies.include?('foobar is unlocked')).to eq(true)
40
41
  expect(replies.include?('bazbat is unlocked')).to eq(true)
41
42
  end
@@ -31,6 +31,7 @@ describe Lita::Handlers::LockerResources, lita_handler: true do
31
31
  send_command('locker resource create foobar')
32
32
  send_command('locker resource create bazbat')
33
33
  send_command('locker resource list')
34
+ sleep 1 # TODO: HAAAAACK. Need after to have a more testable behavior.
34
35
  expect(replies).to include('Resource: foobar, state: unlocked')
35
36
  expect(replies).to include('Resource: bazbat, state: unlocked')
36
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-locker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Sigler