rail-locator-api 0.1.32 → 0.1.34
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ac06de6bd89af9e080a3d79a6e5d6c17943f3868e9c78dfeb7f14fe43208ef2
|
4
|
+
data.tar.gz: a06572f9f5e0d4a43c9d3c248adf9b0be20469ca55f883f00f1104f04aef186a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bd9d99fc1d243f17febc54bf56c73bf6b45f220586d237e4606c6a84d806e457162984b9c1a163d0af1395a6404ab640ae35bfd6813f83e6144152ae6dccbaf
|
7
|
+
data.tar.gz: 2ba0d749e92b527a20081f1012f7cb19f34372b242780a6241194f2f1e94c5eb7bfe56bce6b011ffa677656e390c6b350f440f35cb0add7e7f52989415a14f63
|
@@ -17,5 +17,6 @@ RailLocatorApi.setup do |config|
|
|
17
17
|
config::Request.open_timeout = 60
|
18
18
|
config::Request.symbolize_keys = true
|
19
19
|
config::Request.debug = false
|
20
|
+
config::Request.debug_options = { headers: true, bodies: false, errors: false, log_level: :info } # https://lostisland.github.io/faraday/middleware/logger
|
20
21
|
end
|
21
22
|
end
|
@@ -177,7 +177,7 @@ module RailLocatorApi
|
|
177
177
|
faraday.response :raise_error
|
178
178
|
faraday.adapter adapter
|
179
179
|
if @request_builder.debug
|
180
|
-
faraday.response :logger, @request_builder.logger,
|
180
|
+
faraday.response :logger, @request_builder.logger, @request_builder.debug_options
|
181
181
|
end
|
182
182
|
end
|
183
183
|
client
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module RailLocatorApi
|
2
2
|
class Request
|
3
3
|
attr_accessor :access_token, :refresh_token, :api_user_id, :api_key, :api_user_email, :api_user_password, :api_auth_method, :api_endpoint,
|
4
|
-
:timeout, :open_timeout, :proxy, :ssl_options, :faraday_adapter, :symbolize_keys, :debug,
|
4
|
+
:timeout, :open_timeout, :proxy, :ssl_options, :faraday_adapter, :symbolize_keys, :debug, :debug_options,
|
5
5
|
:without_ratelimit, :is_allow_access_to_coordinates, :logger, :test
|
6
6
|
|
7
7
|
AUTH_METHODS = [:keycloak, :api_key, :base64]
|
@@ -11,7 +11,9 @@ module RailLocatorApi
|
|
11
11
|
|
12
12
|
def initialize(access_token: nil, refresh_token: nil, api_user_id: nil, api_key: nil, api_user_email: nil, api_user_password: nil,
|
13
13
|
api_endpoint: nil, api_auth_method: nil, timeout: nil, open_timeout: nil, proxy: nil, ssl_options: nil,
|
14
|
-
faraday_adapter: nil, symbolize_keys: false, debug: false,
|
14
|
+
faraday_adapter: nil, symbolize_keys: false, debug: false,
|
15
|
+
debug_options: { headers: true, bodies: false, errors: false, log_level: :info },
|
16
|
+
without_ratelimit: false, is_allow_access_to_coordinates: false,
|
15
17
|
logger: nil, test: false)
|
16
18
|
|
17
19
|
@path_parts = []
|
@@ -42,6 +44,7 @@ module RailLocatorApi
|
|
42
44
|
@faraday_adapter = faraday_adapter || self.class.faraday_adapter || Faraday.default_adapter
|
43
45
|
@symbolize_keys = symbolize_keys || self.class.symbolize_keys || false
|
44
46
|
@debug = debug || self.class.debug || false
|
47
|
+
@debug_options = debug_options || self.class.debug_options || { headers: true, bodies: false, errors: false, log_level: :info }
|
45
48
|
@without_ratelimit = without_ratelimit || self.class.without_ratelimit
|
46
49
|
@is_allow_access_to_coordinates = is_allow_access_to_coordinates || self.class.is_allow_access_to_coordinates
|
47
50
|
@test = test || self.class.test || false
|
@@ -120,7 +123,7 @@ module RailLocatorApi
|
|
120
123
|
class << self
|
121
124
|
attr_accessor :access_token, :refresh_token, :api_user_id, :api_key, :api_user_email, :api_user_password, :api_auth_method,
|
122
125
|
:timeout, :open_timeout, :api_endpoint, :proxy, :ssl_options, :faraday_adapter, :symbolize_keys,
|
123
|
-
:debug, :without_ratelimit, :is_allow_access_to_coordinates, :logger, :test
|
126
|
+
:debug, :debug_options, :without_ratelimit, :is_allow_access_to_coordinates, :logger, :test
|
124
127
|
|
125
128
|
def method_missing(sym, *args, &block)
|
126
129
|
new(access_token: self.access_token, refresh_token: self.refresh_token,
|
@@ -129,7 +132,8 @@ module RailLocatorApi
|
|
129
132
|
api_user_email: self.api_user_email, api_user_password: self.api_user_email,
|
130
133
|
api_auth_method: self.api_auth_method, api_endpoint: self.api_endpoint,
|
131
134
|
timeout: self.timeout, open_timeout: self.open_timeout, faraday_adapter: self.faraday_adapter,
|
132
|
-
symbolize_keys: self.symbolize_keys, debug: self.debug,
|
135
|
+
symbolize_keys: self.symbolize_keys, debug: self.debug, debug_options: self.debug_options,
|
136
|
+
without_ratelimit: self.without_ratelimit,
|
133
137
|
is_allow_access_to_coordinates: self.is_allow_access_to_coordinates,
|
134
138
|
proxy: self.proxy, ssl_options: self.ssl_options, logger: self.logger,
|
135
139
|
test: self.test).send(sym, *args, &block)
|