elastic-transport 8.0.0 → 8.1.0.pre2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbf4a3586e25fe9a9bacee53636589bd2635970266f6938c3588547569b5c406
4
- data.tar.gz: 8d2d465485ecc3efd421089feb5f5fd8a81d036c2b77d8d3811e0c0ac8a13c0c
3
+ metadata.gz: '019bec0fce3232610f573b32a72456674018954609728aba574165f3e4b16393'
4
+ data.tar.gz: 9f5ef21b2823bccf5c6e22c47420bf543931b1b76cd3b7050272cababffe2929
5
5
  SHA512:
6
- metadata.gz: 392a3e7e09c0e59b424e0181eea6115fd4781928e51b1efde6450e56ac9099634071cbc8db95959b0adb6c48e961d2c76af3c8a434628012f22984922e05f025
7
- data.tar.gz: 8dafbedfbf736513077414861a494bd43bd21410b9c236c8f3b5e2cc8771dfcd9005ffdbf79ec574d819429ddc65fc1f11461194fc2c100d534185c6f4cebd30
6
+ metadata.gz: 623ad8af7121423ae67655c684293a14f41faffbf76368fc8b2b4b23ce0a48793d238b209d3f8867808a8567b496d6186c8e700be9371d59839154f460f52eb3
7
+ data.tar.gz: 7cdbcbcb8ab41e11a1a3acd5de8b25520b10823e2706cc8d432fb7057d06181cb0730272289614b34302182d925b82d31a422a0a664c461051db34ce81c3939d
@@ -7,14 +7,16 @@ on:
7
7
  branches:
8
8
  - main
9
9
  jobs:
10
- test-ruby:
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.6', '2.7', '3.0', '3.1', 'jruby-9.3' ]
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: 8.0.0-SNAPSHOT
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
@@ -5,7 +5,7 @@
5
5
  .bundle
6
6
  .config
7
7
  .yardoc
8
- Gemfile.lock
8
+ Gemfile*.lock
9
9
  InstalledFiles
10
10
  _yardoc
11
11
  coverage
data/CHANGELOG.md CHANGED
@@ -1,18 +1,48 @@
1
- ## 8.0.0.pre3
1
+ ## 8.1.0.pre2
2
2
 
