lita-locker 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/locker_misc.rb +2 -1
- data/lita-locker.gemspec +1 -1
- data/locales/en.yml +3 -1
- data/spec/lita/handlers/locker_misc_spec.rb +10 -1
- 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: 3eb9acdca54c6107ab5176d27da3a5b3175953c7
|
4
|
+
data.tar.gz: 4d2930c496c7a4edee32a9993d601f40a7546318
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e88fa9204ee2728b77bdb45dc8267c32cd7928069d5b978416d2cbde46552b68e6e3858e65deccc057ef44ae8705e872ee66697d8ec0f3906a095232db3fdb7
|
7
|
+
data.tar.gz: a53f48d546856dd8ae6289823f9e555246a95d24300a3756d190179616bb0db9b7a7969874a9a542b581b73c1ac2da78c1828f622f10097704164d503441ee30
|
@@ -52,11 +52,12 @@ module Lita
|
|
52
52
|
# Literal query
|
53
53
|
return response.reply(status_label(name)) if Label.exists?(name)
|
54
54
|
return response.reply(status_resource(name)) if Resource.exists?(name)
|
55
|
+
return response.reply(failed(t('status.does_not_exist', name: name)))
|
55
56
|
end
|
56
57
|
# Wildcard query
|
57
58
|
matcher = Regexp.new(name.gsub(/\*/, '.*'))
|
58
59
|
labels = Label.list.select { |label| label =~ matcher }
|
59
|
-
return response.reply(failed(t('
|
60
|
+
return response.reply(failed(t('status.does_not_exist', name: name))) if labels.empty?
|
60
61
|
labels.each do |n|
|
61
62
|
response.reply(status_label(n))
|
62
63
|
end
|
data/lita-locker.gemspec
CHANGED
data/locales/en.yml
CHANGED
@@ -42,7 +42,7 @@ en:
|
|
42
42
|
desc: "Transfer ownership of a lock to another user. Can have # comments afterwards."
|
43
43
|
status:
|
44
44
|
syntax: locker status <label or resource>
|
45
|
-
desc: Show the current state of <label or resource
|
45
|
+
desc: "Show the current state of <label or resource>. Supports wildcard search with *"
|
46
46
|
list:
|
47
47
|
syntax: locker list <username>
|
48
48
|
desc: Show what locks a user currently holds
|
@@ -90,6 +90,8 @@ en:
|
|
90
90
|
is_unlocked: "%{name} is unlocked"
|
91
91
|
owned: "%{name} is locked by %{owner_name}"
|
92
92
|
owned_mention: "%{name} is locked by %{owner_name} (@%{owner_mention})"
|
93
|
+
status:
|
94
|
+
does_not_exist: "Sorry, that does not exist. Use * for wildcard search"
|
93
95
|
subject:
|
94
96
|
does_not_exist: "Sorry, that does not exist"
|
95
97
|
label:
|
@@ -132,8 +132,17 @@ describe Lita::Handlers::LockerMisc, lita_handler: true do
|
|
132
132
|
end
|
133
133
|
|
134
134
|
it 'shows an error if nothing exists with that name' do
|
135
|
+
send_command('locker resource create foobarbaz')
|
136
|
+
send_command('locker label create foobar')
|
137
|
+
send_command('locker label add foobarbaz to foobar')
|
138
|
+
send_command('locker resource create foobazbar')
|
139
|
+
send_command('locker label create foobaz')
|
140
|
+
send_command('locker label add foobazbar to foobaz')
|
141
|
+
send_command('locker resource create bazbarluhrmann')
|
142
|
+
send_command('locker label create bazbar')
|
143
|
+
send_command('locker label add bazbarluhrmann to bazbar')
|
135
144
|
send_command('locker status foo')
|
136
|
-
expect(replies.last).to eq('Sorry, that does not exist')
|
145
|
+
expect(replies.last).to eq('Sorry, that does not exist. Use * for wildcard search')
|
137
146
|
end
|
138
147
|
end
|
139
148
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-locker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Sigler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|