chimera_http_client 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/action-ci.yml +21 -0
- data/README.markdown +34 -27
- data/lib/chimera_http_client/error.rb +4 -0
- data/lib/chimera_http_client/response.rb +4 -0
- data/lib/chimera_http_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da90ccc4dfdbaf080bf84581cebbf3344e85793653605ecf49075a524c4ecef2
|
4
|
+
data.tar.gz: 5b93585a12aad3e8c927853e44dd0bc9b22b61f606edd7d3627a89ec91879cc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 805969007906d493de7b720747c7235345ad12022711f616557944053b7b57310ff587a3f381d081a68f9d63525a176f85dc1a67dc5002b5a4c01a939dea0ceb
|
7
|
+
data.tar.gz: ffc28a398833e72ae2e760826e418dff7a7d5221e61443974c3bff4277ada7f2c9c1e71e7b1b7da3b20fc1251ccabd4d15c1f646061c74c03fcb45bfd63105a4
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: rubies-ci
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
os: [ubuntu-latest] # macos-latest
|
9
|
+
ruby: ['2.5', '2.6', '2.7', '3.0'] # Due to https://github.com/actions/runner/issues/849, we have to use quotes
|
10
|
+
|
11
|
+
runs-on: ${{ matrix.os }}
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby }}
|
18
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
19
|
+
|
20
|
+
- name: Run linters and test suite
|
21
|
+
run: bundle exec rake ci
|
data/README.markdown
CHANGED
@@ -6,7 +6,8 @@ And what works for the internal communication between your own apps, will also w
|
|
6
6
|
|
7
7
|
It offers an **easy to learn interface** and **nice error handling**. And it enables you to **queue HTTP requests to run them in parallel** for better performance and simple aggregating of distributed data.
|
8
8
|
|
9
|
-
[![Build Status](https://
|
9
|
+
[![GitHub Actions CI Build Status](https://github.com/mediafinger/chimera_http_client/actions/workflows/action-ci.yml/badge.svg?branch=master)](https://github.com/mediafinger/chimera_http_client/actions/workflows/action-ci.yml)
|
10
|
+
[![Travis-CI Build Status](https://travis-ci.com/mediafinger/chimera_http_client.svg?branch=master)](https://travis-ci.com/mediafinger/chimera_http_client)
|
10
11
|
[![Gem Version](https://badge.fury.io/rb/chimera_http_client.svg)](https://badge.fury.io/rb/chimera_http_client)
|
11
12
|
|
12
13
|
## Dependencies
|
@@ -34,32 +35,36 @@ Setting the environment variable `ENV['CHIMERA_HTTP_CLIENT_LOG_REQUESTS']` to `t
|
|
34
35
|
|
35
36
|
<!-- TOC depthFrom:1 depthTo:4 withLinks:1 updateOnSave:0 orderedList:0 -->
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
38
|
+
* [ChimeraHttpClient](#chimerahttpclient)
|
39
|
+
* [Dependencies](#dependencies)
|
40
|
+
* [Ruby version](#ruby-version)
|
41
|
+
* [ENV variables](#env-variables)
|
42
|
+
* [Table of Contents](#table-of-contents)
|
43
|
+
* [The Connection class](#the-connection-class)
|
44
|
+
* [Initialization](#initialization)
|
45
|
+
* [Mandatory initialization parameter `base_url`](#mandatory-initialization-parameter-base_url)
|
46
|
+
* [Optional initialization parameters](#optional-initialization-parameters)
|
47
|
+
* [Custom deserializers](#custom-deserializers)
|
48
|
+
* [Monitoring, metrics, instrumentation](#monitoring-metrics-instrumentation)
|
49
|
+
* [Request methods](#request-methods)
|
50
|
+
* [Mandatory request parameter `endpoint`](#mandatory-request-parameter-endpoint)
|
51
|
+
* [Optional request parameters](#optional-request-parameters)
|
52
|
+
* [Basic auth](#basic-auth)
|
53
|
+
* [Timeout duration](#timeout-duration)
|
54
|
+
* [Custom logger](#custom-logger)
|
55
|
+
* [Caching responses](#caching-responses)
|
56
|
+
* [Example usage](#example-usage)
|
57
|
+
* [The Request class](#the-request-class)
|
58
|
+
* [The Response class](#the-response-class)
|
59
|
+
* [Error classes](#error-classes)
|
60
|
+
* [The Queue class](#the-queue-class)
|
61
|
+
* [Queueing requests](#queueing-requests)
|
62
|
+
* [Executing requests in parallel](#executing-requests-in-parallel)
|
63
|
+
* [Empty the queue](#empty-the-queue)
|
64
|
+
* [Installation](#installation)
|
65
|
+
* [Maintainers and Contributors](#maintainers-and-contributors)
|
66
|
+
* [Roadmap](#roadmap)
|
67
|
+
* [Chimera](#chimera)
|
63
68
|
|
64
69
|
<!-- /TOC -->
|
65
70
|
|
@@ -324,6 +329,7 @@ The `ChimeraHttpClient::Response` objects have the following interface:
|
|
324
329
|
* code (http code, should be 200 or 2xx)
|
325
330
|
* time (for monitoring)
|
326
331
|
* response (the full response object, including the request)
|
332
|
+
* success? (returns the result of response.success?)
|
327
333
|
* error? (returns false)
|
328
334
|
* parsed_body (returns the result of `deserializer[:response].call(body)`)
|
329
335
|
|
@@ -337,6 +343,7 @@ All errors inherit from `ChimeraHttpClient::Error` and therefore offer the same
|
|
337
343
|
* body (alias => message)
|
338
344
|
* time (for monitoring)
|
339
345
|
* response (the full response object, including the request)
|
346
|
+
* success? (returns the result of response.success?)
|
340
347
|
* error? (returns true)
|
341
348
|
* error_class (e.g. ChimeraHttpClient::NotFoundError)
|
342
349
|
* to_s (information for logging / respects ENV['CHIMERA_HTTP_CLIENT_LOG_REQUESTS'])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chimera_http_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Finger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -260,6 +260,7 @@ executables: []
|
|
260
260
|
extensions: []
|
261
261
|
extra_rdoc_files: []
|
262
262
|
files:
|
263
|
+
- ".github/workflows/action-ci.yml"
|
263
264
|
- ".gitignore"
|
264
265
|
- ".rspec"
|
265
266
|
- ".rubocop.yml"
|