zhima 0.3.3 → 0.3.4

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: 43037687ae73f8b71a5753c0996ea7bfa0cce3d0
4
- data.tar.gz: 1286fc66a6246181c7ac8b0527ef8e78107bef9a
3
+ metadata.gz: 09081054664c417c7999448526c4ea4f41f714d1
4
+ data.tar.gz: fc9868010e129ea96356b1ee7e69a85e5b478397
5
5
  SHA512:
6
- metadata.gz: 8c6fff8c94c128deef4616452768df00695351251daf63619841f1d7077c100e8a9670d2ce785c5eafe1b718643f83c1f7c2389edb91c1c6c665f0bc829b62cb
7
- data.tar.gz: f555b189fc5da2a159de5c6bf09f3b54907b6ac3c62876c8cc5c6c6a5b3bca3b1c1407a8604585dd59fd523b2a20fa331770535ff5800e0380faeea145a3b5a8
6
+ metadata.gz: 98ee868b002a3140756b888e4f9fc90598a94a536cd5455ff99ccc69088c48a63584268d137a95f0d411f41a80c60de0bf79a5c2428be462f3f2450ce1ee753c
7
+ data.tar.gz: 056abe30755d7c013ad225cac4403ee7e48b795441276145abb1b693beb7b49b04e57491adb71cfbbaf521407ddde95a87f79517a8db763ae943a81f411e2f53
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Zhima
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/zhima`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ 芝麻信用
6
4
 
7
5
  ## Installation
8
6
 
@@ -0,0 +1,3 @@
1
+ module Zhima
2
+ VerifySignError = Class.new StandardError
3
+ end
data/lib/zhima/request.rb CHANGED
@@ -32,7 +32,7 @@ module Zhima
32
32
  biz_response = Param.decrypt(biz_response) if response_hash["encrypted"]
33
33
 
34
34
  if response_hash["encrypted"] && !Sign.verify?(biz_response_sign, biz_response)
35
- {error: true, error_msg: 'sign解签错误'}
35
+ raise VerifySignError.new('sign解签错误')
36
36
  else
37
37
  JSON.parse(biz_response)
38
38
  end
data/lib/zhima/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zhima
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
data/lib/zhima.rb CHANGED
@@ -19,3 +19,4 @@ require_relative "zhima/request"
19
19
  require_relative "zhima/param"
20
20
  require_relative "zhima/sign"
21
21
  require_relative "zhima/util"
22
+ require_relative "zhima/errors"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zhima
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sam
@@ -99,6 +99,7 @@ files:
99
99
  - bin/setup
100
100
  - lib/zhima.rb
101
101
  - lib/zhima/config.rb
102
+ - lib/zhima/errors.rb
102
103
  - lib/zhima/ivs.rb
103
104
  - lib/zhima/param.rb
104
105
  - lib/zhima/request.rb