minato-utils 0.2.1 → 0.2.2

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: 6bc10d814c0e9102aad2fc41b3f36ee3bf42e8e62221e855967c1e7839a98e80
4
- data.tar.gz: 0b1c1fbf289d59ff9db246f838c2ad46c625cd5990429af7e06ce4926aaf4db3
3
+ metadata.gz: 792df7e33288c44df36a7c1d2bb4e691722fe28a9c64ed47d0b15f9a71e0645a
4
+ data.tar.gz: 2a8cc6e71f33794d05505d84d6d41119d7864c0da3d9b86453932b0bffd41371
5
5
  SHA512:
6
- metadata.gz: 007ea958aecc24ddcf66c158100368763001981a5aa19e529f646e62f020fe17a12778e0587e3422d3690719868d23dca0ba91556ec31965c9b48ab75f9cbcec
7
- data.tar.gz: 55b48408b7cfa0d53ee20679edc8050f63bcefe13428e092e772b33f100ae890832e07de1dbca7b68761434b75eda50d23eb2a08e2cc145ce46663d32c2746a7
6
+ metadata.gz: 196afd23819111e3da67bd1d584e5ff0c53efc21314417b0e61962355b19b662af4e9c698ebfaf130db6b42dccdb7c177268bafe7dfa56501f729e6c6e0356b6
7
+ data.tar.gz: 55ae22fdcda8590156fb64c86c29b62d721f9e696a96e82891ff5c905c0cedd8860d5c0fa4802e8294754c909f6cdd4702ef50078b00995b3f7af68288f1b9f8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minato-utils (0.2.0)
4
+ minato-utils (0.2.2)
5
5
  activesupport (~> 6.0)
6
6
  httparty (~> 0.18)
7
7
 
@@ -37,7 +37,6 @@ module Minato
37
37
  private
38
38
 
39
39
  def request(method, path, options)
40
- return_headers = options.delete(:return_headers)
41
40
  request_options = @default_options.deep_merge(options)
42
41
  url = Minato::Utils::Helpers.join_url(@base_uri, path)
43
42
 
@@ -45,7 +44,7 @@ module Minato
45
44
  response = self.class.send(method, url, request_options)
46
45
 
47
46
  Minato::Utils.logger.log_response(method, @base_uri, path, request_options, response)
48
- Minato::Utils::ResponseHandler.handle(response, return_headers)
47
+ Minato::Utils::ResponseHandler.handle(response)
49
48
  end
50
49
  end
51
50
  end
@@ -7,14 +7,12 @@ module Minato
7
7
  module Utils
8
8
  class ResponseHandler
9
9
  class << self
10
- def handle(response, return_headers)
10
+ def handle(response)
11
11
  raise_exception(response) if response_error?(response)
12
12
 
13
- if return_headers
14
- { body: Minato::Utils::Helpers.parse_json(response.body), header: response.header }
15
- else
16
- Minato::Utils::Helpers.parse_json(response.body)
17
- end
13
+ body = Minato::Utils::Helpers.parse_json(response.body)
14
+ header = response.header.to_hash || {}
15
+ { body: body, header: header }
18
16
  end
19
17
 
20
18
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Minato
4
4
  module Utils
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
  end
7
7
  end
data/release-notes.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Release Notes
2
2
 
3
+ ## v0.2.2 - January 4th, 2022
4
+
5
+ ### Compatibility Notes
6
+
7
+ - `return_headers` was removed from method `Minato::Utils::Client#request`<br/>
8
+ This renders `return_headers` as a hash key to `options` variable worthless, so
9
+ from now on you can assume that all requests will return a header regardless if
10
+ it's useful for the current invocation or not.
11
+
3
12
  ## v0.2.0 - December 20th, 2021
4
13
 
5
14
  ### Compatibility Notes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minato-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ferreri
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-29 00:00:00.000000000 Z
11
+ date: 2022-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport