lita-rally 1.0.1 → 1.0.2
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/rally.rb +8 -22
- data/lita-rally.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40581d0710a7b5c7637da8b575080fd267c8904c
|
4
|
+
data.tar.gz: 0a26ef23031de6a1029bedb3be1fb450fda5d785
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0beabbd90e2b677b1521c92a264714cb14ee80eba7f924d5a2e2d380335d61d2a3b3f47a08876954d1707764fd5e6998758cba94fc9f52d2d98373d77254e5c5
|
7
|
+
data.tar.gz: 303448693dae20dfe5c0ccd4c3a1c1d4dfcd27143acded7534f5e7b16bcf6653a6f2edfda154b6a438d9063713818694ea03c3541f06985ee6d46fed0d75a5eb
|
data/lib/lita/handlers/rally.rb
CHANGED
@@ -160,16 +160,16 @@ module Lita
|
|
160
160
|
|
161
161
|
def rally_find_my(response)
|
162
162
|
if config.hipchat_token
|
163
|
-
|
163
|
+
email = hipchat_find_user(response.user.mention_name)
|
164
164
|
|
165
|
-
raise "Your email is not found in Rally" unless
|
165
|
+
raise "Your email is not found in Rally" unless email
|
166
166
|
|
167
167
|
type = response.matches[0][0]
|
168
168
|
|
169
169
|
type = 'story' if type == 'stories'
|
170
170
|
type = type[0..-2] if type[-1] == 's'
|
171
171
|
|
172
|
-
response.reply(rally_find_type(type,
|
172
|
+
response.reply(rally_find_type(type, email))
|
173
173
|
else
|
174
174
|
response.reply('This is a HipChat only function, please provide '\
|
175
175
|
'hipchat_token to use this function.')
|
@@ -180,13 +180,13 @@ module Lita
|
|
180
180
|
|
181
181
|
def rally_find_mine(response)
|
182
182
|
if config.hipchat_token
|
183
|
-
|
183
|
+
email = hipchat_find_user(response.user.mention_name)
|
184
184
|
|
185
|
-
raise "Your email is not found in Rally" unless
|
185
|
+
raise "Your email is not found in Rally" unless email
|
186
186
|
|
187
187
|
response.reply(
|
188
188
|
%w{story defect task}.inject("") do |output,type|
|
189
|
-
output += "#{type.capitalize}:\n#{rally_find_type(type,
|
189
|
+
output += "#{type.capitalize}:\n#{rally_find_type(type, email)}"
|
190
190
|
end
|
191
191
|
)
|
192
192
|
|
@@ -483,10 +483,10 @@ module Lita
|
|
483
483
|
)
|
484
484
|
end
|
485
485
|
|
486
|
-
def rally_find_type(type,
|
486
|
+
def rally_find_type(type, email)
|
487
487
|
rally = get_rally_api
|
488
488
|
|
489
|
-
q = "(Owner.
|
489
|
+
q = "(Owner.EmailAddress = #{email})"
|
490
490
|
query =
|
491
491
|
case type
|
492
492
|
when 'defect'
|
@@ -554,20 +554,6 @@ module Lita
|
|
554
554
|
)['email']
|
555
555
|
end
|
556
556
|
|
557
|
-
def rally_find_user(email)
|
558
|
-
rally = get_rally_api
|
559
|
-
|
560
|
-
query = RallyAPI::RallyQuery.new()
|
561
|
-
query.type = :user
|
562
|
-
query.query_string = "(EmailAddress = #{email})"
|
563
|
-
|
564
|
-
result = rally.find(query)
|
565
|
-
|
566
|
-
return nil if result.count == 0
|
567
|
-
|
568
|
-
result[0].read['ObjectUUID']
|
569
|
-
end
|
570
|
-
|
571
557
|
end
|
572
558
|
|
573
559
|
Lita.register_handler(Rally)
|
data/lita-rally.gemspec
CHANGED