bitzlato 0.1.6 → 0.1.7

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: 2c5615a8307850e0657588e3e5fe2fec0c2512933b8ba15ae86461d3311fcbe7
4
- data.tar.gz: f9fac4b86cc4ecb7f42fb2f4efc649c27b6d686614cac3e438384fc9adf7cfac
3
+ metadata.gz: 707a2f72f5adaeb757672ac13814f34f3267f2ae3684c4ec4b7c020d9b89d401
4
+ data.tar.gz: 12068b06536e13d3e3879e7e54e20207e922e4837c5b139243f44e650020604f
5
5
  SHA512:
6
- metadata.gz: 007dccd9fb93d607ca4bdee887f2c4486a5867503b995ef848567427c4f14cd2af139390b5f8c8a6ec34cd5272ffebda17ff8e9311328c8d1de2a0245ee0219b
7
- data.tar.gz: f478a7bc31f8e1010f99c938c9cdd96de4d6bfcb5eebd936ea7166e9ee13b4fa41038b49e458841e6bb72002d64c486daeede97e12d6dfa18994bf33644d9664
6
+ metadata.gz: e7d97b43bfd1a6b155fbd2fa987aeb5d391c2a4217d6b0e6f8428639346adcedc9d207385faa3db32b8d49822bfb8b0700ef618701e9709ba1ed82f6f169176c
7
+ data.tar.gz: b4e46dc07bb667a69977a196833fc0619d7e904354948c8693bb797ad56d757d5e6194dfd5c823ba2aa147df1039215d7c0f8e0747055888924ea3a2520b826b
@@ -35,7 +35,8 @@ module Bitzlato
35
35
 
36
36
  def parse_response(response)
37
37
  raise WrongResponse, "Wrong response status (#{response.status})" unless response.success?
38
- raise WrongResponse, "Wrong content type (#{response['content-type']})" if !response.body.empty? && response['content-type'] != 'application/json'
38
+ return nil if response.body.emtpy?
39
+ raise WrongResponse, "Wrong content type (#{response['content-type']})" if response['content-type'] != 'application/json'
39
40
  JSON.parse response.body
40
41
  end
41
42
 
@@ -50,14 +51,15 @@ module Bitzlato
50
51
  }
51
52
  end
52
53
 
54
+ # Every time build new connection to have fresh jwt token
53
55
  def connection
54
- @connection ||= Faraday.new url: @home_url do |c|
56
+ Faraday.new url: @home_url do |c|
55
57
  c.use Faraday::Response::Logger unless @logger.nil?
56
58
  c.headers = {
57
59
  'Content-Type' => 'application/json',
58
60
  'Accept' => 'application/json'
59
61
  }
60
- c.request :curl, logger, :warn if ENV['BITZLATO_CURL_LOGGER']
62
+ c.request :curl, @logger, :warn if ENV['BITZLATO_CURL_LOGGER']
61
63
  c.authorization :Bearer, bearer
62
64
  c.adapter @adapter
63
65
  end
@@ -1,3 +1,3 @@
1
1
  module Bitzlato
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitzlato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danil Pismenny