dingtalk-ruby 0.1.2 → 0.1.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
  SHA256:
3
- metadata.gz: 77c56bca62130c5a210a1dab6a865dc0d4e56c4cbed4d4fad1528070f78e9524
4
- data.tar.gz: 2b54ed3c8fa5f79ef6e0c63fe1946e929abe40aea1fd6980cde332b5fa4ecdf2
3
+ metadata.gz: 811c636643cfe68d5b23b1f933630f0a33ccb5405435e9cedd01abf66f77d8a7
4
+ data.tar.gz: 944ecf610a8dab70698c7fab8d7e28c5a3153bf8e5106c81cb12c7224f293a07
5
5
  SHA512:
6
- metadata.gz: 194276a18dd442a666e0dc8357873b5bcfd8256534044bba9f4a25831c3bdd7e89edf94a3c4a9a25de61863a5e4be0e991ec08626f2fdbfaebd9a66620ba8da3
7
- data.tar.gz: cceb3a372dd28cd3d6010a9724b3e5cbd8bc36684ccfcde814e4efd0256186dec0dbfcadb6d3998f2b792462e21d54d6380cec42e60f4d9654f9d61bfa01c1de
6
+ metadata.gz: 12e0dd15a6f4d1f4b16378d728173b5f7c1b6235f6c20ce8d9607f7874aa2a5928cf4022a42a84c1bc70c0794c3f30a6615375d685d9addcc0b06e219567bf26
7
+ data.tar.gz: 72faf32c95c741199d2e971c16aabc7061ebe1e612cd450f02c0847599de52e1f9f3fa91315e5644a7f43a2a4c20d1a52a6e0a8104a8be93d91666677862aa37
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dingtalk-ruby (0.1.2)
4
+ dingtalk-ruby (0.1.3)
5
5
  activesupport
6
6
  faraday
7
7
 
data/lib/dingtalk.rb CHANGED
@@ -5,6 +5,13 @@ require "dingtalk/api/Base"
5
5
  module Dingtalk
6
6
  class Error < StandardError; end
7
7
  class RequestException < RuntimeError; end
8
+ class TopException < RuntimeError
9
+ attr_accessor :errcode, :errmsg, :application_host, :service_host
10
+
11
+ def to_s
12
+ "\nerrcode= #{@errcode}\nerrmsg=#{@errmsg}\napplication_host=#{@application_host}\nservice_host=#{@service_host}"
13
+ end
14
+ end
8
15
 
9
16
  class << self
10
17
  attr_accessor :configuration
@@ -124,12 +124,12 @@ module Dingtalk
124
124
  # puts "result:", result
125
125
  jsonobj = JSON.parse(result)
126
126
  if jsonobj.key?(P_CODE) && (jsonobj[P_CODE] != 0)
127
- # error = TopException.new
128
- # error.errcode = jsonobj[P_CODE]
129
- # error.errmsg = jsonobj[P_MSG]
130
- # error.application_host = response.headers.fetch("Application-Host", "")
131
- # error.service_host = response.headers.fetch("Location-Host", "")
132
- raise Error, "TopException"
127
+ error = TopException.new
128
+ error.errcode = jsonobj[P_CODE]
129
+ error.errmsg = jsonobj[P_MSG]
130
+ error.application_host = response.headers.fetch("Application-Host", "")
131
+ error.service_host = response.headers.fetch("Location-Host", "")
132
+ raise error, "TopException"
133
133
  end
134
134
 
135
135
  jsonobj
@@ -1,3 +1,3 @@
1
1
  module Dingtalk
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dingtalk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zhenyuan Lau
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-26 00:00:00.000000000 Z
11
+ date: 2019-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday