kosapi_client 0.10.0 → 0.11.0

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: c4202a54f8cf1c9b61c4494b55f81e3c9e39fe9141a9026205a658033bc563b8
4
- data.tar.gz: 37eeae9989bb2317061cd8892fd16c3dcc91010172b7572e5e2000c724c54560
3
+ metadata.gz: 70533a1607b3ab0e528a10d009aba7035140c5b32eecffd95b338b1ef2b467af
4
+ data.tar.gz: 99e2ea303323552a746d4994e93f136c0be06ae3b8bd3f3628912799845d3172
5
5
  SHA512:
6
- metadata.gz: c3705daa6950381659b87db8bd6efa07e0999d1d914187e5b1756f78c430a71bdff03f546f6d4dbe4073e8797b699a1630f195d2d202361f2c976e1d960ea267
7
- data.tar.gz: 3711b2272ceaff9864f3bc9dc77573dddd55cdfe3726a779caef4fb402d8e3be7c8ce069d8ecb5a3faed6f273928a0e156ff090203dfc17fb056ab84153a204f
6
+ metadata.gz: 1daba261a0bbaa138e7bd2d2956bf4e3c440566e338019241886a9efc6f6ea6a51dd807e4a05016ade4e07da9bb5c8e30b6013c93bac4ad0487081921c2c4e4b
7
+ data.tar.gz: 5c551498d1e614caad40f33948770576d4df1e170ec71be1135f1be6bba3036bdcb987452cd1238e2c516f00509dd62af41e9c85265ec6ddc07cf6e8d2b6dcc6
@@ -22,7 +22,7 @@ module KOSapiClient
22
22
  # Creates a new KOSapi client.
23
23
  #
24
24
  def initialize(config = Configuration.new)
25
- http_adapter = OAuth2HttpAdapter.new(config.credentials, config.base_url)
25
+ http_adapter = OAuth2HttpAdapter.new(config.credentials, config.base_url, config.to_h)
26
26
  @http_client = HTTPClient.new(http_adapter)
27
27
  end
28
28
 
@@ -1,5 +1,5 @@
1
1
  module KOSapiClient
2
- class Configuration < Struct.new(:client_id, :client_secret, :base_url)
2
+ class Configuration < Struct.new(:client_id, :client_secret, :base_url, :token_url, :auth_url, :connection_opts)
3
3
 
4
4
  DEFAULT_OPTIONS = {
5
5
  base_url: 'https://kosapi.fit.cvut.cz/api/3'
@@ -13,6 +13,7 @@ module KOSapiClient
13
13
  @credentials = credentials
14
14
  auth_url = opts[:auth_url] || DEFAULT_AUTH_URL
15
15
  token_url = opts[:token_url] || DEFAULT_TOKEN_URL
16
+ connection_opts = opts[:connection_opts] || {}
16
17
  MultiXml.parser = :ox # make sure to use Ox because of different namespace handling in other MultiXML parsers
17
18
  @client = OAuth2::Client.new(
18
19
  credentials[:client_id],
@@ -20,7 +21,8 @@ module KOSapiClient
20
21
  auth_scheme: :basic_auth,
21
22
  site: base_url,
22
23
  authorize_url: auth_url,
23
- token_url: token_url)
24
+ token_url: token_url,
25
+ connection_opts: connection_opts)
24
26
  end
25
27
 
26
28
  def send_request(verb, url, options = {})
@@ -1,3 +1,3 @@
1
1
  module KOSapiClient
2
- VERSION = '0.10.0'
2
+ VERSION = '0.11.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kosapi_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tibor Szolár
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-01 00:00:00.000000000 Z
11
+ date: 2019-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler