lita-rally 1.2.1 → 1.2.2

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: 6387dce60d92a23b0ddc71fa5e38eb8a29daef56
4
- data.tar.gz: 0df0b96abb47ef7d0d53bf4b91e095f5313bba74
3
+ metadata.gz: a04824dbbaf2ac95c88a4e94eab2076060ea7ff2
4
+ data.tar.gz: 40b3282b4c2620c20a08e1bd3c4e3b126dd5e42e
5
5
  SHA512:
6
- metadata.gz: df9730657e38a845916607ed104e9b46be01057c5c8b54228e03f15d495e894162d1d3d15b144975b2cebcc5fd2efaadefc49e0c9a740aacbddc28cf3123886e
7
- data.tar.gz: 859da18aa0f8d5e99ef0c84a4cc9afa26140f4a458ee285cf933c402bce3107e6949262ad95eb349ffd3bcf0107ad8c99ac3633691ca006c6664396ed422c0fe
6
+ metadata.gz: 2a18099cf16f8202fa98d2b938521a67abfe4ee57fa13d38940350930226ec4efcdbb0e5b99d9dff9e6f99a9afb82670b9640fc315515f962ff67de263eabc1a
7
+ data.tar.gz: 4ba8c14552b582f8759b868934e956d7bd6d4545ab1db2ecfa336070bebfeabc800f074d5a8ccb8795674aafea01ba37dfe4f68d678694939305993b2b2417d9
@@ -215,16 +215,32 @@ module Lita
215
215
  end
216
216
 
217
217
  def rally_assign(response)
218
- type = response.matches[0][0].downcase
219
- id = response.matches[0][1]
220
- owner = response.matches[0][2]
218
+ if config.hipchat_token
219
+ if config.read_only
220
+ response.reply('Rally plugin is operating in Read-Only mode, ' \
221
+ 'ask your chat-ops admin to disable it.')
222
+ return
223
+ end
224
+
225
+ type = response.matches[0][0].downcase
226
+ id = response.matches[0][1]
227
+ owner = response.matches[0][2]
221
228
 
222
- mention = owner.nil? ? response.user.mention_name : owner
229
+ mention = owner.nil? ? response.user.mention_name : owner
223
230
 
224
- user = rally_find_user(hipchat_find_user(mention))
231
+ user = rally_find_user(hipchat_find_user(mention))
225
232
 
226
- response.reply(update_object(type, id, 'owner', user, options = {}))
233
+ response.reply(update_object(type, id, 'owner', user, options = {}))
227
234
 
235
+ update_object(type, id, 'Notes',
236
+ "<br />assigned ownership to #{user} by " \
237
+ "#{response.user.name} on " \
238
+ "#{Time.now.strftime('%Y-%m-%dT%H:%M:%S%z')}",
239
+ append: true)
240
+ else
241
+ response.reply('This is a HipChat only function, please provide '\
242
+ 'hipchat_token to use this function.')
243
+ end
228
244
  rescue Exception => e
229
245
  response.reply("Error during assignment: #{e}")
230
246
  end
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.2.1'
3
+ spec.version = '1.2.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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-rally
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
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-29 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita