rail-locator-api 0.0.31 → 0.0.32

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: 026cd0fcc09662b1aeaaea80e000531751bcada1b75f3a4e559abde8e484fc8f
4
- data.tar.gz: f38bf8f368cd1f17b582dc9f0db1d0f23e681192de76da545e543fa5e9e24f85
3
+ metadata.gz: dad7e7b83c16758623a09d848218d320f77256771df0665b296d9432b2cb85e4
4
+ data.tar.gz: 1f0ec5eeac0c08275c636d7c53344a19092c1794547b03369773f9e8957dc39a
5
5
  SHA512:
6
- metadata.gz: 9b64a402459eec3aa92ea08149c091972b88db9daade9ffedcb1a39de19e0b87bd91a0f5f3d3019724cc3c3828121dbb4da19ad036b96bed94e6653e98c7b2a6
7
- data.tar.gz: c65ef5d76b3b7a8cff3c4e99db635ea2c6fdf36d0137b0cc44720a29f60e4865dfbae7c00fee031f098dcb519e90f413c0369d773e46c70b87e9a214cc77d0bf
6
+ metadata.gz: de50ad61ed19986b0ac61e9ae9e17e99e782b55e08972a11ebe916b737b6d713ac49e251ecbd795e480e3d88d9bc4beeee00707e0e95339fbd9428ffccac8624
7
+ data.tar.gz: 5c5192e82b74f2503ddc5099de920f6215f34bda55c91a79a975d8ad56be59d3a6484f2b38bb70fdc202c8caf8a4f5c1f1d1ca6981ee2b1511c0add182120e45
@@ -128,6 +128,10 @@ module RailLocatorApi
128
128
  request.headers['Authorization'] = "Bearer #{RailLocatorApi::Request.access_token}"
129
129
  end
130
130
  request.headers['User-Agent'] = "RailLocatorApi/#{RailLocatorApi::VERSION} Ruby gem"
131
+ if @request_builder.without_ratelimit
132
+ request.headers['X-Request-Without-Ratelimit'] = "1"
133
+ end
134
+
131
135
  request.headers.merge!(headers) if headers
132
136
  request.body = MultiJson.dump(body) if body
133
137
  request.options.timeout = self.timeout
@@ -1,7 +1,8 @@
1
1
  module RailLocatorApi
2
2
  class Request
3
3
  attr_accessor :access_token, :refresh_token, :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, :logger, :test
4
+ :timeout, :open_timeout, :proxy, :ssl_options, :faraday_adapter, :symbolize_keys, :debug,
5
+ :without_ratelimit, :logger, :test
5
6
 
6
7
  AUTH_METHODS = [:keycloak, :api_key, :base64]
7
8
  DEFAULT_AUTH_METHOD = :keycloak
@@ -10,7 +11,8 @@ module RailLocatorApi
10
11
 
11
12
  def initialize(access_token: nil, refresh_token: nil, api_key: nil, api_user_email: nil, api_user_password: nil,
12
13
  api_endpoint: nil, api_auth_method: nil, timeout: nil, open_timeout: nil, proxy: nil, ssl_options: nil,
13
- faraday_adapter: nil, symbolize_keys: false, debug: false, logger: nil, test: false)
14
+ faraday_adapter: nil, symbolize_keys: false, debug: false, without_ratelimit: false,
15
+ logger: nil, test: false)
14
16
 
15
17
  @path_parts = []
16
18
  @api_key = api_key || self.class.api_key || ENV['RAIL_LOCATOR_API_KEY']
@@ -35,6 +37,7 @@ module RailLocatorApi
35
37
  @faraday_adapter = faraday_adapter || self.class.faraday_adapter || Faraday.default_adapter
36
38
  @symbolize_keys = symbolize_keys || self.class.symbolize_keys || false
37
39
  @debug = debug || self.class.debug || false
40
+ @without_ratelimit = without_ratelimit || self.class.without_ratelimit
38
41
  @test = test || self.class.test || false
39
42
  @logger = logger || self.class.logger || ::Logger.new(STDOUT)
40
43
  end
@@ -93,15 +96,17 @@ module RailLocatorApi
93
96
  end
94
97
 
95
98
  class << self
96
- attr_accessor :access_token, :refresh_token, :api_key, :api_user_email, :api_user_password, :api_auth_method, :timeout, :open_timeout,
97
- :api_endpoint, :proxy, :ssl_options, :faraday_adapter, :symbolize_keys, :debug, :logger, :test
99
+ attr_accessor :access_token, :refresh_token, :api_key, :api_user_email, :api_user_password, :api_auth_method,
100
+ :timeout, :open_timeout, :api_endpoint, :proxy, :ssl_options, :faraday_adapter, :symbolize_keys,
101
+ :debug, :without_ratelimit, :logger, :test
98
102
 
99
103
  def method_missing(sym, *args, &block)
100
104
  new(access_token: self.access_token, refresh_token: self.refresh_token, api_key: self.api_key,
101
105
  api_user_email: self.api_user_email, api_user_password: self.api_user_email,
102
106
  api_auth_method: self.api_auth_method, api_endpoint: self.api_endpoint,
103
107
  timeout: self.timeout, open_timeout: self.open_timeout, faraday_adapter: self.faraday_adapter,
104
- symbolize_keys: self.symbolize_keys, debug: self.debug, proxy: self.proxy, ssl_options: self.ssl_options, logger: self.logger,
108
+ symbolize_keys: self.symbolize_keys, debug: self.debug, without_ratelimit: self.without_ratelimit,
109
+ proxy: self.proxy, ssl_options: self.ssl_options, logger: self.logger,
105
110
  test: self.test).send(sym, *args, &block)
106
111
  end
107
112
 
@@ -1,3 +1,3 @@
1
1
  module RailLocatorApi
2
- VERSION = "0.0.31"
2
+ VERSION = "0.0.32"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rail-locator-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Osetrov