gdsapi-v2-ruby 0.2.2 → 0.2.3

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: e118da56996c9e2ac276a29f9b9348c5e5053083
4
- data.tar.gz: 826148f96d375a21c63fb550e4b642c78c0c0031
3
+ metadata.gz: cae480188deaaa003243b6dacf9b719a819e668c
4
+ data.tar.gz: a87ffec050f78ed2b8241dec03842e7d99e11859
5
5
  SHA512:
6
- metadata.gz: 8e5dabc6c685268ad1501e23f511191083f38fcdd90d6b12ef528819cf1c6ff143615a32793632eeb934c63a3120b7aeb925ceace61bec80e0a891fbddadae9b
7
- data.tar.gz: f4c70defb441ae4da52623d8116313934c03184dd2e28221b45135923d119fad91bd2140d104850c9ed51c811728b28cb536a074d23d5aee84b178cc548e0f41
6
+ metadata.gz: de98e9a94dc3f42d332f9d838504d81ab3776241fe7a79c28ba0ea9cca953c68be940269a8faa569e688c7c2dae059864494b88e50cf141618eac8b7c31724b7
7
+ data.tar.gz: 27231d52ddf39a939dabadb4eb0b403509a05ba31f21d4c30715405adcfcf331c7a15eefbe3ce5c0f078d897169a9cb6421f4cd69227728d5f12dc64be7eddd3
data/lib/gdsapi/client.rb CHANGED
@@ -23,8 +23,8 @@ module Gdsapi
23
23
  # @param driver - driver instance
24
24
  # @param login: & password: - HTTP basic auth factors
25
25
  # @param language: - language slug for which request will be performed (available are: en, ru, uk, pl, th)
26
- def with_requester(driver, login: nil, password: nil, language: nil)
27
- new(Requester.new(driver, login: login, password: password, language: language))
26
+ def with_requester(driver, login: nil, password: nil, language: nil, prefix: '/api/v2/')
27
+ new(Requester.new(driver, login: login, password: password, language: language, prefix: prefix))
28
28
  end
29
29
  end
30
30
 
@@ -7,6 +7,7 @@ module Gdsapi
7
7
  attr_reader :password
8
8
  attr_reader :driver
9
9
  attr_reader :language
10
+ attr_reader :prefix
10
11
 
11
12
  # @param [Faraday::Connection] driver - driver instance, i.e. object that responds to
12
13
  # #get(url, params, headers),
@@ -16,11 +17,12 @@ module Gdsapi
16
17
  # It is `strongly recommended` to use Faraday
17
18
  # @param login: & password: - HTTP basic auth factors
18
19
  # @param language: - language slug for which request will be performed
19
- def initialize(driver, login: '', password: '', language: 'ru')
20
+ def initialize(driver, login: '', password: '', language: 'ru', prefix: '')
20
21
  @driver = driver
21
- @login = login || ''
22
- @password = password || ''
23
- @language = language || 'ru'
22
+ @login = login
23
+ @password = password
24
+ @language = language
25
+ @prefix = prefix
24
26
  set_language
25
27
  set_basic_auth
26
28
  end
@@ -31,11 +33,11 @@ module Gdsapi
31
33
  end
32
34
 
33
35
  def get(url, params: {}, headers: {})
34
- driver.get url, params, headers
36
+ driver.get prefix + url, params, headers
35
37
  end
36
38
 
37
39
  def post(url, body: {}, headers: {})
38
- driver.post url, body, headers
40
+ driver.post prefix + url, body, headers
39
41
  end
40
42
 
41
43
  private
@@ -1,3 +1,3 @@
1
1
  module Gdsapi
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gdsapi-v2-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Yurchenkov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-25 00:00:00.000000000 Z
11
+ date: 2018-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json