3
- - Tested in Ruby 3.1, JRuby 9.3, drops Ruby 2.5 in test Matrix. Version 8.0.0.pre3 is being tested for Ruby (MRI) 2.6, 2.7, 3.0 and 3.1 and JRuby 9.3.
4
- - Updates Manticore implementation headers setup. When using the Manticore HTTP implementation, adding a custom `User-Agent` value in the headers on initialization would get overwritten. [Pull Request](https://github.com/elastic/elastic-transport-ruby/pull/22) - [Issue reported in elastic/elasticsearch-ruby#1684](https://github.com/elastic/elasticsearch-ruby/issues/1684).
3
+ Updates Faraday's adapter detection code.
4
+
5
+ ## 8.1.0.pre1
6
+
7
+ 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:
8
+
9
+ > 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.
10
+ > If you just use the default net_http adapter, then you don't need to do anything!
11
+ > Otherwise, add the corresponding adapter gem to your Gemfile (e.g. faraday-net_http_persistent). Then, simply require them after you require faraday.
12
+
13
+ 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.
14
+
15
+ These are the gems required for the different adapters with Faraday 2, instead of the libraries on which they were based:
16
+ ```
17
+ # HTTPCLient
18
+ 'faraday-httpclient'
19
+
20
+ # NetHTTPPersistent
21
+ 'faraday-net_http_persistent'
22
+
23
+ # Patron
24
+ 'faraday-patron'
25
+
26
+ # Typhoeus
27
+ 'faraday-typhoeus'
28
+ ```
5
29
 
6
- ## 8.0.0.pre2
30
+ 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.
7
31
 
32
+ ## 8.0.1
33
+
34
+ - Minor code cleanup
35
+ - Adds Elastic Transport service token, updates specs for meta header.
36
+
37
+ ## 8.0.0
38
+
39
+ - Library renamed from [`elasticsearch-transport`](https://github.com/elastic/elasticsearch-ruby/tree/7.x/elasticsearch-transport) to `elastic-transport` and promoted to its own repository.
8
40
  - Fixes tracing for Manticore [commit](https://github.com/elastic/elastic-transport-ruby/commit/98c81d19de4fee394f9c1a5079a1892ec951e0f9).
9
41
  - Implements CA Fingerprinting [pull request](https://github.com/elastic/elastic-transport-ruby/pull/13)
10
42
  - Adds `delay_on_retry` to wait between each failed connection, thanks @DinoPullerUqido! [commit](https://github.com/elastic/elastic-transport-ruby/commit/c2f8311409ca63a293588cb7eea5a0c672dbd436)
11
43
  - Fixes compression, thanks @johnnyshields! [commit](https://github.com/elastic/elastic-transport-ruby/commit/8b326d643f76f037075500e19bbe096b2c298099)
12
-
13
- ## 8.0.0.pre1
14
-
15
- - Library renamed from [`elasticsearch-transport`](https://github.com/elastic/elasticsearch-ruby/tree/7.x/elasticsearch-transport) to `elastic-transport` and promoted to its own repository.
44
+ - Tested in Ruby 3.1, JRuby 9.3, drops Ruby 2.5 in test Matrix. Version 8.0.0 tested for Ruby (MRI) 2.6, 2.7, 3.0 and 3.1 and JRuby 9.3.
45
+ - Updates Manticore implementation headers setup. When using the Manticore HTTP implementation, adding a custom `User-Agent` value in the headers on initialization would get overwritten. [Pull Request](https://github.com/elastic/elastic-transport-ruby/pull/22) - [Issue reported in elastic/elasticsearch-ruby#1684](https://github.com/elastic/elasticsearch-ruby/issues/1684).
16
46
 
17
47
  # Changes from elasticsearch-transport:
18
48
 
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/Rakefile CHANGED
@@ -18,13 +18,22 @@
18
18
  require 'bundler/gem_tasks'
19
19
  require 'mkmf'
20
20
 
21
- desc "Run unit tests"
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
@@ -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'
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(/^ /, '')
@@ -211,14 +211,6 @@ module Elastic
211
211
  )
212
212
  end
213
213
 
214
- def add_header(header)
215
- headers = @arguments[:transport_options]&.[](:headers) || {}
216
- headers.merge!(header)
217
- @arguments[:transport_options].merge!(
218
- headers: headers
219
- )
220
- end
221
-
222
214
  # Normalizes and returns hosts configuration.
223
215
  #
224
216
  # Arrayifies the `hosts_config` argument and extracts `host` and `port` info from strings.
@@ -291,24 +283,26 @@ module Elastic
291
283
  # Auto-detect the best adapter (HTTP "driver") available, based on libraries
292
284
  # loaded by the user, preferring those with persistent connections
293
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
294
288
  #
295
289
  # @return [Symbol]
296
290
  #
297
291
  # @api private
298
292
  #
299
293
  def __auto_detect_adapter
300
- case
301
- when defined?(::Patron)
302
- :patron
303
- when defined?(::Typhoeus)
304
- :typhoeus
305
- when defined?(::HTTPClient)
306
- :httpclient
307
- when defined?(::Net::HTTP::Persistent)
308
- :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)
309
299
  else
310
- ::Faraday.default_adapter
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)
311
304
  end
305
+ ::Faraday.default_adapter
312
306
  end
313
307
  end
314
308
  end
@@ -48,7 +48,7 @@ module Elastic
48
48
  elsif defined?(Elasticsearch::VERSION)
49
49
  [:es, client_meta_version(Elasticsearch::VERSION)]
50
50
  else
51
- [:es, client_meta_version(Elastic::Transport::VERSION)]
51
+ [:et, client_meta_version(Elastic::Transport::VERSION)]
52
52
  end
53
53
  end
54
54
 
@@ -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
- 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
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
- if headers
47
- if connection.connection.headers
48
- connection.connection.headers.merge!(headers)
49
- else
50
- connection.connection.headers = headers
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
- else raise ArgumentError, "Unsupported HTTP method: #{method}"
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['content-type'] = 'application/json' if connection.connection.header_str =~ /\/json/
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 connection.connection.response_code,
63
- decompress_response(connection.connection.body_str),
64
- response_headers
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 = __full_url(host)
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
- meta = ["RUBY_VERSION: #{RUBY_VERSION}"]
109
- if RbConfig::CONFIG && RbConfig::CONFIG['host_os']
110
- meta << "#{RbConfig::CONFIG['host_os'].split('_').first[/[a-z]+/i].downcase} #{RbConfig::CONFIG['target_cpu']}"
111
- end
112
- meta << "Curb #{Curl::CURB_VERSION}"
113
- "elastic-transport-ruby/#{VERSION} (#{meta.join('; ')})"
114
- end
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
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elastic
19
19
  module Transport
20
- VERSION = '8.0.0'.freeze
20
+ VERSION = '8.1.0.pre2'.freeze
21
21
  end
22
22
  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 unless jruby?
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
@@ -26,14 +26,14 @@ describe Elastic::Transport::Client do
26
26
  let(:adapter_code) { "nh=#{defined?(Net::HTTP::VERSION) ? Net::HTTP::VERSION : Net::HTTP::HTTPVersion}" }
27
27
  let(:meta_header) do
28
28
  if jruby?
29
- "es=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},jv=#{ENV_JAVA['java.version']},jr=#{JRUBY_VERSION},fd=#{Faraday::VERSION},#{adapter_code}"
29
+ "et=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},jv=#{ENV_JAVA['java.version']},jr=#{JRUBY_VERSION},fd=#{Faraday::VERSION},#{adapter_code}"
30
30
  else
31
- "es=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},fd=#{Faraday::VERSION},#{adapter_code}"
31
+ "et=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},fd=#{Faraday::VERSION},#{adapter_code}"
32
32
  end
33
33
  end
34
34
 
35
35
  context 'client_meta_version' do
36
- let(:version) { ['7.1.0-alpha', '7.11.0.pre.1', '8.0.0-beta', '8.0.0.beta.2']}
36
+ let(:version) { ['7.1.0-alpha', '7.11.0.pre.1', '8.0.0-beta', '8.0.0.beta.2'] }
37
37
 
38
38
  it 'converts the version to X.X.Xp' do
39
39
  expect(client.send(:client_meta_version, '7.0.0-alpha')).to eq('7.0.0p')
@@ -81,9 +81,9 @@ describe Elastic::Transport::Client do
81
81
  context 'adapters' do
82
82
  let(:meta_header) do
83
83
  if jruby?
84
- "es=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},jv=#{ENV_JAVA['java.version']},jr=#{JRUBY_VERSION},fd=#{Faraday::VERSION}"
84
+ "et=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},jv=#{ENV_JAVA['java.version']},jr=#{JRUBY_VERSION},fd=#{Faraday::VERSION}"
85
85
  else
86
- "es=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},fd=#{Faraday::VERSION}"
86
+ "et=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},fd=#{Faraday::VERSION}"
87
87
  end
88
88
  end
89
89
  let(:client) { described_class.new(adapter: adapter) }
@@ -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 unless jruby?
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 }
@@ -246,9 +246,9 @@ describe Elastic::Transport::Client do
246
246
  let(:subject) { client.instance_variable_get('@arguments')[:transport_options][:headers] }
247
247
  let(:meta_header) do
248
248
  if jruby?
249
- "es=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},jv=#{ENV_JAVA['java.version']},jr=#{JRUBY_VERSION}"
249
+ "et=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION},jv=#{ENV_JAVA['java.version']},jr=#{JRUBY_VERSION}"
250
250
  else
251
- "es=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION}"
251
+ "et=#{meta_version},rb=#{RUBY_VERSION},t=#{Elastic::Transport::VERSION}"
252
252
  end
253
253
  end
254
254
 
@@ -258,14 +258,29 @@ describe Elastic::Transport::Client do
258
258
  end
259
259
  end
260
260
 
261
- context 'when using a different service version' do
261
+ context 'when Elasticsearch is being used' do
262
+ before do
263
+ stub_const('Elastic::ELASTICSEARCH_SERVICE_VERSION', [:es, '8.0.0'])
264
+ end
265
+
266
+ let(:client) { Elastic::Transport::Client.new }
267
+
268
+ it 'sets the service version in the metaheader' do
269
+ allow_any_instance_of(Kernel).to receive(:caller).and_return(['elasticsearch'])
270
+ expect(subject['x-elastic-client-meta']).to match(regexp)
271
+ expect(subject['x-elastic-client-meta']).to start_with('es=8.0.0')
272
+ end
273
+ end
274
+
275
+ context 'when Enterprise Search is being used' do
262
276
  before do
263
- stub_const('Elastic::ELASTICSEARCH_SERVICE_VERSION', [:ent, '8.0.0'])
277
+ stub_const('Elastic::ENTERPRISE_SERVICE_VERSION', [:ent, '8.0.0'])
264
278
  end
265
279
 
266
280
  let(:client) { Elastic::Transport::Client.new }
267
281
 
268
282
  it 'sets the service version in the metaheader' do
283
+ allow_any_instance_of(Kernel).to receive(:caller).and_return(['enterprise-search-ruby'])
269
284
  expect(subject['x-elastic-client-meta']).to match(regexp)
270
285
  expect(subject['x-elastic-client-meta']).to start_with('ent=8.0.0')
271
286
  end
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.
@@ -21,7 +21,7 @@ if JRUBY
21
21
  require 'elastic/transport/transport/http/manticore'
22
22
 
23
23
  class Elastic::Transport::ClientManticoreIntegrationTest < Minitest::Test
24
- context "Transport" do
24
+ context 'Transport' do
25
25
  setup do
26
26
  uri = URI(HOST)
27
27
  @host = {
@@ -18,9 +18,8 @@
18
18
  require 'test_helper'
19
19
 
20
20
  class Elastic::Transport::ClientIntegrationTest < Minitest::Test
21
- context "Transport" do
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 "allow to customize the Faraday adapter to Typhoeus" do
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 unless jruby?
40
+ end
45
41
 
46
- should "allow to customize the Faraday adapter to NetHttpPersistent" do
47
- require 'net/http/persistent'
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
- transport = Elastic::Transport::Transport::HTTP::Faraday.new(hosts: [@host]) do |f|
50
- f.response :logger
51
- f.adapter :net_http_persistent
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
- client = Elastic::Transport::Client.new(transport: transport)
55
- client.perform_request 'GET', ''
56
- end
73
+ should 'deserialize JSON responses in the Curb client' do
74
+ require 'curb'
75
+ require 'elastic/transport/transport/http/curb'
57
76
 
58
- should "allow to define connection parameters and pass them" do
59
- transport = Elastic::Transport::Transport::HTTP::Faraday.new(
60
- hosts: [@host],
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
- client = Elastic::Transport::Client.new transport: transport
65
- response = client.perform_request 'GET', ''
81
+ client = Elastic::Transport::Client.new(transport: transport)
82
+ response = client.perform_request 'GET', ''
66
83
 
67
- assert response.body.start_with?("---\n"), "Response body should be YAML: #{response.body.inspect}"
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 "use the Curb client" do
71
- require 'curb'
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::Curb.new(hosts: [@host]) do |curl|
75
- curl.verbose = true
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 unless JRUBY
118
+ end
81
119
 
82
- should "deserialize JSON responses in the Curb client" do
83
- require 'curb'
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::Curb.new(hosts: [@host]) do |curl|
87
- curl.verbose = true
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
- response = client.perform_request 'GET', ''
129
+ assert_equal(client.transport.connections.first.connection.adapter, Faraday::Adapter::HTTPClient)
130
+ client.perform_request 'GET', ''
131
+ end
92
132
 
93
- assert_respond_to(response.body, :to_hash)
94
- assert_not_nil response.body['name']
95
- assert_equal 'application/json', response.headers['content-type']
96
- end unless jruby?
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 'ansi/code'
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('HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nContent-Length: 311\r\n\r\n')
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.0
4
+ version: 8.1.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
@@ -10,10 +10,10 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-02-10 00:00:00.000000000 Z
13
+ date: 2022-08-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: multi_json
16
+ name: faraday
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - ">="
@@ -27,27 +27,13 @@ dependencies:
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
29
  - !ruby/object:Gem::Dependency
30
- name: faraday
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - "~>"
34
- - !ruby/object:Gem::Version
35
- version: '1'
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - "~>"
41
- - !ruby/object:Gem::Version
42
- version: '1'
43
- - !ruby/object:Gem::Dependency
44
- name: bundler
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: :development
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: cane
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: curb
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: hashie
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: httpclient
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
@@ -388,11 +334,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
388
334
  version: '2.5'
389
335
  required_rubygems_version: !ruby/object:Gem::Requirement
390
336
  requirements:
391
- - - ">="
337
+ - - ">"
392
338
  - !ruby/object:Gem::Version
393
- version: '0'
339
+ version: 1.3.1
394
340
  requirements: []
395
- rubygems_version: 3.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