lita-rally 1.1.0 → 1.1.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: 581edd6f8cb3db06843edef63455bcecd74b4e94
4
- data.tar.gz: cca1c76d834c88f006be48d66a5816156d3fff09
3
+ metadata.gz: 1de7817b02a56a6c0942f304732757084f795319
4
+ data.tar.gz: 78beb182720543e7a7eeee3685c23950a4c22d0b
5
5
  SHA512:
6
- metadata.gz: 38a984ee90fb4972c2ac0b758e7eacc7578fb4d52c391c8b7aef9ebc40e14158f7d14f536084652a538c37e7557d3f8575a72c0c0049eafedbd47ea902e2ed4b
7
- data.tar.gz: 1a7e8c57d39bade753aad14b8eb01ef99fdd9d72b4e0d5e7c12c03d88ebd6e0567db0eb06cec15f52422f036effd0ea65b1048b97ffa52238eb6d9295044aaab
6
+ metadata.gz: 3d44121cd9ab8bd1598a6bd1f39c5a5b77eedbfc52128352ae27896041773b4f9f9a705891b6645ad2bfa1fd09c39e2b980936ebd63bb7319966a676b8c2d259
7
+ data.tar.gz: 84c1a4b67847fe00f7cb2b62ec5811525557eb5eb70cda5c3e8f8f87384c4a0e99cb2aa71cf3565320310b880a6eeb8afb3dddf039dc46f9a68d6aa10e302979
data/README.md CHANGED
@@ -129,6 +129,15 @@ belongs to me of specific type. (Limited to type Defect, Story, Task) Look up
129
129
  involves using HipChat to determine user's e-mail. HipChat user's registered
130
130
  e-mail must match Rally user registered e-mail.
131
131
 
132
+ ```
133
+ lita rally for [@]mention
134
+ lita rally <defect|defects|story|stories|task|tasks> for [@]mention
135
+ ```
136
+
137
+ **(HipChat Only, require hipchat_token config)** Similar to ```rally mine```
138
+ and ```rally my ...```, except it'll look up the @mention user instead of user
139
+ executed the command.
140
+
132
141
  ```
133
142
  lita rally <start|pause|finish|accept|backlog> <FormattedID>
134
143
  ```
@@ -158,24 +158,32 @@ module Lita
158
158
  '(HipChat Only) Find defects/stories/tasks belongs to me'
159
159
  })
160
160
 
161
- route( /^rally @(\S*)$/, :rally_find_mention, command: true, help: {
162
- 'rally @mention' =>
161
+ route( /^rally for (.+)$/, :rally_find_mention, command: true, help: {
162
+ 'rally for (@)mention' =>
163
163
  '(HipChat Only) Find all defects/stories/tasks belongs to @mention'
164
164
  })
165
165
 
166
- route( /^rally @(\S*) (defect|defects|story|stories|task|tasks)/,
166
+ route( /^rally (defect|defects|story|stories|task|tasks) for (.+)$/,
167
167
  :rally_find_mention, command: true, help: {
168
- 'rally @mention <defect|story|task>' =>
168
+ 'rally <defect|story|task> for (@)mention' =>
169
169
  '(HipChat Only) Find defects/stories/tasks belongs to @mention'
170
170
  })
171
171
 
172
172
  def rally_find_mention(response)
173
173
  if config.hipchat_token
174
- email = hipchat_find_user(response.matches[0][0])
174
+ p1 = response.matches[0][0]
175
+ p2 = response.matches[0][1]
176
+
177
+ type, user =
178
+ if %w{defect defects story stories task tasks}.include?(p1)
179
+ [p1, p2]
180
+ else
181
+ [nil, p1]
182
+ end
175
183
 
176
- raise "Your email is not found in Rally" unless email
184
+ email = hipchat_find_user(user[0] == '@' ? user[1..-1] : user)
177
185
 
178
- type = response.matches[0][1]
186
+ raise "Could not find user's email" unless email
179
187
 
180
188
  type = 'story' if type == 'stories'
181
189
  type = type[0..-2] if !type.nil? && type[-1] == 's'
data/lita-rally.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-rally'
3
- spec.version = '1.1.0'
3
+ spec.version = '1.1.1'
4
4
  spec.authors = ['Richard Li']
5
5
  spec.email = ['evilcat@wisewolfsolutions.com']
6
6
  spec.description = %q{Rally plugin for lita bot}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-rally
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Li