api_tools 0.0.1 → 0.0.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: aa3406721afd6f57f1b83462a997151be265af11
4
- data.tar.gz: 460cf4014b0f3169bcbdbbeba9193dc6a0f2a94a
3
+ metadata.gz: 1d1f1a6697b965e58c477d6a010ec1cfd6447575
4
+ data.tar.gz: 461feec02dba1372e9bd13d0ee5ba0130f60893d
5
5
  SHA512:
6
- metadata.gz: da927e76d40b10541e025f17f5fbeb2a6bad913699b3062ddd0b1dbb77efd56a539ca83d8165f253528da9971d7922eb616e78e2517f6555b655a9b8fceedfea
7
- data.tar.gz: 44fbb3456074f86dad7a622550d3be636f712be4b3443860defdf0c3170319e90491ebf1fe3ab7f0f674a5f15635020ae6be8dfbff7c0e54f5e691724b8e9b4c
6
+ metadata.gz: f12330f40ec97f66f6d9016b309066b1a0da4f064e51a58572aaced55d5a08b09438bdfabca3cd2a7bbe55b6477c78ff1b440e7932cf503b8a9b9875cf6381e7
7
+ data.tar.gz: 424a5ae18fb1e0c5ad34358b32027c3f70688f58e78bcefd8c27947bd59b3fbc9684ee77337d151ebd29be0962ea1079aff6f89df57e09cd5fab13fc0b000ccb
@@ -35,7 +35,7 @@ class DefaultRest
35
35
  url: url,
36
36
  headers: user_options[:header],
37
37
  timeout: user_options[:timeout]
38
- }
38
+ }.merge(user_options[:other_base_execute_option])
39
39
  end
40
40
 
41
41
  def build_similar_post_request(word, path, user_params, user_options)
@@ -47,7 +47,7 @@ class DefaultRest
47
47
  payload: payload,
48
48
  headers: user_options[:header],
49
49
  timeout: user_options[:timeout]
50
- }
50
+ }.merge(user_options[:other_base_execute_option])
51
51
  end
52
52
 
53
53
  def build_whole_url(path)
@@ -64,6 +64,7 @@ class DefaultRest
64
64
 
65
65
  def basic_request(request_dict, user_options)
66
66
  exception = nil
67
+
67
68
  user_options[:retry_times].times do
68
69
  begin
69
70
  response = ::RestClient::Request.execute(request_dict)
@@ -97,6 +98,7 @@ class DefaultRest
97
98
  params_to_json: true,
98
99
  ensure_no_exception: false,
99
100
  header: { content_type: :json, accept: :json },
101
+ other_base_execute_option: {},
100
102
  exception_with_response: true
101
103
  }
102
104
  end
@@ -109,4 +111,4 @@ class DefaultRest
109
111
  {} # 子类中复写
110
112
  end
111
113
  end
112
- end
114
+ end
@@ -1,3 +1,3 @@
1
1
  module ApiTools
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - atpking
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-22 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler