lita-rally 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lita/handlers/rally.rb +40 -1
- data/lita-rally.gemspec +1 -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: 581edd6f8cb3db06843edef63455bcecd74b4e94
|
4
|
+
data.tar.gz: cca1c76d834c88f006be48d66a5816156d3fff09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38a984ee90fb4972c2ac0b758e7eacc7578fb4d52c391c8b7aef9ebc40e14158f7d14f536084652a538c37e7557d3f8575a72c0c0049eafedbd47ea902e2ed4b
|
7
|
+
data.tar.gz: 1a7e8c57d39bade753aad14b8eb01ef99fdd9d72b4e0d5e7c12c03d88ebd6e0567db0eb06cec15f52422f036effd0ea65b1048b97ffa52238eb6d9295044aaab
|
data/lib/lita/handlers/rally.rb
CHANGED
@@ -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
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
|
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-
|
11
|
+
date: 2015-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|