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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 838b81165b9ea6dc31218d5e149bb9728718dec0
4
- data.tar.gz: fbbb65767d43508fe8ad15e20d786a07132ed3c3
3
+ metadata.gz: 3eb9acdca54c6107ab5176d27da3a5b3175953c7
4
+ data.tar.gz: 4d2930c496c7a4edee32a9993d601f40a7546318
5
5
  SHA512:
6
- metadata.gz: 2c0bd826f755585ab3a724a0b3436ba0c49edaba2ec6b52b692308fbc01ebd503c08f8460cc46cf607f149e840576d5076709fa78889579815d1c9cd89268d4c
7
- data.tar.gz: c0dd281cae6b579fd077b9394d39af1df10963c1d0781141e7a2d148309f10d74297569f456afa44c9fc1c2bd2b45135d8c290e7e213c1a50da4cb46d1087a76
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('subject.does_not_exist', name: name))) if labels.empty?
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-locker'
3
- spec.version = '1.0.6'
3
+ spec.version = '1.0.7'
4
4
  spec.authors = ['Eric Sigler']
5
5
  spec.email = ['me@esigler.com']
6
6
  spec.description = '"lock" and "unlock" arbitrary subjects'
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.6
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-21 00:00:00.000000000 Z
11
+ date: 2015-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita