lita-rally 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2db73ea5059022b86f7a427e9df09075d7d6930f
4
- data.tar.gz: cf7f9ac9b85233998a959b6c5079fb6c8527e618
3
+ metadata.gz: 40581d0710a7b5c7637da8b575080fd267c8904c
4
+ data.tar.gz: 0a26ef23031de6a1029bedb3be1fb450fda5d785
5
5
  SHA512:
6
- metadata.gz: 71fd9836a1011e575fa31dea22bcd1f271363a318f0dca650382617fc351c2603485d3941268d8db141b554dc7f4e188c52ced4a472efda180f5bbf3ca9ef726
7
- data.tar.gz: 10b463b036c1febcec554a40644477df781c7c50da3bfbe94b3b05adc686765779545a9a9913edb9a7fe3c660cc79ccea7fa0c5de0072fb0f632eed67a3c6aa1
6
+ metadata.gz: 0beabbd90e2b677b1521c92a264714cb14ee80eba7f924d5a2e2d380335d61d2a3b3f47a08876954d1707764fd5e6998758cba94fc9f52d2d98373d77254e5c5
7
+ data.tar.gz: 303448693dae20dfe5c0ccd4c3a1c1d4dfcd27143acded7534f5e7b16bcf6653a6f2edfda154b6a438d9063713818694ea03c3541f06985ee6d46fed0d75a5eb
@@ -160,16 +160,16 @@ module Lita
160
160
 
161
161
  def rally_find_my(response)
162
162
  if config.hipchat_token
163
- uuid = rally_find_user(hipchat_find_user(response.user.mention_name))
163
+ email = hipchat_find_user(response.user.mention_name)
164
164
 
165
- raise "Your email is not found in Rally" unless uuid
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, uuid))
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
- uuid = rally_find_user(hipchat_find_user(response.user.mention_name))
183
+ email = hipchat_find_user(response.user.mention_name)
184
184
 
185
- raise "Your email is not found in Rally" unless uuid
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, uuid)}"
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, uuid)
486
+ def rally_find_type(type, email)
487
487
  rally = get_rally_api
488
488
 
489
- q = "(Owner.ObjectUUID = \"#{uuid}\")"
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-rally'
3
- spec.version = '1.0.1'
3
+ spec.version = '1.0.2'
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.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Li