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 +4 -4
- data/lib/api_tools/default_rest.rb +5 -3
- data/lib/api_tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d1f1a6697b965e58c477d6a010ec1cfd6447575
|
4
|
+
data.tar.gz: 461feec02dba1372e9bd13d0ee5ba0130f60893d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
114
|
+
end
|
data/lib/api_tools/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|