lita-activedirectory 0.1.0 → 0.1.1

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: 9da8446b0dd9d8d01a0dc50fe33b36ac353cfc29
4
- data.tar.gz: 47b5d536c07e65ff883a873721ea1f4a1e0961a9
3
+ metadata.gz: 10c750c82f5bd471e2cecfcc6f8d95adb02ebbca
4
+ data.tar.gz: 66fe58aa68a7361b576e7e12c52f8fac9f376514
5
5
  SHA512:
6
- metadata.gz: c7f37635a36caba56c981baaaf22e3dfc09a809e25c7a47b3507d1241a5a3caf910fa0960777eb26fb565076112d7fcbabd0956bc8fa81c2b2353ce6b9127e76
7
- data.tar.gz: 985815d79f9fc447adf01f229c0561da55806739c75900eebefba72b5551fb14407951dbd4ea5fdb3d2c92276226e15cd0d45aac48082c757aa642a2f88d6e78
6
+ metadata.gz: 3f68ec0cab9eb376ec2fe25c9d836cc1a2e9bee63c065f87c5e2a1b013cceddf41c26272af8aee013f384859c66e6c6a47a83d78734be80ccba5b95333148598
7
+ data.tar.gz: c376e44cc3947d4a0a9285dc83bb604039c8f476153a1e988118a512b93ce5399a15447d0fb1879be4d3d01b3c225b9f64fbe1b546c0773fc809b747c0479381
@@ -31,8 +31,21 @@ module Lita
31
31
  handle_user_query(response, user, user_query(user))
32
32
  end
33
33
 
34
- def handle_user_query(response, user, username)
35
- case username
34
+ def unlock(response)
35
+ user = response.matches[0][1]
36
+ response.reply_with_mention(t('replies.unlock.working'))
37
+ user_result = user_query(user)
38
+ if user_result
39
+ handle_unlock_query(response, user, unlock_user(user))
40
+ else
41
+ handle_user_query(response, user, user_result)
42
+ end
43
+ end
44
+
45
+ private
46
+
47
+ def handle_user_query(response, user, result)
48
+ case result
36
49
  when true
37
50
  response.reply_with_mention(
38
51
  t('replies.user_locked?.locked', user: user)
@@ -48,14 +61,16 @@ module Lita
48
61
  end
49
62
  end
50
63
 
51
- def unlock(response)
52
- user = response.matches[0][1]
53
- response.reply_with_mention(t('replies.unlock.working'))
54
- user_result = user_query(user)
55
- if user_result
56
- unlock_user(user)
57
- else
58
- handle_user_query(response, user, user_result)
64
+ def handle_unlock_query(response, user, result)
65
+ case result
66
+ when true
67
+ response.reply_with_mention(
68
+ t('replies.unlock.success', user: user)
69
+ )
70
+ when false
71
+ response.reply_with_mention(
72
+ t('replies.unlock.fail', user: user)
73
+ )
59
74
  end
60
75
  end
61
76
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-activedirectory'
3
- spec.version = '0.1.0'
3
+ spec.version = '0.1.1'
4
4
  spec.authors = ['Daniel Schaaff']
5
5
  spec.email = ['dschaaff@knuedge.com']
6
6
  spec.description = 'ldap/active directory instructions for Lita'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-activedirectory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schaaff