twingly-http 0.2.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/lib/twingly/http.rb +8 -2
- data/lib/twingly/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc5e134cf7d77a56bda5f8d4c40ef90f6c80c0230aea262cada8c943b4defa77
|
4
|
+
data.tar.gz: ad54778da0dddff2b0bb14e4205333758a43272cfd9d6458566fbb4fc48c9816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83b57d12d30e4a3f38c5e4b71d06d1ed894ab7ecca32495d9607bb2cf434e0f5bc1b1ffea0d4855b06e3e7791987c60ffe2d0e0c69be739bf0f5eabcb0ff4ed1
|
7
|
+
data.tar.gz: 138b97d64ed9b979c942eecd48728fd1427b26054b6c614ee19799e3046695dc7f1523c113f4f9efdb289fdfac092315f15e084e6ab3b2ad8fa723d091100ff1
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Twingly::HTTP
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![GitHub Build Status](https://github.com/twingly/twingly-http/workflows/CI/badge.svg?branch=master)](https://github.com/twingly/twingly-http/actions)
|
4
4
|
|
5
5
|
Robust HTTP client, tailored by Twingly.
|
6
6
|
|
@@ -32,10 +32,9 @@ client.get("http://example.org").status
|
|
32
32
|
|
33
33
|
## Tests
|
34
34
|
|
35
|
-
The tests require [Toxiproxy](https://github.com/Shopify/toxiproxy
|
35
|
+
The tests require [Toxiproxy](https://github.com/Shopify/toxiproxy)
|
36
36
|
|
37
|
-
|
38
|
-
brew install toxiproxy
|
37
|
+
docker-compose up
|
39
38
|
|
40
39
|
Run tests with
|
41
40
|
|
data/lib/twingly/http.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "logger"
|
3
4
|
require "net/http"
|
4
5
|
require "faraday"
|
5
6
|
require "faraday_middleware"
|
@@ -42,11 +43,12 @@ module Twingly
|
|
42
43
|
attr_writer :follow_redirects
|
43
44
|
|
44
45
|
attr_accessor :follow_redirects_limit
|
46
|
+
attr_accessor :logger
|
45
47
|
attr_accessor :retryable_exceptions
|
46
48
|
|
47
|
-
def initialize(
|
48
|
-
@logger = logger
|
49
|
+
def initialize(base_user_agent:, logger: default_logger)
|
49
50
|
@base_user_agent = base_user_agent
|
51
|
+
@logger = logger
|
50
52
|
|
51
53
|
initialize_defaults
|
52
54
|
end
|
@@ -61,6 +63,10 @@ module Twingly
|
|
61
63
|
|
62
64
|
private
|
63
65
|
|
66
|
+
def default_logger
|
67
|
+
Logger.new(File::NULL)
|
68
|
+
end
|
69
|
+
|
64
70
|
def initialize_defaults
|
65
71
|
@request_id = nil
|
66
72
|
@http_timeout = DEFAULT_HTTP_TIMEOUT
|
data/lib/twingly/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twingly-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twingly AB
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1'
|
20
|
+
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 1.0.1
|
20
23
|
type: :runtime
|
@@ -22,6 +25,9 @@ dependencies:
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1'
|
30
|
+
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 1.0.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
@@ -178,7 +184,7 @@ require_paths:
|
|
178
184
|
- lib
|
179
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
180
186
|
requirements:
|
181
|
-
- - "
|
187
|
+
- - ">="
|
182
188
|
- !ruby/object:Gem::Version
|
183
189
|
version: '2.5'
|
184
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -187,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
193
|
- !ruby/object:Gem::Version
|
188
194
|
version: '0'
|
189
195
|
requirements: []
|
190
|
-
rubygems_version: 3.1.
|
196
|
+
rubygems_version: 3.1.6
|
191
197
|
signing_key:
|
192
198
|
specification_version: 4
|
193
199
|
summary: Robust HTTP client
|