pingram 1.0.40 → 1.0.41
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.lock +5 -5
- data/lib/pingram/api/account_api.rb +191 -4
- data/lib/pingram/api/webhooks_api.rb +6 -6
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/models/account_get_response_billing_alerts.rb +1 -1
- data/lib/pingram/models/account_payment_methods.rb +214 -0
- data/lib/pingram/models/account_payment_methods_payment_methods_inner.rb +270 -0
- data/lib/pingram/models/assign_payment_method_request.rb +216 -0
- data/lib/pingram/models/billing_post_response_body.rb +1 -1
- data/lib/pingram/models/confirm_change_email_request.rb +14 -4
- data/lib/pingram/models/confirm_change_email_response.rb +192 -0
- data/lib/pingram/models/confirm_password_change_request.rb +191 -0
- data/lib/pingram/models/create_payment_method_setup_request.rb +191 -0
- data/lib/pingram/models/list_invoices_response_invoices_inner.rb +1 -1
- data/lib/pingram/models/logs_get_response_logs_inner.rb +10 -1
- data/lib/pingram/models/password_status_response.rb +195 -0
- data/lib/pingram/models/payment_method_setup.rb +191 -0
- data/lib/pingram/models/sign_in_username_request.rb +164 -0
- data/lib/pingram/models/sign_in_username_response.rb +165 -0
- data/lib/pingram/models/start_change_email_request.rb +13 -20
- data/lib/pingram/models/start_password_change_request.rb +185 -0
- data/lib/pingram/models/webhook_endpoint.rb +14 -5
- data/lib/pingram/models/webhook_endpoint_basic_auth.rb +193 -0
- data/lib/pingram/models/webhook_endpoint_upsert_request.rb +15 -5
- data/lib/pingram/models/webhook_endpoint_upsert_request_basic_auth.rb +176 -0
- data/lib/pingram/models/webhook_endpoints_response_endpoints_inner.rb +14 -5
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +13 -0
- data/vendor/bundle/ruby/3.2.0/cache/ethon-0.19.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.5.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/typhoeus-1.7.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.6.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.4 → io-console-0.9.5}/gem_make.out +10 -10
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.5/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.4 → io-console-0.9.5}/mkmf.log +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/CHANGELOG.md +1120 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/README.md +261 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curl.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/classes.rb +337 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/codes.rb +28 -9
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/constants.rb +61 -4
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/form_options.rb +2 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/functions.rb +107 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/infos.rb +104 -5
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/introspection.rb +139 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/introspection_constants.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/mime.rb +187 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/optional.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/options.rb +298 -71
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/settings.rb +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/share.rb +165 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/share_constants.rb +47 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/url.rb +171 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/url_constants.rb +78 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/callbacks.rb +281 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/features.rb +4 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/files.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/form.rb +65 -6
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/header.rb +103 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/headers_api.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/actionable.rb +25 -3
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/get.rb +5 -1
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/post.rb +1 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/postable.rb +9 -2
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/http/putable.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http.rb +16 -4
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/informations.rb +51 -2
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/mime.rb +29 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/mirror.rb +49 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/operations.rb +317 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/options.rb +369 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/queryable.rb +59 -14
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/response_callbacks.rb +33 -12
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/share.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/url.rb +32 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/util.rb +47 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy.rb +185 -10
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/fork_safety.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/form_add.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/global_init.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/header.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/invalid_option.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/invalid_value.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/mime.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/multi_add.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_assign.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/multi_fdset.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_perform.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_poll.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/multi_remove.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/multi_timeout.rb +2 -2
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_wait.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_wakeup.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/select.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/set_option.rb +27 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/share.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/unsupported_option.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/url.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors.rb +13 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/libc.rb +50 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/loggable.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/multi/operations.rb +472 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/multi/options.rb +219 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/multi/stack.rb +220 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/multi.rb +51 -15
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/version.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon.rb +8 -9
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/ext/io/console/console.c +8 -3
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/ext/io/console/extconf.rb +7 -3
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.5/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/CHANGELOG.md +228 -1
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/README.md +766 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/UPGRADE.md +29 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/rack/typhoeus/middleware/params_decoder/helper.rb +129 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/rack/typhoeus/middleware/params_decoder.rb +8 -19
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/rack/typhoeus.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/adapters/faraday.rb +89 -28
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/cache/dalli.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/cache/rails.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/cache/redis.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/config.rb +51 -7
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/easy_factory.rb +129 -23
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/errors/invalid_option.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/errors/no_response.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/errors/no_stub.rb +8 -1
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/errors/typhoeus_error.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/errors.rb +4 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/expectation.rb +33 -1
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/hydra/queueable.rb +29 -4
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/hydra.rb +423 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/pool.rb +133 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/railtie.rb +4 -2
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/request/actions.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/request/callbacks.rb +11 -4
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/request/marshal.rb +5 -2
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/request/streamable.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/request.rb +510 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response/cacheable.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/response/header.rb +325 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response/informations.rb +75 -12
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response/status.rb +4 -13
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/version.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/typhoeus.gemspec +15 -3
- data/vendor/bundle/ruby/3.2.0/specifications/{ethon-0.18.0.gemspec → ethon-0.19.1.gemspec} +4 -4
- data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.4.gemspec → io-console-0.9.5.gemspec} +3 -3
- data/vendor/bundle/ruby/3.2.0/specifications/{typhoeus-1.6.0.gemspec → typhoeus-1.7.1.gemspec} +5 -5
- metadata +156 -129
- data/vendor/bundle/ruby/3.2.0/cache/ethon-0.18.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.4.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/typhoeus-1.6.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/CHANGELOG.md +0 -417
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/README.md +0 -118
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/curls/classes.rb +0 -65
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/curls/functions.rb +0 -58
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/curls/settings.rb +0 -12
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/callbacks.rb +0 -155
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/header.rb +0 -61
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/http/putable.rb +0 -25
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/mirror.rb +0 -36
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/operations.rb +0 -64
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/options.rb +0 -50
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/util.rb +0 -28
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/errors/invalid_value.rb +0 -13
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/libc.rb +0 -21
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/multi/operations.rb +0 -228
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/multi/options.rb +0 -117
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/multi/stack.rb +0 -49
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.4/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/README.md +0 -588
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/rack/typhoeus/middleware/params_decoder/helper.rb +0 -76
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/addable.rb +0 -23
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/before.rb +0 -31
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/block_connection.rb +0 -35
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/cacheable.rb +0 -15
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/memoizable.rb +0 -56
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/runnable.rb +0 -19
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/stubbable.rb +0 -28
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra.rb +0 -95
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/pool.rb +0 -70
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/before.rb +0 -30
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/block_connection.rb +0 -52
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/cacheable.rb +0 -38
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/memoizable.rb +0 -38
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/operations.rb +0 -40
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/responseable.rb +0 -29
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/stubbable.rb +0 -30
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request.rb +0 -223
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/response/header.rb +0 -105
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus.rb +0 -143
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.4 → io-console-0.9.5}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/ethon.gemspec +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/messages.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/debug_info.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/custom.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/delete.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/head.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/options.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/patch.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/put.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/params.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/ethon_error.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/.document +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/README.md +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/ext/io/console/Makefile +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/ext/io/console/win32_vk.inc +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/lib/io/console/size.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/CONTRIBUTING.md +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/LICENSE +0 -0
data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/actionable.rb
RENAMED
|
@@ -93,6 +93,18 @@ module Ethon
|
|
|
93
93
|
# @param [ easy ] easy the easy to setup.
|
|
94
94
|
def setup(easy)
|
|
95
95
|
@easy = easy
|
|
96
|
+
easy.customrequest = nil
|
|
97
|
+
# A reused handle keeps the previous transfer's method and body
|
|
98
|
+
# options. Clear them before applying this request so a stale
|
|
99
|
+
# upload body cannot win over the body configured below.
|
|
100
|
+
# CURLOPT_POSTFIELDS selects POST even when cleared, so clear it
|
|
101
|
+
# before the method flags to leave the handle on GET.
|
|
102
|
+
easy.postfields = nil
|
|
103
|
+
easy.readfunction = nil
|
|
104
|
+
Curl.set_option(:upload, false, easy.handle)
|
|
105
|
+
Curl.set_option(:httpget, false, easy.handle)
|
|
106
|
+
Curl.set_option(:nobody, false, easy.handle)
|
|
107
|
+
Curl.set_option(:post, false, easy.handle)
|
|
96
108
|
|
|
97
109
|
# Order is important, @easy will be used to provide access to options
|
|
98
110
|
# relevant to the following operations (like whether or not to escape
|
|
@@ -100,6 +112,12 @@ module Ethon
|
|
|
100
112
|
easy.set_attributes(options)
|
|
101
113
|
|
|
102
114
|
set_form(easy) unless form.empty?
|
|
115
|
+
if form.empty?
|
|
116
|
+
easy.multipart_form = nil
|
|
117
|
+
# Clear any MIME body left over from an earlier request (or copied
|
|
118
|
+
# by Easy#dup) so this request does not inherit it.
|
|
119
|
+
easy.mime = nil if Ethon::Curl.respond_to?(:mime_init)
|
|
120
|
+
end
|
|
103
121
|
|
|
104
122
|
if params.empty?
|
|
105
123
|
easy.url = url
|
|
@@ -118,11 +136,15 @@ module Ethon
|
|
|
118
136
|
params.escape = easy.escape?
|
|
119
137
|
params.params_encoding = params_encoding
|
|
120
138
|
|
|
121
|
-
|
|
139
|
+
url_without_fragment, fragment_separator, fragment = url.partition('#')
|
|
140
|
+
fragment = fragment_separator.empty? ? nil : "#{fragment_separator}#{fragment}"
|
|
141
|
+
base_url, query_separator, base_params = url_without_fragment.partition('?')
|
|
142
|
+
|
|
122
143
|
base_url << '?'
|
|
123
|
-
base_url << base_params
|
|
124
|
-
base_url << '&' if base_params
|
|
144
|
+
base_url << base_params
|
|
145
|
+
base_url << '&' if query_separator == '?' && !base_params.empty?
|
|
125
146
|
base_url << params.to_s
|
|
147
|
+
base_url << fragment.to_s
|
|
126
148
|
|
|
127
149
|
easy.url = base_url
|
|
128
150
|
end
|
data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/postable.rb
RENAMED
|
@@ -18,9 +18,16 @@ module Ethon
|
|
|
18
18
|
form.params_encoding = params_encoding
|
|
19
19
|
if form.multipart?
|
|
20
20
|
form.escape = false
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
if Ethon::Curl.respond_to?(:mime_init)
|
|
22
|
+
easy.multipart_form = nil
|
|
23
|
+
easy.mime = form.mime
|
|
24
|
+
else
|
|
25
|
+
form.materialize
|
|
26
|
+
easy.multipart_form = form
|
|
27
|
+
end
|
|
23
28
|
else
|
|
29
|
+
easy.multipart_form = nil
|
|
30
|
+
easy.mime = nil if Ethon::Curl.respond_to?(:mime_init)
|
|
24
31
|
form.escape = easy.escape?
|
|
25
32
|
easy.postfieldsize = form.to_s.bytesize
|
|
26
33
|
easy.copypostfields = form.to_s
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Ethon
|
|
3
|
+
class Easy
|
|
4
|
+
module Http
|
|
5
|
+
|
|
6
|
+
# This module contains logic about setting up a PUT body.
|
|
7
|
+
module Putable
|
|
8
|
+
# Set things up when form is provided.
|
|
9
|
+
# Deals with multipart forms.
|
|
10
|
+
#
|
|
11
|
+
# @example Setup.
|
|
12
|
+
# put.set_form(easy)
|
|
13
|
+
#
|
|
14
|
+
# @param [ Easy ] easy The easy to setup.
|
|
15
|
+
def set_form(easy)
|
|
16
|
+
easy.url ||= url
|
|
17
|
+
form.params_encoding = params_encoding
|
|
18
|
+
if form.multipart?
|
|
19
|
+
form.escape = false
|
|
20
|
+
if Ethon::Curl.respond_to?(:mime_init)
|
|
21
|
+
easy.multipart_form = nil
|
|
22
|
+
easy.mime = form.mime
|
|
23
|
+
else
|
|
24
|
+
form.materialize
|
|
25
|
+
easy.multipart_form = form
|
|
26
|
+
end
|
|
27
|
+
easy.customrequest = "PUT"
|
|
28
|
+
else
|
|
29
|
+
easy.multipart_form = nil
|
|
30
|
+
easy.mime = nil if Ethon::Curl.respond_to?(:mime_init)
|
|
31
|
+
easy.upload = true
|
|
32
|
+
form.escape = easy.escape?
|
|
33
|
+
easy.infilesize = form.to_s.bytesize
|
|
34
|
+
easy.set_read_callback(form.to_s)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -15,6 +15,18 @@ module Ethon
|
|
|
15
15
|
# This module contains logic about making valid HTTP requests.
|
|
16
16
|
module Http
|
|
17
17
|
|
|
18
|
+
# Built-in request actions. Custom verbs must not resolve to helper
|
|
19
|
+
# modules or classes that happen to live in this namespace.
|
|
20
|
+
ACTION_CLASSES = {
|
|
21
|
+
"get" => Get,
|
|
22
|
+
"head" => Head,
|
|
23
|
+
"post" => Post,
|
|
24
|
+
"put" => Put,
|
|
25
|
+
"delete" => Delete,
|
|
26
|
+
"patch" => Patch,
|
|
27
|
+
"options" => Options
|
|
28
|
+
}.freeze
|
|
29
|
+
|
|
18
30
|
# Set specified options in order to make a HTTP request.
|
|
19
31
|
# Look at {Ethon::Easy::Options Options} to see what you can
|
|
20
32
|
# provide in the options hash.
|
|
@@ -54,12 +66,12 @@ module Ethon
|
|
|
54
66
|
#
|
|
55
67
|
# @return [ Easy::Ethon::Actionable ] The request instance.
|
|
56
68
|
def fabricate(url, action_name, options)
|
|
57
|
-
|
|
69
|
+
action_class = ACTION_CLASSES[action_name.to_s.downcase]
|
|
58
70
|
|
|
59
|
-
if
|
|
60
|
-
|
|
71
|
+
if action_class
|
|
72
|
+
action_class.new(url, options)
|
|
61
73
|
else
|
|
62
|
-
Ethon::Easy::Http::Custom.new(
|
|
74
|
+
Ethon::Easy::Http::Custom.new(action_name.to_s.upcase, url, options)
|
|
63
75
|
end
|
|
64
76
|
end
|
|
65
77
|
|
data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/informations.rb
RENAMED
|
@@ -3,13 +3,52 @@ module Ethon
|
|
|
3
3
|
class Easy
|
|
4
4
|
|
|
5
5
|
# This module contains the methods to return informations
|
|
6
|
-
# from the easy handle. See
|
|
6
|
+
# from the easy handle. See https://curl.se/libcurl/c/curl_easy_getinfo.html
|
|
7
7
|
# for more information.
|
|
8
8
|
module Informations
|
|
9
9
|
|
|
10
10
|
# Holds available informations and their type, which is needed to
|
|
11
11
|
# request the informations from libcurl.
|
|
12
12
|
AVAILABLE_INFORMATIONS = {
|
|
13
|
+
# The _T variants use curl_off_t and do not lose precision for large
|
|
14
|
+
# values or long-running transfers.
|
|
15
|
+
:size_upload_t => :off_t,
|
|
16
|
+
:size_download_t => :off_t,
|
|
17
|
+
:speed_download_t => :off_t,
|
|
18
|
+
:speed_upload_t => :off_t,
|
|
19
|
+
:filetime_t => :off_t,
|
|
20
|
+
:content_length_download_t => :off_t,
|
|
21
|
+
:content_length_upload_t => :off_t,
|
|
22
|
+
:total_time_t => :off_t,
|
|
23
|
+
:namelookup_time_t => :off_t,
|
|
24
|
+
:connect_time_t => :off_t,
|
|
25
|
+
:pretransfer_time_t => :off_t,
|
|
26
|
+
:starttransfer_time_t => :off_t,
|
|
27
|
+
:redirect_time_t => :off_t,
|
|
28
|
+
:appconnect_time_t => :off_t,
|
|
29
|
+
:retry_after => :off_t,
|
|
30
|
+
:xfer_id => :off_t,
|
|
31
|
+
:conn_id => :off_t,
|
|
32
|
+
:queue_time_t => :off_t,
|
|
33
|
+
:posttransfer_time_t => :off_t,
|
|
34
|
+
:earlydata_sent_t => :off_t,
|
|
35
|
+
:size_delivered => :off_t,
|
|
36
|
+
|
|
37
|
+
# Connection/request metadata.
|
|
38
|
+
:http_version => :long,
|
|
39
|
+
:httpauth_used => :long,
|
|
40
|
+
:proxyauth_used => :long,
|
|
41
|
+
:proxy_ssl_verifyresult => :long,
|
|
42
|
+
:proxy_error => :long,
|
|
43
|
+
:used_proxy => :long,
|
|
44
|
+
:scheme => :string,
|
|
45
|
+
:effective_method => :string,
|
|
46
|
+
:referer => :string,
|
|
47
|
+
:cainfo => :string,
|
|
48
|
+
:capath => :string,
|
|
49
|
+
:activesocket => :socket,
|
|
50
|
+
:tls_ssl_ptr => :ptr,
|
|
51
|
+
|
|
13
52
|
# Return the available HTTP auth methods.
|
|
14
53
|
:httpauth_avail => :long,
|
|
15
54
|
|
|
@@ -95,10 +134,20 @@ module Ethon
|
|
|
95
134
|
:speed_download => :double
|
|
96
135
|
}
|
|
97
136
|
|
|
137
|
+
LIST_INFORMATIONS = [:ssl_engines, :cookielist].freeze
|
|
138
|
+
|
|
98
139
|
AVAILABLE_INFORMATIONS.each do |name, type|
|
|
99
140
|
eval %Q|def #{name}; Curl.send(:get_info_#{type}, :#{name}, handle); end|
|
|
100
141
|
end
|
|
101
142
|
|
|
143
|
+
LIST_INFORMATIONS.each do |name|
|
|
144
|
+
define_method(name) { Curl.get_info_slist(name, handle) }
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def certinfo
|
|
148
|
+
Curl.get_info_certinfo(:certinfo, handle)
|
|
149
|
+
end
|
|
150
|
+
|
|
102
151
|
# Returns true if this curl version supports zlib.
|
|
103
152
|
#
|
|
104
153
|
# @example Return wether zlib is supported.
|
|
@@ -107,7 +156,7 @@ module Ethon
|
|
|
107
156
|
# @return [ Boolean ] True if supported, else false.
|
|
108
157
|
# @deprecated Please use the static version instead
|
|
109
158
|
def supports_zlib?
|
|
110
|
-
Kernel.warn("Ethon: Easy#supports_zlib? is deprecated and will be removed, please use Easy
|
|
159
|
+
Kernel.warn("Ethon: Easy#supports_zlib? is deprecated and will be removed, please use Easy.supports_zlib? instead.")
|
|
111
160
|
Easy.supports_zlib?
|
|
112
161
|
end
|
|
113
162
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Ethon
|
|
3
|
+
class Easy
|
|
4
|
+
module Mime
|
|
5
|
+
attr_reader :mime
|
|
6
|
+
|
|
7
|
+
# Install a MIME structure as the request body.
|
|
8
|
+
#
|
|
9
|
+
# @param [ Ethon::Curl::Mime, nil ] mime The MIME structure.
|
|
10
|
+
#
|
|
11
|
+
# @raise [ TypeError ] If mime is not a MIME structure.
|
|
12
|
+
#
|
|
13
|
+
# @return [ Ethon::Curl::Mime, nil ] The MIME structure.
|
|
14
|
+
def mime=(mime)
|
|
15
|
+
unless mime.nil? || mime.is_a?(Curl::Mime)
|
|
16
|
+
raise TypeError, "expected an Ethon::Curl::Mime, got #{mime.class}"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
mime.check_pid! if mime
|
|
20
|
+
Curl.set_option(:mimepost, mime, handle)
|
|
21
|
+
@mime = mime
|
|
22
|
+
mime
|
|
23
|
+
end
|
|
24
|
+
alias mimepost= mime=
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
include Mime
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Ethon
|
|
3
|
+
class Easy
|
|
4
|
+
class Mirror
|
|
5
|
+
attr_reader :options
|
|
6
|
+
alias_method :to_hash, :options
|
|
7
|
+
|
|
8
|
+
# Raw pointers cannot be marshaled and point into native state that can
|
|
9
|
+
# go away when the handle is reset. Applications serialize a mirror (for
|
|
10
|
+
# example as a cached Typhoeus response), so leave them on the Easy.
|
|
11
|
+
INFORMATIONS_TO_MIRROR = Informations::AVAILABLE_INFORMATIONS.
|
|
12
|
+
reject { |_, type| type == :ptr }.keys +
|
|
13
|
+
[:return_code, :response_headers, :response_body, :debug_info, :error_message]
|
|
14
|
+
|
|
15
|
+
INFORMATIONS_TO_LOG = [:effective_url, :response_code, :return_code, :total_time]
|
|
16
|
+
|
|
17
|
+
# Credentials embedded in the URL are not useful in logs and may end up
|
|
18
|
+
# in a log aggregator. Keep the scheme and host so the line is still
|
|
19
|
+
# identifiable, but replace the userinfo.
|
|
20
|
+
URL_CREDENTIALS = %r{\A([a-z][a-z0-9+.-]*://)[^/?#@]*@}i
|
|
21
|
+
|
|
22
|
+
def self.from_easy(easy)
|
|
23
|
+
options = {}
|
|
24
|
+
INFORMATIONS_TO_MIRROR.each do |info|
|
|
25
|
+
options[info] = easy.send(info)
|
|
26
|
+
end
|
|
27
|
+
new(options)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def initialize(options = {})
|
|
31
|
+
@options = options
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def log_informations
|
|
35
|
+
Hash[*INFORMATIONS_TO_LOG.map do |info|
|
|
36
|
+
value = options[info]
|
|
37
|
+
if info == :effective_url && value.is_a?(String)
|
|
38
|
+
value = value.sub(URL_CREDENTIALS, "\\1[REDACTED]@")
|
|
39
|
+
end
|
|
40
|
+
[info, value]
|
|
41
|
+
end.flatten]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
INFORMATIONS_TO_MIRROR.each do |info|
|
|
45
|
+
define_method(info) { options[info] }
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module Ethon
|
|
3
|
+
class Easy
|
|
4
|
+
# This module contains the logic to prepare and perform
|
|
5
|
+
# an easy.
|
|
6
|
+
module Operations
|
|
7
|
+
# Returns a pointer to the curl easy handle.
|
|
8
|
+
#
|
|
9
|
+
# @example Return the handle.
|
|
10
|
+
# easy.handle
|
|
11
|
+
#
|
|
12
|
+
# @return [ Ethon::Curl::EasyHandle ] The owned wrapper around the curl
|
|
13
|
+
# easy handle. It is an FFI::Pointer subclass.
|
|
14
|
+
def handle
|
|
15
|
+
raise Errors::EthonError, "Easy has been cleaned up" if @cleaned_up
|
|
16
|
+
|
|
17
|
+
@handle ||= create_handle
|
|
18
|
+
handle = @handle
|
|
19
|
+
handle.check_pid!
|
|
20
|
+
handle.owner ||= self
|
|
21
|
+
handle
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Sets a pointer to the curl easy handle.
|
|
25
|
+
#
|
|
26
|
+
# Raw pointers are wrapped in an owned {Curl::EasyHandle}, so the
|
|
27
|
+
# handle is registered for fork safety and freed by this Easy. Assigning
|
|
28
|
+
# nil installs a fresh handle. Assigning a different handle installs
|
|
29
|
+
# Ethon's response callbacks and replays callbacks previously assigned to
|
|
30
|
+
# this Easy, then frees the handle it replaces when this Easy owned it.
|
|
31
|
+
#
|
|
32
|
+
# Request options that are not replayed are cleared, because the
|
|
33
|
+
# replacement handle does not have them. Read them before replacing the
|
|
34
|
+
# handle if they are needed again.
|
|
35
|
+
#
|
|
36
|
+
# @param [ ::FFI::Pointer, Curl::EasyHandle, nil ] h Easy handle that will
|
|
37
|
+
# be assigned.
|
|
38
|
+
def handle=(h)
|
|
39
|
+
assign_handle(h, true)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Perform the easy request.
|
|
43
|
+
#
|
|
44
|
+
# @example Perform the request.
|
|
45
|
+
# easy.perform
|
|
46
|
+
#
|
|
47
|
+
# @return [ Symbol ] The return code.
|
|
48
|
+
def perform
|
|
49
|
+
ensure_not_performing!
|
|
50
|
+
# curl_easy_perform must not drive a handle that is owned by a multi.
|
|
51
|
+
ensure_not_attached_to_multi!
|
|
52
|
+
# Touch the handle before changing transfer state so a cleaned up or
|
|
53
|
+
# forked handle cannot truncate a response file or reset the previous
|
|
54
|
+
# result while raising.
|
|
55
|
+
handle
|
|
56
|
+
|
|
57
|
+
prepare_response_body_io
|
|
58
|
+
reset_transfer_state
|
|
59
|
+
clear_callback_error
|
|
60
|
+
# Only the destination that belongs to this transfer may be finished.
|
|
61
|
+
# A completion callback can install the next transfer's destination.
|
|
62
|
+
response_body_io = @response_body_io
|
|
63
|
+
@performing = true
|
|
64
|
+
|
|
65
|
+
error = nil
|
|
66
|
+
begin
|
|
67
|
+
code = Curl.easy_perform(handle)
|
|
68
|
+
@return_code = code
|
|
69
|
+
if Ethon.logger.debug?
|
|
70
|
+
Ethon.logger.debug { "ETHON: performed #{log_inspect}" }
|
|
71
|
+
end
|
|
72
|
+
# Make the complete response visible before on_complete runs. An
|
|
73
|
+
# owned file is closed by the ensure below after the callbacks.
|
|
74
|
+
begin
|
|
75
|
+
flush_response_body_io
|
|
76
|
+
rescue Exception
|
|
77
|
+
# A callback error already failed this transfer; a flush error is
|
|
78
|
+
# secondary and must not hide it.
|
|
79
|
+
raise_callback_error
|
|
80
|
+
raise
|
|
81
|
+
end
|
|
82
|
+
complete
|
|
83
|
+
raise_callback_error
|
|
84
|
+
# on_complete may reset the Easy, which clears @return_code. Return
|
|
85
|
+
# the result of the transfer that just ran.
|
|
86
|
+
code
|
|
87
|
+
rescue Exception => exception
|
|
88
|
+
error = exception
|
|
89
|
+
raise
|
|
90
|
+
ensure
|
|
91
|
+
@performing = false
|
|
92
|
+
begin
|
|
93
|
+
finish_response_body_io(response_body_io)
|
|
94
|
+
rescue Exception
|
|
95
|
+
# Keep the exception that interrupted the transfer or completion.
|
|
96
|
+
raise unless error
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Clean up the easy.
|
|
102
|
+
#
|
|
103
|
+
# Cleanup is terminal: the native handle is freed and the Easy cannot be
|
|
104
|
+
# used again. Reusing it raises Ethon::Errors::EthonError.
|
|
105
|
+
#
|
|
106
|
+
# Cleanup is allowed from an on_complete callback: the transfer has
|
|
107
|
+
# finished and a Multi detaches the handle before running its callbacks.
|
|
108
|
+
# Cleanup from body, header, and progress callbacks is rejected because
|
|
109
|
+
# those run inside libcurl.
|
|
110
|
+
#
|
|
111
|
+
# @example Perform clean up.
|
|
112
|
+
# easy.cleanup
|
|
113
|
+
#
|
|
114
|
+
# @return the result of the free which is nil
|
|
115
|
+
def cleanup
|
|
116
|
+
ensure_not_in_transfer!
|
|
117
|
+
ensure_not_attached_to_multi!
|
|
118
|
+
|
|
119
|
+
# Resolve the handle first: cleanup must not clear the response body if
|
|
120
|
+
# the handle is unusable (cleaned up or inherited across a fork).
|
|
121
|
+
handle_to_free = handle
|
|
122
|
+
begin
|
|
123
|
+
clear_response_body_io
|
|
124
|
+
ensure
|
|
125
|
+
# Free the native handle even when closing the response body fails.
|
|
126
|
+
begin
|
|
127
|
+
handle_to_free.free
|
|
128
|
+
ensure
|
|
129
|
+
clear_native_state
|
|
130
|
+
@handle = nil
|
|
131
|
+
@cleaned_up = true
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Prepare the easy. Options, headers and callbacks
|
|
137
|
+
# were set.
|
|
138
|
+
#
|
|
139
|
+
# @example Prepare easy.
|
|
140
|
+
# easy.prepare
|
|
141
|
+
#
|
|
142
|
+
# @deprecated It is no longer necessary to call prepare.
|
|
143
|
+
def prepare
|
|
144
|
+
Ethon.logger.warn(
|
|
145
|
+
"ETHON: It is no longer necessary to call "+
|
|
146
|
+
"Easy#prepare. It's going to be removed "+
|
|
147
|
+
"in future versions."
|
|
148
|
+
)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
private
|
|
152
|
+
|
|
153
|
+
# Allocate the native handle. Kept separate so #handle= can replace a
|
|
154
|
+
# handle and install the callbacks before the next option setter runs.
|
|
155
|
+
def create_handle
|
|
156
|
+
Curl.check_pid!
|
|
157
|
+
pointer = Curl.easy_init
|
|
158
|
+
raise NoMemoryError, "curl_easy_init failed" if pointer.null?
|
|
159
|
+
Curl::EasyHandle.new(pointer)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Reapply options Ethon installed on the old handle. These are not user
|
|
163
|
+
# request options: without them #error_message and progress callbacks
|
|
164
|
+
# silently stop working on the replacement.
|
|
165
|
+
def restore_handle_options
|
|
166
|
+
if @error_buffer_enabled && @error_buffer
|
|
167
|
+
Curl.set_option(:errorbuffer, @error_buffer, @handle)
|
|
168
|
+
@handle.error_buffer = @error_buffer
|
|
169
|
+
# Do not report the previous transfer's error from the new handle.
|
|
170
|
+
@error_buffer.put_char(0, 0)
|
|
171
|
+
end
|
|
172
|
+
self.noprogress = @noprogress_value unless @noprogress_value.nil?
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Install a handle and, unless the native duplicate already carries the
|
|
176
|
+
# request options, clear the Ruby-side state that belonged to the handle
|
|
177
|
+
# it replaces.
|
|
178
|
+
def assign_handle(h, clear_state)
|
|
179
|
+
raise Errors::EthonError, "Easy has been cleaned up" if @cleaned_up
|
|
180
|
+
|
|
181
|
+
ensure_not_performing!
|
|
182
|
+
ensure_not_attached_to_multi!
|
|
183
|
+
|
|
184
|
+
previous = @handle
|
|
185
|
+
@handle =
|
|
186
|
+
case h
|
|
187
|
+
when nil
|
|
188
|
+
# Create the replacement now so it gets Ethon's callbacks even
|
|
189
|
+
# before an option setter or #perform touches it.
|
|
190
|
+
create_handle
|
|
191
|
+
when Curl::EasyHandle
|
|
192
|
+
h.check_pid!
|
|
193
|
+
# Two Easies must not share one owned wrapper: whichever cleans up
|
|
194
|
+
# first invalidates the handle for the other.
|
|
195
|
+
if h.owner && !h.owner.equal?(self)
|
|
196
|
+
raise ArgumentError, "easy handle is already owned by another Ethon handle"
|
|
197
|
+
end
|
|
198
|
+
h
|
|
199
|
+
when Curl::OwnedPointer
|
|
200
|
+
raise TypeError, "expected an easy handle, got #{h.class}"
|
|
201
|
+
when ::FFI::Pointer
|
|
202
|
+
raise ArgumentError, "cannot assign a null easy handle" if h.null?
|
|
203
|
+
|
|
204
|
+
Curl::EasyHandle.new(h)
|
|
205
|
+
else
|
|
206
|
+
raise TypeError, "expected an easy handle pointer, got #{h.class}"
|
|
207
|
+
end
|
|
208
|
+
@handle.owner = self if @handle
|
|
209
|
+
|
|
210
|
+
replaced = @handle && !@handle.equal?(previous)
|
|
211
|
+
if replaced
|
|
212
|
+
# A replacement handle has no Ethon callbacks or Ethon-managed
|
|
213
|
+
# options, so its response would otherwise not be collected. Retained
|
|
214
|
+
# user callbacks are replayed on top of the internal ones.
|
|
215
|
+
install_callbacks(@handle)
|
|
216
|
+
restore_handle_options
|
|
217
|
+
restore_callbacks_on(self)
|
|
218
|
+
end
|
|
219
|
+
release_replaced_handle(previous)
|
|
220
|
+
# Free the old handle before dropping the Ruby references it owned.
|
|
221
|
+
clear_replaced_handle_state if replaced && clear_state
|
|
222
|
+
@handle
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# The replacement handle does not have the old handle's request options.
|
|
226
|
+
# Clear the Ruby-side state so the accessors do not describe options the
|
|
227
|
+
# new handle never received. Callbacks, the error buffer, and the
|
|
228
|
+
# progress setting are replayed by #assign_handle and stay in place.
|
|
229
|
+
def clear_replaced_handle_state
|
|
230
|
+
@url = nil
|
|
231
|
+
@headers = nil
|
|
232
|
+
@header_list = nil
|
|
233
|
+
@postfields = nil
|
|
234
|
+
@postfields_pointer = nil
|
|
235
|
+
@postfield_body_size = nil
|
|
236
|
+
@postfieldsize_value = nil
|
|
237
|
+
@curlu = nil
|
|
238
|
+
@mime = nil
|
|
239
|
+
@multipart_form = nil
|
|
240
|
+
@slists = nil
|
|
241
|
+
@blobs = nil
|
|
242
|
+
@share = nil
|
|
243
|
+
@escape = nil
|
|
244
|
+
@multipart = nil
|
|
245
|
+
reset_transfer_state
|
|
246
|
+
clear_callback_error
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Free the handle this Easy owned before the replacement. A handle owned
|
|
250
|
+
# by another Easy (the source of #dup) must stay alive for its owner.
|
|
251
|
+
def release_replaced_handle(previous)
|
|
252
|
+
return unless previous
|
|
253
|
+
return if previous.equal?(@handle)
|
|
254
|
+
return unless previous.owner.equal?(self)
|
|
255
|
+
|
|
256
|
+
previous.free
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Drop references to native data and callbacks once the handle is gone.
|
|
260
|
+
def clear_native_state
|
|
261
|
+
@body_write_callback = nil
|
|
262
|
+
@header_write_callback = nil
|
|
263
|
+
@debug_callback = nil
|
|
264
|
+
@progress_callback = nil
|
|
265
|
+
@read_callback = nil
|
|
266
|
+
@request_body = nil
|
|
267
|
+
@request_body_start = nil
|
|
268
|
+
@postfields = nil
|
|
269
|
+
@postfields_pointer = nil
|
|
270
|
+
@postfield_body_size = nil
|
|
271
|
+
@postfieldsize_value = nil
|
|
272
|
+
@header_list = nil
|
|
273
|
+
@multipart_form = nil
|
|
274
|
+
@mime = nil
|
|
275
|
+
@curlu = nil
|
|
276
|
+
@blobs = nil
|
|
277
|
+
@slists = nil
|
|
278
|
+
@procs = nil
|
|
279
|
+
@on_complete = nil
|
|
280
|
+
@on_headers = nil
|
|
281
|
+
@on_body = nil
|
|
282
|
+
@on_progress = nil
|
|
283
|
+
@progress_source = nil
|
|
284
|
+
@internal_progress_option = nil
|
|
285
|
+
@user_debug_callback = nil
|
|
286
|
+
@share = nil
|
|
287
|
+
@error_buffer = nil
|
|
288
|
+
@error_buffer_enabled = nil
|
|
289
|
+
@noprogress_value = nil
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
def ensure_not_performing!
|
|
293
|
+
if @completing
|
|
294
|
+
raise Errors::EthonError, "Easy is currently completing; wait for the callbacks to finish"
|
|
295
|
+
end
|
|
296
|
+
if @performing
|
|
297
|
+
raise Errors::EthonError, "Easy is currently performing; wait for the transfer to finish"
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Resetting is safe from a completion callback: the transfer has already
|
|
302
|
+
# finished and the handle no longer belongs to a Multi. A reset from a
|
|
303
|
+
# body, header, or progress callback still runs inside libcurl.
|
|
304
|
+
def ensure_not_in_transfer!
|
|
305
|
+
return if @completing
|
|
306
|
+
|
|
307
|
+
ensure_not_performing!
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
def ensure_not_attached_to_multi!
|
|
311
|
+
return unless defined?(@multi) && @multi
|
|
312
|
+
|
|
313
|
+
raise Errors::EthonError, "Easy is still attached to a Multi; remove it first"
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
end
|