lita-glip 0.0.2 → 0.0.3

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: 52449e2326e1eb081708f6b262d275ef8c4ef150
4
- data.tar.gz: c33de9c51f0b6c74d11082f0ebaadf709f45c4a5
3
+ metadata.gz: 4b73e28630b7f2b002b286a65a53c46db29d527e
4
+ data.tar.gz: 58dfe465ef6578ef594ddc1a8dec60ac32b7732d
5
5
  SHA512:
6
- metadata.gz: ddfc43174c812c66dca76acebd619b4f1866d05a6e8d87dfea9f620d488184735f2d216a95d23d6763c93730bf73118cadd305b179840b37315c850dddbecc4b
7
- data.tar.gz: ee5b312e8911b402fcd00e2858cefd4f25209c664f4ca50ea1a9a8d3c2ff7a205df66915cbe446fa59394158194caac99f5b27d7b258fd5f587c5b8d7f44d09c
6
+ metadata.gz: 520d7554527cc38f616cb962a3381d399ffb37bfde161589f52fb7f49b1ee06b620fc34028a5f86bc97e1630be9b6df13836fd872aa566ab64f9e423eb7b52e4
7
+ data.tar.gz: 8365b79c691e3357afff2a20ad1937162ab6d2e667c3bbfec4b4e7e288af629460b8392038c1b897d93c105d60c9f2f3529872d1bc2b2433ca8b8f0f60830bbe
@@ -1,4 +1,6 @@
1
1
  CHANGELOG
2
2
  ---------
3
+ - **2017-03-13**: 0.0.3
4
+ - fix `UserCreator::glip_user` bug
3
5
  - **2017-01-01**: 0.0.1
4
6
  - Initial commit
@@ -12,7 +12,8 @@ module Lita
12
12
 
13
13
  def update(message)
14
14
  m = message
15
- unless m.is_a?(Hash) && m.key?('event') && m['event'].index('/glip/posts').is_a?(Fixnum)
15
+
16
+ unless m.is_a?(Hash) && m.key?('event') && m['event'].index('/glip/posts').is_a?(Integer)
16
17
  return
17
18
  end
18
19
  unless m.key?('body') && m['body'].key?('messageType') && m['body']['messageType'] == "PostAdded"
@@ -1,3 +1,5 @@
1
+ require 'multi_json'
2
+
1
3
  module Lita
2
4
  module Adapters
3
5
  class Glip < Adapter
@@ -9,14 +11,20 @@ module Lita
9
11
 
10
12
  def create_user(user_id, glip_sdk)
11
13
  res = glip_sdk.persons.get personId: user_id
14
+ Lita.logger.debug("Glip API Response Status: #{res.status}.")
15
+
12
16
  if res.status == 200
13
17
  glip_user_name = real_name res.body
14
- return Lita::User.create(
15
- glip_user['id'],
18
+ Lita.logger.debug("Glip API Response: User Name: #{glip_user_name}/#{res.body['id']}.")
19
+ user = Lita::User.create(
20
+ res.body['id'],
16
21
  name: glip_user_name,
17
22
  mention_name: glip_user_name
18
23
  )
24
+ Lita.logger.debug("Created New User With User Name [#{glip_user['id']}][#{glip_user_name}]")
25
+ return user
19
26
  end
27
+ Lita.logger.debug("Create New User [#{user_id}]")
20
28
  User.create user_id
21
29
  end
22
30
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-glip'
3
- spec.date = '2017-01-02'
4
- spec.version = '0.0.2'
3
+ spec.date = '2017-03-13'
4
+ spec.version = '0.0.3'
5
5
  spec.authors = ['John Wang']
6
6
  spec.email = ["johncwang@gmail.com"]
7
7
  spec.description = %q{A Glip adapter for Lita.}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-glip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Wang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-02 00:00:00.000000000 Z
11
+ date: 2017-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita