elasticsearch-transport 7.5.0 → 7.8.0.pre
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/Gemfile +27 -10
- data/README.md +142 -53
- data/Rakefile +16 -3
- data/elasticsearch-transport.gemspec +57 -63
- data/lib/elasticsearch-transport.rb +16 -3
- data/lib/elasticsearch/transport.rb +16 -3
- data/lib/elasticsearch/transport/client.rb +61 -13
- data/lib/elasticsearch/transport/redacted.rb +16 -3
- data/lib/elasticsearch/transport/transport/base.rb +23 -4
- data/lib/elasticsearch/transport/transport/connections/collection.rb +16 -3
- data/lib/elasticsearch/transport/transport/connections/connection.rb +16 -3
- data/lib/elasticsearch/transport/transport/connections/selector.rb +16 -3
- data/lib/elasticsearch/transport/transport/errors.rb +16 -3
- data/lib/elasticsearch/transport/transport/http/curb.rb +16 -3
- data/lib/elasticsearch/transport/transport/http/faraday.rb +17 -4
- data/lib/elasticsearch/transport/transport/http/manticore.rb +16 -3
- data/lib/elasticsearch/transport/transport/loggable.rb +16 -3
- data/lib/elasticsearch/transport/transport/response.rb +16 -4
- data/lib/elasticsearch/transport/transport/serializer/multi_json.rb +16 -3
- data/lib/elasticsearch/transport/transport/sniffer.rb +16 -3
- data/lib/elasticsearch/transport/version.rb +17 -4
- data/spec/elasticsearch/connections/collection_spec.rb +16 -3
- data/spec/elasticsearch/connections/selector_spec.rb +16 -3
- data/spec/elasticsearch/transport/base_spec.rb +16 -10
- data/spec/elasticsearch/transport/client_spec.rb +154 -28
- data/spec/elasticsearch/transport/sniffer_spec.rb +16 -3
- data/spec/spec_helper.rb +19 -1
- data/test/integration/transport_test.rb +16 -3
- data/test/profile/client_benchmark_test.rb +16 -3
- data/test/test_helper.rb +16 -3
- data/test/unit/connection_test.rb +16 -3
- data/test/unit/response_test.rb +17 -4
- data/test/unit/serializer_test.rb +16 -3
- data/test/unit/transport_base_test.rb +16 -3
- data/test/unit/transport_curb_test.rb +16 -3
- data/test/unit/transport_faraday_test.rb +16 -3
- data/test/unit/transport_manticore_test.rb +16 -3
- metadata +68 -70
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b922c1e2131a848cc6fa68e4f3559b7e47a48d794ff51f80a133bf3bb5e8dc75
         | 
| 4 | 
            +
              data.tar.gz: 4f544cd657f098844fa0b67f12e1ac1ead3085095cad9b06d433bd6919593179
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 711e4ce60c75f815947f0040c6f5c1b64767312068397f60c0fa43af8ed460dd8d3656609e8843b6e18dfdf7e2e78b7d860a32a0f1615aacb757f434b23f1b3d
         | 
| 7 | 
            +
              data.tar.gz: ed2ffecfea9ace873a32a49c370abfa5162e6de668ea4c5afcce50fe18a265054a2bf43e317022367123cceb8ec0b018b26ed83c5158c894563c4d71a019ed6c
         | 
    
        data/Gemfile
    CHANGED
    
    | @@ -1,25 +1,42 @@ | |
| 1 | 
            -
            # Licensed to Elasticsearch B.V under one or more  | 
| 2 | 
            -
            #  | 
| 3 | 
            -
            #  | 
| 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.
         | 
| 4 17 |  | 
| 5 18 | 
             
            source 'https://rubygems.org'
         | 
| 6 19 |  | 
| 7 20 | 
             
            # Specify your gem's dependencies in elasticsearch-transport.gemspec
         | 
| 8 21 | 
             
            gemspec
         | 
| 9 22 |  | 
| 10 | 
            -
            if File.exist? File.expand_path( | 
| 11 | 
            -
              gem 'elasticsearch-api', : | 
| 23 | 
            +
            if File.exist? File.expand_path('../../elasticsearch-api/elasticsearch-api.gemspec', __FILE__)
         | 
| 24 | 
            +
              gem 'elasticsearch-api', path: File.expand_path('../../elasticsearch-api', __FILE__), require: false
         | 
| 12 25 | 
             
            end
         | 
| 13 26 |  | 
| 14 | 
            -
            if File.exist? File.expand_path( | 
| 15 | 
            -
              gem 'elasticsearch-extensions', : | 
| 27 | 
            +
            if File.exist? File.expand_path('../../elasticsearch-extensions/elasticsearch-extensions.gemspec', __FILE__)
         | 
| 28 | 
            +
              gem 'elasticsearch-extensions', path: File.expand_path('../../elasticsearch-extensions', __FILE__), require: false
         | 
| 16 29 | 
             
            end
         | 
| 17 30 |  | 
| 18 | 
            -
            if File.exist? File.expand_path( | 
| 19 | 
            -
              gem 'elasticsearch', : | 
| 31 | 
            +
            if File.exist? File.expand_path('../../elasticsearch/elasticsearch.gemspec', __FILE__)
         | 
| 32 | 
            +
              gem 'elasticsearch', path: File.expand_path('../../elasticsearch', __FILE__), require: false
         | 
| 20 33 | 
             
            end
         | 
| 21 34 |  | 
| 22 35 | 
             
            group :development do
         | 
| 23 36 | 
             
              gem 'rspec'
         | 
| 24 | 
            -
               | 
| 37 | 
            +
              if defined?(JRUBY_VERSION)
         | 
| 38 | 
            +
                gem 'pry-nav'
         | 
| 39 | 
            +
              else
         | 
| 40 | 
            +
                gem 'pry-byebug'
         | 
| 41 | 
            +
              end
         | 
| 25 42 | 
             
            end
         | 
    
        data/README.md
    CHANGED
    
    | @@ -28,12 +28,16 @@ Features overview: | |
| 28 28 | 
             
            * Node reloading (based on cluster state) on errors or on demand
         | 
| 29 29 |  | 
| 30 30 | 
             
            For optimal performance, use a HTTP library which supports persistent ("keep-alive") connections,
         | 
| 31 | 
            -
            such as [ | 
| 32 | 
            -
            Just require the library (`require ' | 
| 33 | 
            -
            and it will be automatically used | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
            [ | 
| 31 | 
            +
            such as [patron](https://github.com/toland/patron).
         | 
| 32 | 
            +
            Just require the library (`require 'patron'`) in your code,
         | 
| 33 | 
            +
            and it will be automatically used.
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            Currently these libraries will be automatically detected and used:
         | 
| 36 | 
            +
            - [Patron](https://github.com/toland/patron)
         | 
| 37 | 
            +
            - [HTTPClient](https://rubygems.org/gems/httpclient)
         | 
| 38 | 
            +
            - [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent)
         | 
| 39 | 
            +
             | 
| 40 | 
            +
            **Note on [Typhoeus](https://github.com/typhoeus/typhoeus)**: Typhoeus is compatible and will be automatically detected too. However, the latest release (v1.3.1 at the moment of writing this) is not compatible with Faraday 1.0. [It still uses the deprecated `Faraday::Error` namespace](https://github.com/typhoeus/typhoeus/blob/v1.3.1/lib/typhoeus/adapters/faraday.rb#L100). If you want to use it with this gem, we suggest getting `master` from GitHub, since this has been fixed for v1.4.0. We'll update this if/when v1.4.0 is released.a
         | 
| 37 41 |  | 
| 38 42 | 
             
            For detailed information, see example configurations [below](#transport-implementations).
         | 
| 39 43 |  | 
| @@ -69,6 +73,23 @@ Full documentation is available at  | |
| 69 73 |  | 
| 70 74 | 
             
            ## Configuration
         | 
| 71 75 |  | 
| 76 | 
            +
            * [Setting Hosts](#setting-hosts)
         | 
| 77 | 
            +
            * [Default port](#default-port)
         | 
| 78 | 
            +
            * [Connect using an Elastic Cloud ID](#connect-using-an-elastic-cloud-id)
         | 
| 79 | 
            +
            * [Authentication](#authentication)
         | 
| 80 | 
            +
            * [Logging](#logging)
         | 
| 81 | 
            +
            * [Custom HTTP Headers](#custom-http-headers)
         | 
| 82 | 
            +
            * [Identifying running tasks with X-Opaque-Id](#identifying-running-tasks-with-x-opaque-id)
         | 
| 83 | 
            +
            * [Setting Timeouts](#setting-timeouts)
         | 
| 84 | 
            +
            * [Randomizing Hosts](#randomizing-hosts)
         | 
| 85 | 
            +
            * [Retrying on Failures](#retrying-on-failures)
         | 
| 86 | 
            +
            * [Reloading Hosts](#reloading-hosts)
         | 
| 87 | 
            +
            * [Connection Selector](#connection-selector)
         | 
| 88 | 
            +
            * [Transport Implementations](#transport-implementations)
         | 
| 89 | 
            +
            * [Serializer implementations](#serializer-implementations)
         | 
| 90 | 
            +
            * [Exception Handling](#exception-handling)
         | 
| 91 | 
            +
            * [Development and Community](#development-and-community)
         | 
| 92 | 
            +
             | 
| 72 93 | 
             
            The client supports many configurations options for setting up and managing connections,
         | 
| 73 94 | 
             
            configuring logging, customizing the transport library, etc.
         | 
| 74 95 |  | 
| @@ -144,35 +165,108 @@ use the `transport_options` option: | |
| 144 165 | 
             
                Elasticsearch::Client.new url: 'https://username:password@example.com:9200',
         | 
| 145 166 | 
             
                                          transport_options: { ssl: { ca_file: '/path/to/cacert.pem' } }
         | 
| 146 167 |  | 
| 168 | 
            +
            You can also use [**API Key authentication**](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html):
         | 
| 169 | 
            +
             | 
| 170 | 
            +
            ``` ruby
         | 
| 171 | 
            +
            Elasticsearch::Client.new(
         | 
| 172 | 
            +
              host: host,
         | 
| 173 | 
            +
              transport_options: transport_options,
         | 
| 174 | 
            +
              api_key: credentials
         | 
| 175 | 
            +
            )
         | 
| 176 | 
            +
            ```
         | 
| 177 | 
            +
             | 
| 178 | 
            +
            Where credentials is either the base64 encoding of `id` and `api_key` joined by a colon or a hash with the `id` and `api_key`:
         | 
| 179 | 
            +
             | 
| 180 | 
            +
            ``` ruby
         | 
| 181 | 
            +
            Elasticsearch::Client.new(
         | 
| 182 | 
            +
              host: host,
         | 
| 183 | 
            +
              transport_options: transport_options,
         | 
| 184 | 
            +
              api_key: {id: 'my_id', api_key: 'my_api_key'}
         | 
| 185 | 
            +
            )
         | 
| 186 | 
            +
            ```
         | 
| 187 | 
            +
             | 
| 147 188 | 
             
            ### Logging
         | 
| 148 189 |  | 
| 149 190 | 
             
            To log requests and responses to standard output with the default logger (an instance of Ruby's {::Logger} class),
         | 
| 150 191 | 
             
            set the `log` argument:
         | 
| 151 192 |  | 
| 152 | 
            -
             | 
| 193 | 
            +
            ```ruby
         | 
| 194 | 
            +
            Elasticsearch::Client.new log: true
         | 
| 195 | 
            +
            ```
         | 
| 196 | 
            +
             | 
| 153 197 |  | 
| 154 198 | 
             
            To trace requests and responses in the _Curl_ format, set the `trace` argument:
         | 
| 155 199 |  | 
| 156 | 
            -
             | 
| 200 | 
            +
            ```ruby
         | 
| 201 | 
            +
            Elasticsearch::Client.new trace: true
         | 
| 202 | 
            +
            ```
         | 
| 157 203 |  | 
| 158 204 | 
             
            You can customize the default logger or tracer:
         | 
| 159 205 |  | 
| 206 | 
            +
            ```ruby
         | 
| 160 207 | 
             
                client.transport.logger.formatter = proc { |s, d, p, m| "#{s}: #{m}\n" }
         | 
| 161 208 | 
             
                client.transport.logger.level = Logger::INFO
         | 
| 209 | 
            +
            ```
         | 
| 162 210 |  | 
| 163 211 | 
             
            Or, you can use a custom `::Logger` instance:
         | 
| 164 212 |  | 
| 165 | 
            -
             | 
| 213 | 
            +
            ```ruby
         | 
| 214 | 
            +
            Elasticsearch::Client.new logger: Logger.new(STDERR)
         | 
| 215 | 
            +
            ```
         | 
| 166 216 |  | 
| 167 217 | 
             
            You can pass the client any conforming logger implementation:
         | 
| 168 218 |  | 
| 169 | 
            -
             | 
| 219 | 
            +
            ```ruby
         | 
| 220 | 
            +
            require 'logging' # https://github.com/TwP/logging/
         | 
| 221 | 
            +
             | 
| 222 | 
            +
            log = Logging.logger['elasticsearch']
         | 
| 223 | 
            +
            log.add_appenders Logging.appenders.stdout
         | 
| 224 | 
            +
            log.level = :info
         | 
| 225 | 
            +
             | 
| 226 | 
            +
            client = Elasticsearch::Client.new logger: log
         | 
| 227 | 
            +
            ```
         | 
| 228 | 
            +
             | 
| 229 | 
            +
            ### Custom HTTP Headers
         | 
| 230 | 
            +
             | 
| 231 | 
            +
            You can set a custom HTTP header on the client's initializer:
         | 
| 232 | 
            +
             | 
| 233 | 
            +
            ```ruby
         | 
| 234 | 
            +
            client = Elasticsearch::Client.new(
         | 
| 235 | 
            +
              transport_options: {
         | 
| 236 | 
            +
                headers:
         | 
| 237 | 
            +
                  {user_agent: "My App"}
         | 
| 238 | 
            +
              }
         | 
| 239 | 
            +
            )
         | 
| 240 | 
            +
            ```
         | 
| 241 | 
            +
             | 
| 242 | 
            +
            You can also pass in `headers` as a parameter to any of the API Endpoints to set custom headers for the request:
         | 
| 243 | 
            +
             | 
| 244 | 
            +
            ```ruby
         | 
| 245 | 
            +
            client.search(index: 'myindex', q: 'title:test', headers: {user_agent: "My App"})
         | 
| 246 | 
            +
            ```
         | 
| 247 | 
            +
             | 
| 248 | 
            +
            ### Identifying running tasks with X-Opaque-Id
         | 
| 170 249 |  | 
| 171 | 
            -
             | 
| 172 | 
            -
                log.add_appenders Logging.appenders.stdout
         | 
| 173 | 
            -
                log.level = :info
         | 
| 250 | 
            +
            The X-Opaque-Id header allows to track certain calls, or associate certain tasks with the client that started them ([more on the Elasticsearch docs](https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks)). To use this feature, you need to set an id for `opaque_id` on the client on each request. Example:
         | 
| 174 251 |  | 
| 175 | 
            -
             | 
| 252 | 
            +
            ```ruby
         | 
| 253 | 
            +
            client = Elasticsearch::Client.new
         | 
| 254 | 
            +
            client.search(index: 'myindex', q: 'title:test', opaque_id: '123456')
         | 
| 255 | 
            +
            ```
         | 
| 256 | 
            +
            The search request will include the following HTTP Header:
         | 
| 257 | 
            +
            ```
         | 
| 258 | 
            +
            X-Opaque-Id: 123456
         | 
| 259 | 
            +
            ```
         | 
| 260 | 
            +
             | 
| 261 | 
            +
            You can also set a prefix for X-Opaque-Id when initializing the client. This will be prepended to the id you set before each request if you're using X-Opaque-Id. Example:
         | 
| 262 | 
            +
            ```ruby
         | 
| 263 | 
            +
            client = Elasticsearch::Client.new(opaque_id_prefix: 'eu-west1')
         | 
| 264 | 
            +
            client.search(index: 'myindex', q: 'title:test', opaque_id: '123456')
         | 
| 265 | 
            +
            ```
         | 
| 266 | 
            +
            The request will include the following HTTP Header:
         | 
| 267 | 
            +
            ```
         | 
| 268 | 
            +
            X-Opaque-Id: eu-west1_123456
         | 
| 269 | 
            +
            ```
         | 
| 176 270 |  | 
| 177 271 | 
             
            ### Setting Timeouts
         | 
| 178 272 |  | 
| @@ -268,25 +362,29 @@ preferring HTTP clients with support for persistent connections. | |
| 268 362 |  | 
| 269 363 | 
             
            To use the [_Patron_](https://github.com/toland/patron) HTTP, for example, just require it:
         | 
| 270 364 |  | 
| 271 | 
            -
             | 
| 365 | 
            +
            ```ruby
         | 
| 366 | 
            +
            require 'patron'
         | 
| 367 | 
            +
            ```
         | 
| 272 368 |  | 
| 273 369 | 
             
            Then, create a new client, and the _Patron_  gem will be used as the "driver":
         | 
| 274 370 |  | 
| 275 | 
            -
             | 
| 371 | 
            +
            ```ruby
         | 
| 372 | 
            +
            client = Elasticsearch::Client.new
         | 
| 276 373 |  | 
| 277 | 
            -
             | 
| 278 | 
            -
             | 
| 374 | 
            +
            client.transport.connections.first.connection.builder.adapter
         | 
| 375 | 
            +
            # => Faraday::Adapter::Patron
         | 
| 279 376 |  | 
| 280 | 
            -
             | 
| 281 | 
            -
             | 
| 282 | 
            -
             | 
| 283 | 
            -
             | 
| 284 | 
            -
             | 
| 377 | 
            +
            10.times do
         | 
| 378 | 
            +
              client.nodes.stats(metric: 'http')['nodes'].values.each do |n|
         | 
| 379 | 
            +
                puts "#{n['name']} : #{n['http']['total_opened']}"
         | 
| 380 | 
            +
              end
         | 
| 381 | 
            +
            end
         | 
| 285 382 |  | 
| 286 | 
            -
             | 
| 287 | 
            -
             | 
| 288 | 
            -
             | 
| 289 | 
            -
             | 
| 383 | 
            +
            # => Stiletoo : 24
         | 
| 384 | 
            +
            # => Stiletoo : 24
         | 
| 385 | 
            +
            # => Stiletoo : 24
         | 
| 386 | 
            +
            # => ...
         | 
| 387 | 
            +
            ```
         | 
| 290 388 |  | 
| 291 389 | 
             
            To use a specific adapter for _Faraday_, pass it as the `adapter` argument:
         | 
| 292 390 |  | 
| @@ -308,44 +406,35 @@ constructor, use the `transport_options` key: | |
| 308 406 |  | 
| 309 407 | 
             
            To configure the _Faraday_ instance directly, use a block:
         | 
| 310 408 |  | 
| 311 | 
            -
                require ' | 
| 312 | 
            -
                require 'typhoeus/adapters/faraday'
         | 
| 409 | 
            +
                require 'patron'
         | 
| 313 410 |  | 
| 314 411 | 
             
                client = Elasticsearch::Client.new(host: 'localhost', port: '9200') do |f|
         | 
| 315 412 | 
             
                  f.response :logger
         | 
| 316 | 
            -
                  f.adapter  : | 
| 413 | 
            +
                  f.adapter  :patron
         | 
| 317 414 | 
             
                end
         | 
| 318 415 |  | 
| 319 | 
            -
            You can use any standard Faraday middleware and plugins in the configuration block,
         | 
| 320 | 
            -
            for example sign the requests for the [AWS Elasticsearch service](https://aws.amazon.com/elasticsearch-service/):
         | 
| 321 | 
            -
             | 
| 322 | 
            -
                require 'faraday_middleware/aws_signers_v4'
         | 
| 323 | 
            -
             | 
| 324 | 
            -
                client = Elasticsearch::Client.new url: 'https://search-my-cluster-abc123....es.amazonaws.com' do |f|
         | 
| 325 | 
            -
                  f.request :aws_signers_v4,
         | 
| 326 | 
            -
                            credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY'], ENV['AWS_SECRET_ACCESS_KEY']),
         | 
| 327 | 
            -
                            service_name: 'es',
         | 
| 328 | 
            -
                            region: 'us-east-1'
         | 
| 329 | 
            -
                end
         | 
| 416 | 
            +
            You can use any standard Faraday middleware and plugins in the configuration block, for example sign the requests for the [AWS Elasticsearch service](https://aws.amazon.com/elasticsearch-service/). See [the AWS documentation](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-request-signing.html#es-request-signing-ruby) for an example.
         | 
| 330 417 |  | 
| 331 418 | 
             
            You can also initialize the transport class yourself, and pass it to the client constructor
         | 
| 332 419 | 
             
            as the `transport` argument:
         | 
| 333 420 |  | 
| 334 | 
            -
             | 
| 335 | 
            -
             | 
| 421 | 
            +
            ```ruby
         | 
| 422 | 
            +
            require 'patron'
         | 
| 336 423 |  | 
| 337 | 
            -
             | 
| 338 | 
            -
             | 
| 339 | 
            -
             | 
| 340 | 
            -
             | 
| 424 | 
            +
            transport_configuration = lambda do |f|
         | 
| 425 | 
            +
              f.response :logger
         | 
| 426 | 
            +
              f.adapter  :patron
         | 
| 427 | 
            +
            end
         | 
| 341 428 |  | 
| 342 | 
            -
             | 
| 343 | 
            -
             | 
| 344 | 
            -
             | 
| 429 | 
            +
            transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new \
         | 
| 430 | 
            +
              hosts: [ { host: 'localhost', port: '9200' } ],
         | 
| 431 | 
            +
              &transport_configuration
         | 
| 432 | 
            +
             | 
| 433 | 
            +
            # Pass the transport to the client
         | 
| 434 | 
            +
            #
         | 
| 435 | 
            +
            client = Elasticsearch::Client.new transport: transport
         | 
| 436 | 
            +
            ```
         | 
| 345 437 |  | 
| 346 | 
            -
                # Pass the transport to the client
         | 
| 347 | 
            -
                #
         | 
| 348 | 
            -
                client = Elasticsearch::Client.new transport: transport
         | 
| 349 438 |  | 
| 350 439 | 
             
            Instead of passing the transport to the constructor, you can inject it at run time:
         | 
| 351 440 |  | 
    
        data/Rakefile
    CHANGED
    
    | @@ -1,6 +1,19 @@ | |
| 1 | 
            -
            # Licensed to Elasticsearch B.V under one or more  | 
| 2 | 
            -
            #  | 
| 3 | 
            -
            #  | 
| 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.
         | 
| 4 17 |  | 
| 5 18 | 
             
            require "bundler/gem_tasks"
         | 
| 6 19 |  | 
| @@ -1,6 +1,19 @@ | |
| 1 | 
            -
            # Licensed to Elasticsearch B.V under one or more  | 
| 2 | 
            -
            #  | 
| 3 | 
            -
            #  | 
| 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.
         | 
| 4 17 |  | 
| 5 18 | 
             
            # coding: utf-8
         | 
| 6 19 | 
             
            lib = File.expand_path('../lib', __FILE__)
         | 
| @@ -8,74 +21,55 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | |
| 8 21 | 
             
            require 'elasticsearch/transport/version'
         | 
| 9 22 |  | 
| 10 23 | 
             
            Gem::Specification.new do |s|
         | 
| 11 | 
            -
              s.name          =  | 
| 24 | 
            +
              s.name          = 'elasticsearch-transport'
         | 
| 12 25 | 
             
              s.version       = Elasticsearch::Transport::VERSION
         | 
| 13 | 
            -
              s.authors       = [ | 
| 14 | 
            -
              s.email         = [ | 
| 15 | 
            -
              s.summary       =  | 
| 16 | 
            -
              s.homepage      =  | 
| 17 | 
            -
              s.license       =  | 
| 18 | 
            -
             | 
| 26 | 
            +
              s.authors       = ['Karel Minarik']
         | 
| 27 | 
            +
              s.email         = ['karel.minarik@elasticsearch.org']
         | 
| 28 | 
            +
              s.summary       = 'Ruby client for Elasticsearch.'
         | 
| 29 | 
            +
              s.homepage      = 'https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.x/index.html'
         | 
| 30 | 
            +
              s.license       = 'Apache-2.0'
         | 
| 31 | 
            +
              s.metadata = {
         | 
| 32 | 
            +
                'homepage_uri' => 'https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.x/index.html',
         | 
| 33 | 
            +
                'changelog_uri' => 'https://github.com/elastic/elasticsearch-ruby/blob/7.x/CHANGELOG.md',
         | 
| 34 | 
            +
                'source_code_uri' => 'https://github.com/elastic/elasticsearch-ruby/tree/7.x/elasticsearch-transport',
         | 
| 35 | 
            +
                'bug_tracker_uri' => 'https://github.com/elastic/elasticsearch-ruby/issues'
         | 
| 36 | 
            +
              }
         | 
| 19 37 | 
             
              s.files         = `git ls-files`.split($/)
         | 
| 20 38 | 
             
              s.executables   = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
         | 
| 21 39 | 
             
              s.test_files    = s.files.grep(%r{^(test|spec|features)/})
         | 
| 22 | 
            -
              s.require_paths = [ | 
| 23 | 
            -
             | 
| 24 | 
            -
              s.extra_rdoc_files  = [ "README.md", "LICENSE" ]
         | 
| 25 | 
            -
              s.rdoc_options      = [ "--charset=UTF-8" ]
         | 
| 26 | 
            -
             | 
| 27 | 
            -
              s.required_ruby_version = '>= 1.9'
         | 
| 28 | 
            -
             | 
| 29 | 
            -
              s.add_dependency "multi_json"
         | 
| 30 | 
            -
              s.add_dependency "faraday", '>= 0.14', "< 1"
         | 
| 31 | 
            -
             | 
| 32 | 
            -
              if defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
         | 
| 33 | 
            -
                s.add_dependency "system_timer"
         | 
| 34 | 
            -
              end
         | 
| 35 | 
            -
             | 
| 36 | 
            -
              s.add_development_dependency "bundler"
         | 
| 37 | 
            -
             | 
| 38 | 
            -
              if defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
         | 
| 39 | 
            -
                s.add_development_dependency "rake", "~> 11.1"
         | 
| 40 | 
            -
              else
         | 
| 41 | 
            -
                s.add_development_dependency "rake", "< 11.0"
         | 
| 42 | 
            -
              end
         | 
| 43 | 
            -
             | 
| 44 | 
            -
              s.add_development_dependency "ansi"
         | 
| 45 | 
            -
              s.add_development_dependency "shoulda-context"
         | 
| 46 | 
            -
              s.add_development_dependency "mocha"
         | 
| 47 | 
            -
              s.add_development_dependency "yard"
         | 
| 48 | 
            -
              s.add_development_dependency "pry"
         | 
| 40 | 
            +
              s.require_paths = ['lib']
         | 
| 49 41 |  | 
| 50 | 
            -
               | 
| 51 | 
            -
              s. | 
| 52 | 
            -
              s.add_development_dependency "patron" unless defined? JRUBY_VERSION
         | 
| 53 | 
            -
              s.add_development_dependency "typhoeus", '~> 0.6'
         | 
| 54 | 
            -
              s.add_development_dependency "net-http-persistent"
         | 
| 55 | 
            -
              s.add_development_dependency "httpclient"
         | 
| 56 | 
            -
              s.add_development_dependency "manticore", '~> 0.6' if defined? JRUBY_VERSION
         | 
| 57 | 
            -
              s.add_development_dependency "hashie"
         | 
| 42 | 
            +
              s.extra_rdoc_files  = [ 'README.md', 'LICENSE' ]
         | 
| 43 | 
            +
              s.rdoc_options      = [ '--charset=UTF-8' ]
         | 
| 58 44 |  | 
| 59 | 
            -
               | 
| 60 | 
            -
              if defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
         | 
| 61 | 
            -
                s.add_development_dependency "test-unit", '~> 2'
         | 
| 62 | 
            -
                s.add_development_dependency "json", '~> 1.8'
         | 
| 63 | 
            -
              end
         | 
| 45 | 
            +
              s.required_ruby_version = '>= 2.4'
         | 
| 64 46 |  | 
| 65 | 
            -
               | 
| 66 | 
            -
             | 
| 67 | 
            -
                s.add_development_dependency "minitest-reporters"
         | 
| 68 | 
            -
                s.add_development_dependency "elasticsearch-extensions"
         | 
| 69 | 
            -
                s.add_development_dependency "ruby-prof"    unless defined?(JRUBY_VERSION) || defined?(Rubinius)
         | 
| 70 | 
            -
                s.add_development_dependency "require-prof" unless defined?(JRUBY_VERSION) || defined?(Rubinius)
         | 
| 71 | 
            -
                s.add_development_dependency "simplecov", '~> 0.17', '< 0.18'
         | 
| 72 | 
            -
                s.add_development_dependency "simplecov-rcov"
         | 
| 73 | 
            -
                s.add_development_dependency "cane"
         | 
| 74 | 
            -
              end
         | 
| 47 | 
            +
              s.add_dependency 'multi_json'
         | 
| 48 | 
            +
              s.add_dependency 'faraday', '~> 1'
         | 
| 75 49 |  | 
| 76 | 
            -
               | 
| 77 | 
            -
             | 
| 78 | 
            -
               | 
| 50 | 
            +
              s.add_development_dependency 'cane'
         | 
| 51 | 
            +
              s.add_development_dependency 'curb'   unless defined? JRUBY_VERSION
         | 
| 52 | 
            +
              s.add_development_dependency 'elasticsearch-extensions'
         | 
| 53 | 
            +
              s.add_development_dependency 'minitest'
         | 
| 54 | 
            +
              s.add_development_dependency 'minitest-reporters'
         | 
| 55 | 
            +
              s.add_development_dependency 'rake', '~> 13'
         | 
| 56 | 
            +
              s.add_development_dependency 'require-prof' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
         | 
| 57 | 
            +
              s.add_development_dependency 'ruby-prof'    unless defined?(JRUBY_VERSION) || defined?(Rubinius)
         | 
| 58 | 
            +
              s.add_development_dependency 'simplecov', '~> 0.17', '< 0.18'
         | 
| 59 | 
            +
              s.add_development_dependency 'simplecov-rcov'
         | 
| 60 | 
            +
              s.add_development_dependency 'ansi'
         | 
| 61 | 
            +
              s.add_development_dependency 'hashie'
         | 
| 62 | 
            +
              s.add_development_dependency 'httpclient'
         | 
| 63 | 
            +
              s.add_development_dependency 'manticore', '~> 0.6' if defined? JRUBY_VERSION
         | 
| 64 | 
            +
              s.add_development_dependency 'mocha'
         | 
| 65 | 
            +
              s.add_development_dependency 'net-http-persistent'
         | 
| 66 | 
            +
              s.add_development_dependency 'patron' unless defined? JRUBY_VERSION
         | 
| 67 | 
            +
              s.add_development_dependency 'pry'
         | 
| 68 | 
            +
              s.add_development_dependency 'shoulda-context'
         | 
| 69 | 
            +
              s.add_development_dependency 'test-unit', '~> 2'
         | 
| 70 | 
            +
              s.add_development_dependency 'typhoeus', '~> 0.6'
         | 
| 71 | 
            +
              s.add_development_dependency 'yard'
         | 
| 72 | 
            +
              s.add_development_dependency 'bundler'
         | 
| 79 73 |  | 
| 80 74 | 
             
              s.description = <<-DESC.gsub(/^    /, '')
         | 
| 81 75 | 
             
                Ruby client for Elasticsearch. See the `elasticsearch` gem for full integration.
         |