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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2815409ac4a6c9435d8bab8f79c9b5ac777c510c
|
4
|
+
data.tar.gz: 9bd9b6aabf276f58148e05da2b4b82451ba0769c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
55
|
+
after 0 do
|
56
|
+
should_rate_limit = false
|
56
57
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
-
|
65
|
-
|
66
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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
@@ -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
|