lita-rally 1.0.2 → 1.1.0

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: 40581d0710a7b5c7637da8b575080fd267c8904c
4
- data.tar.gz: 0a26ef23031de6a1029bedb3be1fb450fda5d785
3
+ metadata.gz: 581edd6f8cb3db06843edef63455bcecd74b4e94
4
+ data.tar.gz: cca1c76d834c88f006be48d66a5816156d3fff09
5
5
  SHA512:
6
- metadata.gz: 0beabbd90e2b677b1521c92a264714cb14ee80eba7f924d5a2e2d380335d61d2a3b3f47a08876954d1707764fd5e6998758cba94fc9f52d2d98373d77254e5c5
7
- data.tar.gz: 303448693dae20dfe5c0ccd4c3a1c1d4dfcd27143acded7534f5e7b16bcf6653a6f2edfda154b6a438d9063713818694ea03c3541f06985ee6d46fed0d75a5eb
6
+ metadata.gz: 38a984ee90fb4972c2ac0b758e7eacc7578fb4d52c391c8b7aef9ebc40e14158f7d14f536084652a538c37e7557d3f8575a72c0c0049eafedbd47ea902e2ed4b
7
+ data.tar.gz: 1a7e8c57d39bade753aad14b8eb01ef99fdd9d72b4e0d5e7c12c03d88ebd6e0567db0eb06cec15f52422f036effd0ea65b1048b97ffa52238eb6d9295044aaab
@@ -149,7 +149,7 @@ module Lita
149
149
 
150
150
  route( /^rally mine/, :rally_find_mine, command: true, help: {
151
151
  'rally mine' =>
152
- '(HipChat Only) Find defects/stories/tasks belongs to me'
152
+ '(HipChat Only) Find all defects/stories/tasks belongs to me'
153
153
  })
154
154
 
155
155
  route( /^rally my (defect|defects|story|stories|task|tasks)/,
@@ -158,6 +158,45 @@ 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' =>
163
+ '(HipChat Only) Find all defects/stories/tasks belongs to @mention'
164
+ })
165
+
166
+ route( /^rally @(\S*) (defect|defects|story|stories|task|tasks)/,
167
+ :rally_find_mention, command: true, help: {
168
+ 'rally @mention <defect|story|task>' =>
169
+ '(HipChat Only) Find defects/stories/tasks belongs to @mention'
170
+ })
171
+
172
+ def rally_find_mention(response)
173
+ if config.hipchat_token
174
+ email = hipchat_find_user(response.matches[0][0])
175
+
176
+ raise "Your email is not found in Rally" unless email
177
+
178
+ type = response.matches[0][1]
179
+
180
+ type = 'story' if type == 'stories'
181
+ type = type[0..-2] if !type.nil? && type[-1] == 's'
182
+
183
+ if type
184
+ response.reply(rally_find_type(type, email))
185
+ else
186
+ response.reply(
187
+ %w{story defect task}.inject("") do |output,type|
188
+ output += "#{type.capitalize}:\n#{rally_find_type(type, email)}"
189
+ end
190
+ )
191
+ end
192
+ else
193
+ response.reply('This is a HipChat only function, please provide '\
194
+ 'hipchat_token to use this function.')
195
+ end
196
+ rescue Exception => e
197
+ response.reply("Error occured: #{e}")
198
+ end
199
+
161
200
  def rally_find_my(response)
162
201
  if config.hipchat_token
163
202
  email = hipchat_find_user(response.user.mention_name)
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.0.2'
3
+ spec.version = '1.1.0'
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-rally
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-28 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita