elastic-transport 8.0.1 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +45 -4
- data/.gitignore +1 -1
- data/CHANGELOG.md +27 -0
- data/Gemfile +4 -8
- data/Gemfile-faraday1.gemfile +39 -0
- data/README.md +22 -8
- data/Rakefile +39 -1
- data/elastic-transport.gemspec +4 -7
- data/lib/elastic/transport/client.rb +12 -10
- data/lib/elastic/transport/meta_header.rb +8 -8
- data/lib/elastic/transport/transport/http/curb.rb +28 -25
- data/lib/elastic/transport/version.rb +1 -1
- data/spec/elastic/transport/base_spec.rb +4 -2
- data/spec/elastic/transport/client_spec.rb +12 -5
- data/spec/elastic/transport/meta_header_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -0
- data/test/integration/jruby_test.rb +1 -1
- data/test/integration/transport_test.rb +86 -40
- data/test/test_helper.rb +9 -5
- data/test/unit/adapters_test.rb +88 -0
- data/test/unit/transport_curb_test.rb +2 -3
- metadata +16 -69
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 388aaaffda8babdfb8466e6aef816ed63bc520b56c7cb4f09964a23a1ab73854
|
4
|
+
data.tar.gz: 2bdc179dba8822d690bc1a1b41b9766996f5a39cf8d8b8d7fa1bc03662cdcc97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f117b13be213d5b85a17b1df2ecbafcc14fa566f7beda6bd39be8e26b4e5611f80b1d1bd5f3e0f9e35c726721f70e05c479ae112f9e2da97d2d21ff3af676a
|
7
|
+
data.tar.gz: 9b6d8a1fcc73da9676a309b11860640d6194bed392b1cdd91b4ef8b0ba407de11a8500f542efa588aa3f0a03c31dbef9e374f380c018fe297527ee486540a8b0
|
data/.github/workflows/tests.yml
CHANGED
@@ -7,14 +7,16 @@ on:
|
|
7
7
|
branches:
|
8
8
|
- main
|
9
9
|
jobs:
|
10
|
-
test
|
10
|
+
test:
|
11
|
+
name: 'Main tests'
|
11
12
|
env:
|
12
13
|
TEST_ES_SERVER: http://localhost:9250
|
13
14
|
PORT: 9250
|
14
15
|
strategy:
|
15
16
|
fail-fast: false
|
16
17
|
matrix:
|
17
|
-
ruby: [ '2.
|
18
|
+
ruby: [ '2.7', '3.0', '3.1', 'jruby-9.3' ]
|
19
|
+
es_version: ['8.2-SNAPSHOT', '8.3-SNAPSHOT', '8.4-SNAPSHOT']
|
18
20
|
runs-on: ubuntu-latest
|
19
21
|
steps:
|
20
22
|
- uses: actions/checkout@v2
|
@@ -26,7 +28,8 @@ jobs:
|
|
26
28
|
sudo sysctl -w vm.max_map_count=262144
|
27
29
|
- uses: elastic/elastic-github-actions/elasticsearch@master
|
28
30
|
with:
|
29
|
-
stack-version:
|
31
|
+
stack-version: ${{ matrix.es_version }}
|
32
|
+
security-enabled: false
|
30
33
|
- uses: ruby/setup-ruby@v1
|
31
34
|
with:
|
32
35
|
ruby-version: ${{ matrix.ruby }}
|
@@ -42,4 +45,42 @@ jobs:
|
|
42
45
|
run: bundle exec rake test:spec
|
43
46
|
- name: integration tests
|
44
47
|
run: bundle exec rake test:integration
|
45
|
-
|
48
|
+
test-faraday1:
|
49
|
+
name: 'Test Faraday 1'
|
50
|
+
env:
|
51
|
+
TEST_ES_SERVER: http://localhost:9250
|
52
|
+
PORT: 9250
|
53
|
+
strategy:
|
54
|
+
fail-fast: false
|
55
|
+
matrix:
|
56
|
+
ruby: [ '2.7', '3.0', '3.1', 'jruby-9.3' ]
|
57
|
+
es_version: ['8.3.0-SNAPSHOT']
|
58
|
+
runs-on: ubuntu-latest
|
59
|
+
steps:
|
60
|
+
- uses: actions/checkout@v2
|
61
|
+
- name: Increase system limits
|
62
|
+
run: |
|
63
|
+
sudo swapoff -a
|
64
|
+
sudo sysctl -w vm.swappiness=1
|
65
|
+
sudo sysctl -w fs.file-max=262144
|
66
|
+
sudo sysctl -w vm.max_map_count=262144
|
67
|
+
- uses: elastic/elastic-github-actions/elasticsearch@master
|
68
|
+
with:
|
69
|
+
stack-version: ${{ matrix.es_version }}
|
70
|
+
security-enabled: false
|
71
|
+
- uses: ruby/setup-ruby@v1
|
72
|
+
with:
|
73
|
+
ruby-version: ${{ matrix.ruby }}
|
74
|
+
- name: Build and test with Rake
|
75
|
+
run: |
|
76
|
+
sudo apt-get update
|
77
|
+
sudo apt-get install libcurl4-openssl-dev
|
78
|
+
ruby -v
|
79
|
+
gem install bundler
|
80
|
+
BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle install
|
81
|
+
- name: faraday1 unit tests
|
82
|
+
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:unit
|
83
|
+
- name: specs
|
84
|
+
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:spec
|
85
|
+
- name: integration tests
|
86
|
+
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:integration
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,30 @@
|
|
1
|
+
## 8.1.0
|
2
|
+
|
3
|
+
Adds support for Faraday version 2. From [Faraday's Upgrading guide](https://github.com/lostisland/faraday/blob/main/UPGRADING.md#faraday-20), the main change is the adapters have moved:
|
4
|
+
|
5
|
+
> With this release, we've officially moved all adapters, except for the net_http one, out of Faraday. What that means, is that they won't be available out-of-the-box anymore, and you'll instead need to add them to your Gemfile.
|
6
|
+
> If you just use the default net_http adapter, then you don't need to do anything!
|
7
|
+
> Otherwise, add the corresponding adapter gem to your Gemfile (e.g. faraday-net_http_persistent). Then, simply require them after you require faraday.
|
8
|
+
|
9
|
+
We're now supporting Faraday v2 and Faraday v1. The adapters were removed as development dependency in the gemspec and added to the Gemfile. A new file `Gemfile-faraday1.gemfile` was added to run tests with version `1.x` of Faraday too.
|
10
|
+
|
11
|
+
These are the gems required for the different adapters with Faraday 2, instead of the libraries on which they were based:
|
12
|
+
```
|
13
|
+
# HTTPCLient
|
14
|
+
'faraday-httpclient'
|
15
|
+
|
16
|
+
# NetHTTPPersistent
|
17
|
+
'faraday-net_http_persistent'
|
18
|
+
|
19
|
+
# Patron
|
20
|
+
'faraday-patron'
|
21
|
+
|
22
|
+
# Typhoeus
|
23
|
+
'faraday-typhoeus'
|
24
|
+
```
|
25
|
+
|
26
|
+
If you're using Faraday 1, you shouldn't have to change anything, but please [submit an issue](https://github.com/elastic/elastic-transport-ruby/issues) if you encounter any issues.
|
27
|
+
|
1
28
|
## 8.0.1
|
2
29
|
|
3
30
|
- Minor code cleanup
|
data/Gemfile
CHANGED
@@ -20,15 +20,11 @@ source 'https://rubygems.org'
|
|
20
20
|
# Specify your gem's dependencies in elasticsearch-transport.gemspec
|
21
21
|
gemspec
|
22
22
|
|
23
|
-
if File.exist? File.expand_path('../elasticsearch-api/elasticsearch-api.gemspec', __dir__)
|
24
|
-
gem 'elasticsearch-api', path: File.expand_path('../elasticsearch-api', __dir__), require: false
|
25
|
-
end
|
26
|
-
|
27
|
-
if File.exist? File.expand_path('../elasticsearch/elasticsearch.gemspec', __dir__)
|
28
|
-
gem 'elasticsearch', path: File.expand_path('../elasticsearch', __dir__), require: false
|
29
|
-
end
|
30
|
-
|
31
23
|
group :development, :test do
|
24
|
+
gem 'faraday-httpclient'
|
25
|
+
gem 'faraday-net_http_persistent'
|
26
|
+
gem 'faraday-patron' unless defined? JRUBY_VERSION
|
27
|
+
gem 'faraday-typhoeus'
|
32
28
|
gem 'rspec'
|
33
29
|
if defined?(JRUBY_VERSION)
|
34
30
|
gem 'pry-nav'
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
source 'https://rubygems.org'
|
19
|
+
|
20
|
+
# Usage:
|
21
|
+
#
|
22
|
+
# $ BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle install
|
23
|
+
# $ BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:unit
|
24
|
+
|
25
|
+
gem 'faraday', '~> 1'
|
26
|
+
gemspec path: './'
|
27
|
+
|
28
|
+
group :development, :test do
|
29
|
+
gem 'httpclient'
|
30
|
+
gem 'net-http-persistent'
|
31
|
+
gem 'patron' unless defined? JRUBY_VERSION
|
32
|
+
gem 'rspec'
|
33
|
+
gem 'typhoeus'
|
34
|
+
if defined?(JRUBY_VERSION)
|
35
|
+
gem 'pry-nav'
|
36
|
+
else
|
37
|
+
gem 'pry-byebug'
|
38
|
+
end
|
39
|
+
end
|
data/README.md
CHANGED
@@ -42,10 +42,12 @@ Features overview:
|
|
42
42
|
* Request retries and dead connections handling
|
43
43
|
* Node reloading (based on cluster state) on errors or on demand
|
44
44
|
|
45
|
+
This library uses [Faraday](https://github.com/lostisland/faraday) by default as the HTTP transport implementation. We test it it with Faraday versions 1.x and Faraday 2.x.
|
46
|
+
|
45
47
|
For optimal performance, use a HTTP library which supports persistent ("keep-alive") connections, such as [patron](https://github.com/toland/patron) or [Typhoeus](https://github.com/typhoeus/typhoeus).
|
46
|
-
|
48
|
+
Require the library (`require 'patron'`) in your code for Faraday 1.x or the adapter (`require 'faraday/patron'`) for Faraday 2.x, and it will be automatically used.
|
47
49
|
|
48
|
-
Currently these libraries
|
50
|
+
Currently these libraries are supported:
|
49
51
|
- [Patron](https://github.com/toland/patron)
|
50
52
|
- [Typhoeus](https://github.com/typhoeus/typhoeus)
|
51
53
|
- [HTTPClient](https://rubygems.org/gems/httpclient)
|
@@ -53,12 +55,11 @@ Currently these libraries will be automatically detected and used:
|
|
53
55
|
|
54
56
|
**Note on [Typhoeus](https://github.com/typhoeus/typhoeus)**: You need to use v1.4.0 or up since older versions are not compatible with Faraday 1.0.
|
55
57
|
|
56
|
-
For detailed information, see example configurations [below](#transport-implementations).
|
58
|
+
You can customize Faraday and implement your own HTTP transport. For detailed information, see the example configurations and more information [below](#transport-implementations).
|
57
59
|
|
58
60
|
## Example Usage
|
59
61
|
|
60
|
-
In the simplest form, connect to Elasticsearch running on <http://localhost:9200>
|
61
|
-
without any configuration:
|
62
|
+
In the simplest form, connect to Elasticsearch running on <http://localhost:9200> without any configuration:
|
62
63
|
|
63
64
|
```ruby
|
64
65
|
require 'elastic/transport'
|
@@ -346,14 +347,23 @@ Elastic::Transport::Client.new hosts: ['x1.search.org', 'x2.search.org'], select
|
|
346
347
|
|
347
348
|
By default, the client will use the [_Faraday_](https://rubygems.org/gems/faraday) HTTP library as a transport implementation.
|
348
349
|
|
349
|
-
It will auto-detect and use an _adapter_ for _Faraday_ based on gems loaded in your code, preferring HTTP clients with support for persistent connections.
|
350
|
-
|
351
|
-
To use the [_Patron_](https://github.com/toland/patron) HTTP, for example, just require it:
|
350
|
+
It will auto-detect and use an _adapter_ for _Faraday_ based on gems loaded in your code, preferring HTTP clients with support for persistent connections. Faraday 2 changed the way adapters are used ([read more here](https://github.com/lostisland/faraday/blob/main/UPGRADING.md#adapters-have-moved)). If you're using Faraday 1.x, you can require the HTTP library. To use the [_Patron_](https://github.com/toland/patron) HTTP, for example, require it:
|
352
351
|
|
353
352
|
```ruby
|
354
353
|
require 'patron'
|
355
354
|
```
|
356
355
|
|
356
|
+
If you're using Faraday 2.x, you need to add the corresponding adapter gem to your Gemfile and require them after you require `faraday`:
|
357
|
+
|
358
|
+
```ruby
|
359
|
+
# Gemfile
|
360
|
+
gem 'faraday-patron'
|
361
|
+
|
362
|
+
# Code
|
363
|
+
require 'faraday'
|
364
|
+
require 'faraday/patron'
|
365
|
+
```
|
366
|
+
|
357
367
|
Then, create a new client, and the _Patron_ gem will be used as the "driver":
|
358
368
|
|
359
369
|
```ruby
|
@@ -377,6 +387,10 @@ end
|
|
377
387
|
To use a specific adapter for _Faraday_, pass it as the `adapter` argument:
|
378
388
|
|
379
389
|
```ruby
|
390
|
+
# Gemfile
|
391
|
+
gem 'faraday-net_http_persistent'
|
392
|
+
|
393
|
+
# Code
|
380
394
|
client = Elastic::Transport::Client.new(adapter: :net_http_persistent)
|
381
395
|
|
382
396
|
client.transport.connections.first.connection.builder.handlers
|
data/Rakefile
CHANGED
@@ -18,13 +18,22 @@
|
|
18
18
|
require 'bundler/gem_tasks'
|
19
19
|
require 'mkmf'
|
20
20
|
|
21
|
-
desc
|
21
|
+
desc 'Run unit tests'
|
22
22
|
task default: 'test:unit'
|
23
23
|
task test: 'test:unit'
|
24
24
|
|
25
25
|
# ----- Test tasks ------------------------------------------------------------
|
26
26
|
require 'rake/testtask'
|
27
27
|
require 'rspec/core/rake_task'
|
28
|
+
FARADAY1_GEMFILE = 'Gemfile-faraday1.gemfile'.freeze
|
29
|
+
GEMFILES = ['Gemfile', FARADAY1_GEMFILE].freeze
|
30
|
+
|
31
|
+
task :install do
|
32
|
+
GEMFILES.each do |gemfile|
|
33
|
+
gemfile = File.expand_path("../#{gemfile}", __FILE__)
|
34
|
+
sh "bundle install --gemfile #{gemfile}"
|
35
|
+
end
|
36
|
+
end
|
28
37
|
|
29
38
|
namespace :test do
|
30
39
|
RSpec::Core::RakeTask.new(:spec)
|
@@ -46,6 +55,7 @@ namespace :test do
|
|
46
55
|
desc 'Run all tests'
|
47
56
|
task :all do
|
48
57
|
Rake::Task['test:unit'].invoke
|
58
|
+
Rake::Task['test:spec'].invoke
|
49
59
|
Rake::Task['test:integration'].invoke
|
50
60
|
end
|
51
61
|
|
@@ -53,6 +63,34 @@ namespace :test do
|
|
53
63
|
test.libs << 'lib' << 'test'
|
54
64
|
test.test_files = FileList['test/profile/**/*_test.rb']
|
55
65
|
end
|
66
|
+
|
67
|
+
namespace :faraday1 do
|
68
|
+
desc 'Faraday 1: Run RSpec with dependency on Faraday 1'
|
69
|
+
task :spec do
|
70
|
+
sh "BUNDLE_GEMFILE=#{FARADAY1_GEMFILE} bundle exec rspec"
|
71
|
+
end
|
72
|
+
|
73
|
+
desc 'Faraday 1: Run unit tests with dependency on Faraday 1'
|
74
|
+
task :unit do
|
75
|
+
Dir.glob('./test/unit/**/**.rb').each do |test|
|
76
|
+
sh "BUNDLE_GEMFILE=#{FARADAY1_GEMFILE} ruby -Ilib:test #{test}"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
desc 'Faraday 1: Run integration tests with dependency on Faraday 1'
|
81
|
+
task :integration do
|
82
|
+
Dir.glob('./test/integration/**/**.rb').each do |test|
|
83
|
+
sh "BUNDLE_GEMFILE=#{FARADAY1_GEMFILE} ruby -Ilib:test #{test}"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
desc 'Faraday 1: Run all tests'
|
88
|
+
task :all do
|
89
|
+
Rake::Task['test:faraday1:unit'].invoke
|
90
|
+
Rake::Task['test:faraday1:spec'].invoke
|
91
|
+
Rake::Task['test:faraday1:integration'].invoke
|
92
|
+
end
|
93
|
+
end
|
56
94
|
end
|
57
95
|
|
58
96
|
namespace :docker do
|
data/elastic-transport.gemspec
CHANGED
@@ -44,20 +44,18 @@ Gem::Specification.new do |s|
|
|
44
44
|
|
45
45
|
s.required_ruby_version = '>= 2.5'
|
46
46
|
|
47
|
+
s.add_dependency 'faraday', '< 3'
|
47
48
|
s.add_dependency 'multi_json'
|
48
|
-
s.add_dependency 'faraday', '~> 1'
|
49
49
|
|
50
|
+
# Faraday Adapters
|
51
|
+
s.add_development_dependency 'manticore' if defined? JRUBY_VERSION
|
52
|
+
s.add_development_dependency 'curb' unless defined? JRUBY_VERSION
|
50
53
|
s.add_development_dependency 'bundler'
|
51
54
|
s.add_development_dependency 'cane'
|
52
|
-
s.add_development_dependency 'curb' unless defined? JRUBY_VERSION
|
53
55
|
s.add_development_dependency 'hashie'
|
54
|
-
s.add_development_dependency 'httpclient'
|
55
|
-
s.add_development_dependency 'manticore' if defined? JRUBY_VERSION
|
56
56
|
s.add_development_dependency 'minitest'
|
57
57
|
s.add_development_dependency 'minitest-reporters'
|
58
58
|
s.add_development_dependency 'mocha'
|
59
|
-
s.add_development_dependency 'net-http-persistent'
|
60
|
-
s.add_development_dependency 'patron' unless defined? JRUBY_VERSION
|
61
59
|
s.add_development_dependency 'pry'
|
62
60
|
s.add_development_dependency 'rake', '~> 13'
|
63
61
|
s.add_development_dependency 'require-prof' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
|
@@ -65,7 +63,6 @@ Gem::Specification.new do |s|
|
|
65
63
|
s.add_development_dependency 'shoulda-context'
|
66
64
|
s.add_development_dependency 'simplecov'
|
67
65
|
s.add_development_dependency 'test-unit', '~> 2'
|
68
|
-
s.add_development_dependency 'typhoeus', '~> 1.4'
|
69
66
|
s.add_development_dependency 'yard'
|
70
67
|
|
71
68
|
s.description = <<-DESC.gsub(/^ /, '')
|
@@ -283,24 +283,26 @@ module Elastic
|
|
283
283
|
# Auto-detect the best adapter (HTTP "driver") available, based on libraries
|
284
284
|
# loaded by the user, preferring those with persistent connections
|
285
285
|
# ("keep-alive") by default
|
286
|
+
# Check adapters based on the usage of Faraday 1 or 2. Faraday should be defined here
|
287
|
+
# since this is only called when transport class is Transport::HTTP::Faraday
|
286
288
|
#
|
287
289
|
# @return [Symbol]
|
288
290
|
#
|
289
291
|
# @api private
|
290
292
|
#
|
291
293
|
def __auto_detect_adapter
|
292
|
-
|
293
|
-
|
294
|
-
:
|
295
|
-
|
296
|
-
:
|
297
|
-
when defined?(::HTTPClient)
|
298
|
-
:httpclient
|
299
|
-
when defined?(::Net::HTTP::Persistent)
|
300
|
-
:net_http_persistent
|
294
|
+
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new(2)
|
295
|
+
return :patron if defined?(Faraday::Adapter::Patron)
|
296
|
+
return :typhoeus if defined?(Faraday::Adapter::Typhoeus)
|
297
|
+
return :httpclient if defined?(Faraday::Adapter::HTTPClient)
|
298
|
+
return :net_http_persistent if defined?(Faraday::Adapter::NetHttpPersistent)
|
301
299
|
else
|
302
|
-
::
|
300
|
+
return :patron if defined?(::Patron)
|
301
|
+
return :typhoeus if defined?(::Typhoeus)
|
302
|
+
return :httpclient if defined?(::HTTPClient)
|
303
|
+
return :net_http_persistent if defined?(::Net::HTTP::Persistent)
|
303
304
|
end
|
305
|
+
::Faraday.default_adapter
|
304
306
|
end
|
305
307
|
end
|
306
308
|
end
|
@@ -103,31 +103,31 @@ module Elastic
|
|
103
103
|
adapter_version = case @arguments[:adapter]
|
104
104
|
when :patron
|
105
105
|
version = Patron::VERSION if defined?(::Patron::VERSION)
|
106
|
-
{pt: version}
|
106
|
+
{ pt: version }
|
107
107
|
when :net_http
|
108
108
|
version = if defined?(Net::HTTP::VERSION)
|
109
109
|
Net::HTTP::VERSION
|
110
110
|
elsif defined?(Net::HTTP::HTTPVersion)
|
111
111
|
Net::HTTP::HTTPVersion
|
112
112
|
end
|
113
|
-
{nh: version}
|
113
|
+
{ nh: version }
|
114
114
|
when :typhoeus
|
115
115
|
version = Typhoeus::VERSION if defined?(::Typhoeus::VERSION)
|
116
|
-
{ty: version}
|
116
|
+
{ ty: version }
|
117
117
|
when :httpclient
|
118
118
|
version = HTTPClient::VERSION if defined?(HTTPClient::VERSION)
|
119
|
-
{hc: version}
|
119
|
+
{ hc: version }
|
120
120
|
when :net_http_persistent
|
121
121
|
version = Net::HTTP::Persistent::VERSION if defined?(Net::HTTP::Persistent::VERSION)
|
122
|
-
{np: version}
|
122
|
+
{ np: version }
|
123
123
|
else
|
124
124
|
{}
|
125
125
|
end
|
126
|
-
{fd: Faraday::VERSION}.merge(adapter_version)
|
126
|
+
{ fd: Faraday::VERSION }.merge(adapter_version)
|
127
127
|
elsif defined?(Transport::HTTP::Curb) && @transport_class == Transport::HTTP::Curb
|
128
|
-
{cl: Curl::CURB_VERSION}
|
128
|
+
{ cl: Curl::CURB_VERSION }
|
129
129
|
elsif defined?(Transport::HTTP::Manticore) && @transport_class == Transport::HTTP::Manticore
|
130
|
-
{mc: Manticore::VERSION}
|
130
|
+
{ mc: Manticore::VERSION }
|
131
131
|
end
|
132
132
|
end
|
133
133
|
end
|
@@ -37,31 +37,34 @@ module Elastic
|
|
37
37
|
body, headers = compress_request(body, headers)
|
38
38
|
|
39
39
|
case method
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
when 'HEAD'
|
41
|
+
connection.connection.set :nobody, true
|
42
|
+
when 'GET', 'POST', 'PUT', 'DELETE'
|
43
|
+
connection.connection.set :nobody, false
|
44
|
+
connection.connection.put_data = body if body
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
end
|
46
|
+
if headers
|
47
|
+
if connection.connection.headers
|
48
|
+
connection.connection.headers.merge!(headers)
|
49
|
+
else
|
50
|
+
connection.connection.headers = headers
|
52
51
|
end
|
52
|
+
end
|
53
53
|
|
54
|
-
|
54
|
+
else raise ArgumentError, "Unsupported HTTP method: #{method}"
|
55
55
|
end
|
56
56
|
|
57
57
|
connection.connection.http(method.to_sym)
|
58
|
+
header_string = connection.connection.header_str.to_s
|
58
59
|
|
59
|
-
response_headers =
|
60
|
-
response_headers
|
60
|
+
_response_status, *response_headers = header_string.split(/[\r\n]+/).map(&:strip)
|
61
|
+
response_headers = Hash[response_headers.flat_map { |s| s.scan(/^(\S+): (.+)/) }].transform_keys(&:downcase)
|
61
62
|
|
62
|
-
Response.new
|
63
|
-
|
64
|
-
|
63
|
+
Response.new(
|
64
|
+
connection.connection.response_code,
|
65
|
+
decompress_response(connection.connection.body_str),
|
66
|
+
response_headers
|
67
|
+
)
|
65
68
|
end
|
66
69
|
end
|
67
70
|
|
@@ -73,7 +76,7 @@ module Elastic
|
|
73
76
|
client = ::Curl::Easy.new
|
74
77
|
|
75
78
|
apply_headers(client, options)
|
76
|
-
client.url
|
79
|
+
client.url = __full_url(host)
|
77
80
|
|
78
81
|
if host[:user]
|
79
82
|
client.http_auth_types = host[:auth_type] || :basic
|
@@ -105,13 +108,13 @@ module Elastic
|
|
105
108
|
|
106
109
|
def user_agent_header(client)
|
107
110
|
@user_agent ||= begin
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
111
|
+
meta = ["RUBY_VERSION: #{RUBY_VERSION}"]
|
112
|
+
if RbConfig::CONFIG && RbConfig::CONFIG['host_os']
|
113
|
+
meta << "#{RbConfig::CONFIG['host_os'].split('_').first[/[a-z]+/i].downcase} #{RbConfig::CONFIG['target_cpu']}"
|
114
|
+
end
|
115
|
+
meta << "Curb #{Curl::CURB_VERSION}"
|
116
|
+
"elastic-transport-ruby/#{VERSION} (#{meta.join('; ')})"
|
117
|
+
end
|
115
118
|
end
|
116
119
|
end
|
117
120
|
end
|
@@ -105,7 +105,8 @@ describe Elastic::Transport::Transport::Base do
|
|
105
105
|
let(:arguments) do
|
106
106
|
{
|
107
107
|
hosts: ['http://unavailable:9200', 'http://unavailable:9201'],
|
108
|
-
retry_on_failure: 2
|
108
|
+
retry_on_failure: 2,
|
109
|
+
adapter: :net_http
|
109
110
|
}
|
110
111
|
end
|
111
112
|
|
@@ -129,7 +130,8 @@ describe Elastic::Transport::Transport::Base do
|
|
129
130
|
let(:arguments) do
|
130
131
|
{
|
131
132
|
hosts: ELASTICSEARCH_HOSTS,
|
132
|
-
retry_on_status: ['404']
|
133
|
+
retry_on_status: ['404'],
|
134
|
+
adapter: :net_http
|
133
135
|
}
|
134
136
|
end
|
135
137
|
|
@@ -191,8 +191,8 @@ describe Elastic::Transport::Client do
|
|
191
191
|
it 'uses Faraday NetHttp' do
|
192
192
|
expect(adapter).to eq Faraday::Adapter::NetHttp
|
193
193
|
end
|
194
|
-
end
|
195
|
-
end
|
194
|
+
end
|
195
|
+
end unless jruby?
|
196
196
|
|
197
197
|
context 'when the adapter is patron' do
|
198
198
|
let(:adapter) do
|
@@ -204,9 +204,10 @@ describe Elastic::Transport::Client do
|
|
204
204
|
end
|
205
205
|
|
206
206
|
it 'uses Faraday with the adapter' do
|
207
|
+
require 'faraday/patron'
|
207
208
|
expect(adapter).to eq Faraday::Adapter::Patron
|
208
209
|
end
|
209
|
-
end
|
210
|
+
end unless jruby?
|
210
211
|
|
211
212
|
context 'when the adapter is typhoeus' do
|
212
213
|
let(:adapter) do
|
@@ -214,6 +215,8 @@ describe Elastic::Transport::Client do
|
|
214
215
|
end
|
215
216
|
|
216
217
|
let(:client) do
|
218
|
+
require 'faraday/typhoeus' if is_faraday_v2?
|
219
|
+
|
217
220
|
described_class.new(adapter: :typhoeus, enable_meta_header: false)
|
218
221
|
end
|
219
222
|
|
@@ -234,7 +237,7 @@ describe Elastic::Transport::Client do
|
|
234
237
|
it 'uses Faraday with the adapter' do
|
235
238
|
expect(adapter).to eq Faraday::Adapter::Patron
|
236
239
|
end
|
237
|
-
end
|
240
|
+
end unless jruby?
|
238
241
|
|
239
242
|
context 'when the adapter can be detected', unless: jruby? do
|
240
243
|
around do |example|
|
@@ -274,7 +277,7 @@ describe Elastic::Transport::Client do
|
|
274
277
|
it 'sets the logger' do
|
275
278
|
expect(handlers).to include(Faraday::Response::Logger)
|
276
279
|
end
|
277
|
-
end
|
280
|
+
end unless jruby?
|
278
281
|
end
|
279
282
|
|
280
283
|
shared_examples_for 'a client that extracts hosts' do
|
@@ -1263,6 +1266,8 @@ describe Elastic::Transport::Client do
|
|
1263
1266
|
end
|
1264
1267
|
|
1265
1268
|
context 'when the Faraday adapter is set in the block' do
|
1269
|
+
require 'faraday/net_http_persistent' if is_faraday_v2?
|
1270
|
+
|
1266
1271
|
let(:client) do
|
1267
1272
|
Elastic::Transport::Client.new(host: ELASTICSEARCH_HOSTS.first, logger: logger) do |client|
|
1268
1273
|
client.adapter(:net_http_persistent)
|
@@ -1414,6 +1419,8 @@ describe Elastic::Transport::Client do
|
|
1414
1419
|
end
|
1415
1420
|
|
1416
1421
|
context 'when using the HTTPClient adapter' do
|
1422
|
+
require 'faraday/httpclient'
|
1423
|
+
|
1417
1424
|
let(:client) do
|
1418
1425
|
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :httpclient, enable_meta_header: false)
|
1419
1426
|
end
|
@@ -155,7 +155,7 @@ describe Elastic::Transport::Client do
|
|
155
155
|
expect(headers).to include('x-elastic-client-meta' => meta)
|
156
156
|
|
157
157
|
Typhoeus = @klass if was_required
|
158
|
-
end
|
158
|
+
end
|
159
159
|
|
160
160
|
it 'sets adapter in the meta header' do
|
161
161
|
require 'typhoeus'
|
@@ -163,7 +163,7 @@ describe Elastic::Transport::Client do
|
|
163
163
|
meta = "#{meta_header},ty=#{Typhoeus::VERSION}"
|
164
164
|
expect(headers).to include('x-elastic-client-meta' => meta)
|
165
165
|
end
|
166
|
-
end
|
166
|
+
end unless jruby?
|
167
167
|
|
168
168
|
unless jruby?
|
169
169
|
let(:adapter) { :patron }
|
data/spec/spec_helper.rb
CHANGED
@@ -74,6 +74,10 @@ def default_client
|
|
74
74
|
$client ||= Elastic::Transport::Client.new(hosts: ELASTICSEARCH_HOSTS)
|
75
75
|
end
|
76
76
|
|
77
|
+
def is_faraday_v2?
|
78
|
+
Gem::Version.new(Faraday::VERSION) >= Gem::Version.new(2)
|
79
|
+
end
|
80
|
+
|
77
81
|
module Config
|
78
82
|
def self.included(context)
|
79
83
|
# Get the hosts to use to connect an elasticsearch client.
|
@@ -18,9 +18,8 @@
|
|
18
18
|
require 'test_helper'
|
19
19
|
|
20
20
|
class Elastic::Transport::ClientIntegrationTest < Minitest::Test
|
21
|
-
context
|
21
|
+
context 'Transport' do
|
22
22
|
setup do
|
23
|
-
begin; Object.send(:remove_const, :Patron); rescue NameError; end
|
24
23
|
uri = URI(HOST)
|
25
24
|
@host = {
|
26
25
|
host: uri.host,
|
@@ -30,69 +29,116 @@ class Elastic::Transport::ClientIntegrationTest < Minitest::Test
|
|
30
29
|
}
|
31
30
|
end
|
32
31
|
|
33
|
-
should
|
34
|
-
require 'typhoeus'
|
35
|
-
require 'typhoeus/adapters/faraday'
|
36
|
-
|
32
|
+
should 'use the default Faraday adapter' do
|
37
33
|
transport = Elastic::Transport::Transport::HTTP::Faraday.new(hosts: [@host]) do |f|
|
38
34
|
f.response :logger
|
39
|
-
f.adapter :typhoeus
|
40
35
|
end
|
41
36
|
|
42
37
|
client = Elastic::Transport::Client.new(transport: transport)
|
38
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::NetHttp)
|
43
39
|
client.perform_request 'GET', ''
|
44
|
-
end
|
40
|
+
end
|
45
41
|
|
46
|
-
|
47
|
-
|
42
|
+
unless jruby?
|
43
|
+
should 'allow to customize the Faraday adapter to Typhoeus' do
|
44
|
+
if is_faraday_v2?
|
45
|
+
require 'faraday/typhoeus'
|
46
|
+
else
|
47
|
+
require 'typhoeus'
|
48
|
+
end
|
49
|
+
|
50
|
+
transport = Elastic::Transport::Transport::HTTP::Faraday.new(hosts: [@host]) do |f|
|
51
|
+
f.response :logger
|
52
|
+
f.adapter :typhoeus
|
53
|
+
end
|
54
|
+
|
55
|
+
client = Elastic::Transport::Client.new(transport: transport)
|
56
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::Typhoeus)
|
57
|
+
client.perform_request 'GET', ''
|
58
|
+
end
|
48
59
|
|
49
|
-
|
50
|
-
|
51
|
-
|
60
|
+
should 'use the Curb client' do
|
61
|
+
require 'curb'
|
62
|
+
require 'elastic/transport/transport/http/curb'
|
63
|
+
|
64
|
+
transport = Elastic::Transport::Transport::HTTP::Curb.new(hosts: [@host]) do |curl|
|
65
|
+
curl.verbose = true
|
66
|
+
end
|
67
|
+
|
68
|
+
client = Elastic::Transport::Client.new(transport: transport)
|
69
|
+
assert_equal(client.transport.class, Elastic::Transport::Transport::HTTP::Curb)
|
70
|
+
client.perform_request 'GET', ''
|
52
71
|
end
|
53
72
|
|
54
|
-
|
55
|
-
|
56
|
-
|
73
|
+
should 'deserialize JSON responses in the Curb client' do
|
74
|
+
require 'curb'
|
75
|
+
require 'elastic/transport/transport/http/curb'
|
57
76
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
options: { transport_options: { params: { format: 'yaml' } } }
|
62
|
-
)
|
77
|
+
transport = Elastic::Transport::Transport::HTTP::Curb.new(hosts: [@host]) do |curl|
|
78
|
+
curl.verbose = true
|
79
|
+
end
|
63
80
|
|
64
|
-
|
65
|
-
|
81
|
+
client = Elastic::Transport::Client.new(transport: transport)
|
82
|
+
response = client.perform_request 'GET', ''
|
66
83
|
|
67
|
-
|
84
|
+
assert_respond_to(response.body, :to_hash)
|
85
|
+
assert_not_nil response.body['name']
|
86
|
+
assert_equal 'application/json', response.headers['content-type']
|
87
|
+
assert_equal 'Elasticsearch', response.headers['x-elastic-product']
|
88
|
+
end
|
89
|
+
|
90
|
+
should 'allow to customize the Faraday adapter to Patron' do
|
91
|
+
if is_faraday_v2?
|
92
|
+
require 'faraday/patron'
|
93
|
+
else
|
94
|
+
require 'patron'
|
95
|
+
end
|
96
|
+
transport = Elastic::Transport::Transport::HTTP::Faraday.new(hosts: [@host]) do |f|
|
97
|
+
f.response :logger
|
98
|
+
f.adapter :patron
|
99
|
+
end
|
100
|
+
|
101
|
+
client = Elastic::Transport::Client.new(transport: transport)
|
102
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::Patron)
|
103
|
+
client.perform_request 'GET', ''
|
104
|
+
end
|
68
105
|
end
|
69
106
|
|
70
|
-
should
|
71
|
-
require '
|
72
|
-
require 'elastic/transport/transport/http/curb'
|
107
|
+
should 'allow to customize the Faraday adapter to NetHttpPersistent' do
|
108
|
+
require 'faraday/net_http_persistent'
|
73
109
|
|
74
|
-
transport = Elastic::Transport::Transport::HTTP::
|
75
|
-
|
110
|
+
transport = Elastic::Transport::Transport::HTTP::Faraday.new(hosts: [@host]) do |f|
|
111
|
+
f.response :logger
|
112
|
+
f.adapter :net_http_persistent
|
76
113
|
end
|
77
114
|
|
78
115
|
client = Elastic::Transport::Client.new(transport: transport)
|
116
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::NetHttpPersistent)
|
79
117
|
client.perform_request 'GET', ''
|
80
|
-
end
|
118
|
+
end
|
81
119
|
|
82
|
-
should
|
83
|
-
require '
|
84
|
-
require 'elastic/transport/transport/http/curb'
|
120
|
+
should 'allow to customize the Faraday adapter to HTTPClient' do
|
121
|
+
require 'faraday/httpclient'
|
85
122
|
|
86
|
-
transport = Elastic::Transport::Transport::HTTP::
|
87
|
-
|
123
|
+
transport = Elastic::Transport::Transport::HTTP::Faraday.new(hosts: [@host]) do |f|
|
124
|
+
f.response :logger
|
125
|
+
f.adapter :httpclient
|
88
126
|
end
|
89
127
|
|
90
128
|
client = Elastic::Transport::Client.new(transport: transport)
|
91
|
-
|
129
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::HTTPClient)
|
130
|
+
client.perform_request 'GET', ''
|
131
|
+
end
|
92
132
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
133
|
+
should 'allow to define connection parameters and pass them' do
|
134
|
+
transport = Elastic::Transport::Transport::HTTP::Faraday.new(
|
135
|
+
hosts: [@host],
|
136
|
+
options: { transport_options: { params: { format: 'yaml' } } }
|
137
|
+
)
|
138
|
+
|
139
|
+
client = Elastic::Transport::Client.new transport: transport
|
140
|
+
response = client.perform_request 'GET', ''
|
141
|
+
assert response.body.start_with?("---\n"), "Response body should be YAML: #{response.body.inspect}"
|
142
|
+
end
|
97
143
|
end
|
98
144
|
end
|
data/test/test_helper.rb
CHANGED
@@ -14,6 +14,7 @@
|
|
14
14
|
# KIND, either express or implied. See the License for the
|
15
15
|
# specific language governing permissions and limitations
|
16
16
|
# under the License.
|
17
|
+
require 'uri'
|
17
18
|
|
18
19
|
password = ENV['ELASTIC_PASSWORD'] || 'changeme'
|
19
20
|
host = ENV['TEST_ES_SERVER'] || 'http://localhost:9200'
|
@@ -29,17 +30,16 @@ if ENV['COVERAGE']
|
|
29
30
|
SimpleCov.start { add_filter %r{^/test/} }
|
30
31
|
end
|
31
32
|
|
33
|
+
require 'ansi/code'
|
32
34
|
require 'minitest/autorun'
|
33
35
|
require 'minitest/reporters'
|
34
|
-
require 'shoulda/context'
|
35
36
|
require 'mocha/minitest'
|
36
|
-
require '
|
37
|
+
require 'shoulda/context'
|
37
38
|
|
38
|
-
require 'require-prof' if ENV["REQUIRE_PROF"]
|
39
39
|
require 'elastic-transport'
|
40
|
-
require 'logger'
|
41
|
-
|
42
40
|
require 'hashie'
|
41
|
+
require 'logger'
|
42
|
+
require 'require-prof' if ENV["REQUIRE_PROF"]
|
43
43
|
|
44
44
|
RequireProf.print_timing_infos if ENV["REQUIRE_PROF"]
|
45
45
|
|
@@ -80,4 +80,8 @@ module Minitest
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
+
def is_faraday_v2?
|
84
|
+
Gem::Version.new(Faraday::VERSION) >= Gem::Version.new(2)
|
85
|
+
end
|
86
|
+
|
83
87
|
Minitest::Reporters.use! FixedMinitestSpecReporter.new
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
require 'test_helper'
|
19
|
+
|
20
|
+
class Elastic::Transport::ClientAdaptersUnitTest < Minitest::Test
|
21
|
+
context 'Adapters' do
|
22
|
+
setup do
|
23
|
+
begin
|
24
|
+
Object.send(:remove_const, :Patron)
|
25
|
+
rescue NameError
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
should 'use the default Faraday adapter' do
|
30
|
+
fork do
|
31
|
+
client = Elastic::Transport::Client.new
|
32
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::NetHttp)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
should 'use Patron Faraday adapter' do
|
37
|
+
fork do
|
38
|
+
if is_faraday_v2?
|
39
|
+
require 'faraday/patron'
|
40
|
+
else
|
41
|
+
require 'patron'
|
42
|
+
end
|
43
|
+
|
44
|
+
client = Elastic::Transport::Client.new
|
45
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::Patron)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
should 'use Typhoeus Faraday adapter' do
|
50
|
+
fork do
|
51
|
+
if is_faraday_v2?
|
52
|
+
require 'faraday/typhoeus'
|
53
|
+
else
|
54
|
+
require 'typhoeus'
|
55
|
+
end
|
56
|
+
|
57
|
+
client = Elastic::Transport::Client.new
|
58
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::Typhoeus)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
should 'use NetHttpPersistent Faraday adapter' do
|
63
|
+
fork do
|
64
|
+
if is_faraday_v2?
|
65
|
+
require 'faraday/net_http_persistent'
|
66
|
+
else
|
67
|
+
require 'net/http/persistent'
|
68
|
+
end
|
69
|
+
|
70
|
+
client = Elastic::Transport::Client.new
|
71
|
+
assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::NetHttpPersistent)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
should 'use HTTPClient Faraday adapter' do
|
76
|
+
fork do
|
77
|
+
if is_faraday_v2?
|
78
|
+
require 'faraday/httpclient'
|
79
|
+
else
|
80
|
+
require 'httpclient'
|
81
|
+
end
|
82
|
+
|
83
|
+
client = Elastic::Transport::Client.new
|
84
|
+
assert_equal(Faraday::Adapter::HTTPClient, client.transport.connections.first.connection.adapter)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end unless jruby?
|
88
|
+
end
|
@@ -83,11 +83,10 @@ else
|
|
83
83
|
should "set application/json response header" do
|
84
84
|
@transport.connections.first.connection.expects(:http).with(:GET).returns(stub_everything)
|
85
85
|
@transport.connections.first.connection.expects(:body_str).returns('{"foo":"bar"}')
|
86
|
-
@transport.connections.first.connection.expects(:header_str).returns(
|
86
|
+
@transport.connections.first.connection.expects(:header_str).returns("HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nContent-Length: 311\r\n\r\n")
|
87
87
|
|
88
88
|
response = @transport.perform_request 'GET', '/'
|
89
|
-
|
90
|
-
assert_equal 'application/json', response.headers['content-type']
|
89
|
+
assert_equal 'application/json; charset=UTF-8', response.headers['content-type']
|
91
90
|
end
|
92
91
|
|
93
92
|
should "handle HTTP methods" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastic-transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0
|
4
|
+
version: 8.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karel Minarik
|
@@ -10,44 +10,30 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: multi_json
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - ">="
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: '0'
|
29
15
|
- !ruby/object:Gem::Dependency
|
30
16
|
name: faraday
|
31
17
|
requirement: !ruby/object:Gem::Requirement
|
32
18
|
requirements:
|
33
|
-
- - "
|
19
|
+
- - "<"
|
34
20
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
21
|
+
version: '3'
|
36
22
|
type: :runtime
|
37
23
|
prerelease: false
|
38
24
|
version_requirements: !ruby/object:Gem::Requirement
|
39
25
|
requirements:
|
40
|
-
- - "
|
26
|
+
- - "<"
|
41
27
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
28
|
+
version: '3'
|
43
29
|
- !ruby/object:Gem::Dependency
|
44
|
-
name:
|
30
|
+
name: multi_json
|
45
31
|
requirement: !ruby/object:Gem::Requirement
|
46
32
|
requirements:
|
47
33
|
- - ">="
|
48
34
|
- !ruby/object:Gem::Version
|
49
35
|
version: '0'
|
50
|
-
type: :
|
36
|
+
type: :runtime
|
51
37
|
prerelease: false
|
52
38
|
version_requirements: !ruby/object:Gem::Requirement
|
53
39
|
requirements:
|
@@ -55,7 +41,7 @@ dependencies:
|
|
55
41
|
- !ruby/object:Gem::Version
|
56
42
|
version: '0'
|
57
43
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
44
|
+
name: curb
|
59
45
|
requirement: !ruby/object:Gem::Requirement
|
60
46
|
requirements:
|
61
47
|
- - ">="
|
@@ -69,7 +55,7 @@ dependencies:
|
|
69
55
|
- !ruby/object:Gem::Version
|
70
56
|
version: '0'
|
71
57
|
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
58
|
+
name: bundler
|
73
59
|
requirement: !ruby/object:Gem::Requirement
|
74
60
|
requirements:
|
75
61
|
- - ">="
|
@@ -83,7 +69,7 @@ dependencies:
|
|
83
69
|
- !ruby/object:Gem::Version
|
84
70
|
version: '0'
|
85
71
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
72
|
+
name: cane
|
87
73
|
requirement: !ruby/object:Gem::Requirement
|
88
74
|
requirements:
|
89
75
|
- - ">="
|
@@ -97,7 +83,7 @@ dependencies:
|
|
97
83
|
- !ruby/object:Gem::Version
|
98
84
|
version: '0'
|
99
85
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
86
|
+
name: hashie
|
101
87
|
requirement: !ruby/object:Gem::Requirement
|
102
88
|
requirements:
|
103
89
|
- - ">="
|
@@ -152,34 +138,6 @@ dependencies:
|
|
152
138
|
- - ">="
|
153
139
|
- !ruby/object:Gem::Version
|
154
140
|
version: '0'
|
155
|
-
- !ruby/object:Gem::Dependency
|
156
|
-
name: net-http-persistent
|
157
|
-
requirement: !ruby/object:Gem::Requirement
|
158
|
-
requirements:
|
159
|
-
- - ">="
|
160
|
-
- !ruby/object:Gem::Version
|
161
|
-
version: '0'
|
162
|
-
type: :development
|
163
|
-
prerelease: false
|
164
|
-
version_requirements: !ruby/object:Gem::Requirement
|
165
|
-
requirements:
|
166
|
-
- - ">="
|
167
|
-
- !ruby/object:Gem::Version
|
168
|
-
version: '0'
|
169
|
-
- !ruby/object:Gem::Dependency
|
170
|
-
name: patron
|
171
|
-
requirement: !ruby/object:Gem::Requirement
|
172
|
-
requirements:
|
173
|
-
- - ">="
|
174
|
-
- !ruby/object:Gem::Version
|
175
|
-
version: '0'
|
176
|
-
type: :development
|
177
|
-
prerelease: false
|
178
|
-
version_requirements: !ruby/object:Gem::Requirement
|
179
|
-
requirements:
|
180
|
-
- - ">="
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
version: '0'
|
183
141
|
- !ruby/object:Gem::Dependency
|
184
142
|
name: pry
|
185
143
|
requirement: !ruby/object:Gem::Requirement
|
@@ -278,20 +236,6 @@ dependencies:
|
|
278
236
|
- - "~>"
|
279
237
|
- !ruby/object:Gem::Version
|
280
238
|
version: '2'
|
281
|
-
- !ruby/object:Gem::Dependency
|
282
|
-
name: typhoeus
|
283
|
-
requirement: !ruby/object:Gem::Requirement
|
284
|
-
requirements:
|
285
|
-
- - "~>"
|
286
|
-
- !ruby/object:Gem::Version
|
287
|
-
version: '1.4'
|
288
|
-
type: :development
|
289
|
-
prerelease: false
|
290
|
-
version_requirements: !ruby/object:Gem::Requirement
|
291
|
-
requirements:
|
292
|
-
- - "~>"
|
293
|
-
- !ruby/object:Gem::Version
|
294
|
-
version: '1.4'
|
295
239
|
- !ruby/object:Gem::Dependency
|
296
240
|
name: yard
|
297
241
|
requirement: !ruby/object:Gem::Requirement
|
@@ -325,6 +269,7 @@ files:
|
|
325
269
|
- ".gitignore"
|
326
270
|
- CHANGELOG.md
|
327
271
|
- Gemfile
|
272
|
+
- Gemfile-faraday1.gemfile
|
328
273
|
- LICENSE
|
329
274
|
- README.md
|
330
275
|
- Rakefile
|
@@ -361,6 +306,7 @@ files:
|
|
361
306
|
- test/integration/transport_test.rb
|
362
307
|
- test/profile/client_benchmark_test.rb
|
363
308
|
- test/test_helper.rb
|
309
|
+
- test/unit/adapters_test.rb
|
364
310
|
- test/unit/connection_test.rb
|
365
311
|
- test/unit/response_test.rb
|
366
312
|
- test/unit/serializer_test.rb
|
@@ -392,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
392
338
|
- !ruby/object:Gem::Version
|
393
339
|
version: '0'
|
394
340
|
requirements: []
|
395
|
-
rubygems_version: 3.3.
|
341
|
+
rubygems_version: 3.3.7
|
396
342
|
signing_key:
|
397
343
|
specification_version: 4
|
398
344
|
summary: Low level Ruby client for Elastic services.
|
@@ -411,6 +357,7 @@ test_files:
|
|
411
357
|
- test/integration/transport_test.rb
|
412
358
|
- test/profile/client_benchmark_test.rb
|
413
359
|
- test/test_helper.rb
|
360
|
+
- test/unit/adapters_test.rb
|
414
361
|
- test/unit/connection_test.rb
|
415
362
|
- test/unit/response_test.rb
|
416
363
|
- test/unit/serializer_test.rb
|