nxt_http_client 0.1.8 → 0.1.9

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: 5bdc0b6838780fe319613c5269ea5c0077cbc3ba621b69203d0902c15943c27f
4
- data.tar.gz: 02fb6a39d21c5aa8661ddc591eee8324bf044898143f133b6f0478751a1726c0
3
+ metadata.gz: fe54eb2ecb7b7c7025699424d538ab43c730dd93728557b427551317e6c60363
4
+ data.tar.gz: 703d8d45fe804609d39ded9806ecc6c0771a3dba9cb3414df890ffed6589bcca
5
5
  SHA512:
6
- metadata.gz: f157b49c5dc97c40650235d8828fb2f1e5d7917b65f3a42ca8ab6a517b621c6a89e747143ce782d50ecef8bb7f7c2bf1726f0daee7d78b321988758748a61d5b
7
- data.tar.gz: 52086988a87eda709d21fa1114388411ee26e1d019366647199b039362073ff771c86064be3bc268bbce8edf9aab1dce7ad3e6aa78eed5c9ac76cdea6b9cb173
6
+ metadata.gz: 68dbda40d531999f1f9fde9bfa17726ec6801f6f6d50db4a365dfc4586a1bdae3006d98c792a7f3fa58bc20144484a4044cd0e854b9a30ea4b98059bfb59bc82
7
+ data.tar.gz: a66fbc5a9aba10fbb4fbcf90d384e6bfd6bb5ca591bb7e8e8507670453167c84bee06390e69223bf6948b4c1251ecc5285db2ef298f121b41d90f5fc7504f40f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nxt_http_client (0.1.8)
4
+ nxt_http_client (0.1.9)
5
5
  activesupport (~> 5.2)
6
6
  typhoeus
7
7
 
data/README.md CHANGED
@@ -26,14 +26,14 @@ Or install it yourself as:
26
26
  ```ruby
27
27
  class MyClient < NxtHttpClient
28
28
 
29
- register_defaults do |defaults|
30
- defaults.base_url = 'www.example.com'
31
- defaults.request_options = {
29
+ configure do |config|
30
+ config.base_url = 'www.example.com'
31
+ config.request_options = {
32
32
  headers: { API_KEY: '1993' },
33
33
  method: :get,
34
34
  followlocation: true
35
35
  }
36
- defaults.x_request_id_proc = -> { ('a'..'z').to_a.shuffle.take(10).join } # defaults to -> { SecureRandom.uuid }
36
+ config.x_request_id_proc = -> { ('a'..'z').to_a.shuffle.take(10).join } # config to -> { SecureRandom.uuid }
37
37
  end
38
38
 
39
39
  register_response_handler do |handler|
@@ -72,7 +72,7 @@ class MyClient < NxtHttpClient
72
72
  end
73
73
  ```
74
74
 
75
- ### register_defaults
75
+ ### configure
76
76
 
77
77
  Register default request options on the class level. Available options are `request_options` that are passed directly to
78
78
  the underlying Typhoeus Request. Then there is `base_url` and `x_request_id_proc`.
@@ -1,6 +1,6 @@
1
1
  module NxtHttpClient
2
2
  module ClientDsl
3
- def register_defaults(opts = {}, &block)
3
+ def configure(opts = {}, &block)
4
4
  @default_config ||= DefaultConfig.new(**opts)
5
5
  @default_config.tap { |d| block.call(d) }
6
6
  @default_config
@@ -1,3 +1,3 @@
1
1
  module NxtHttpClient
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nxt_http_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Robecke