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
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Hydra
|
|
3
|
-
|
|
4
|
-
# This module provides a way to hook into before
|
|
5
|
-
# a request gets queued in hydra. This is very powerful
|
|
6
|
-
# and you should be careful because when you accidently
|
|
7
|
-
# return a falsy value the request won't be executed.
|
|
8
|
-
#
|
|
9
|
-
# @api private
|
|
10
|
-
module Before
|
|
11
|
-
|
|
12
|
-
# Overrride add in order to execute callbacks in
|
|
13
|
-
# Typhoeus.before. Will break and return when a
|
|
14
|
-
# callback returns nil, false or a response. Calls super
|
|
15
|
-
# otherwise.
|
|
16
|
-
#
|
|
17
|
-
# @example Add the request.
|
|
18
|
-
# hydra.add(request)
|
|
19
|
-
def add(request)
|
|
20
|
-
Typhoeus.before.each do |callback|
|
|
21
|
-
value = callback.call(request)
|
|
22
|
-
if value.nil? || value == false || value.is_a?(Response)
|
|
23
|
-
dequeue
|
|
24
|
-
return value
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
super
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Hydra
|
|
3
|
-
|
|
4
|
-
# This module handles the blocked connection request mode on
|
|
5
|
-
# the hydra side, where only stubbed requests
|
|
6
|
-
# are allowed.
|
|
7
|
-
# Connection blocking needs to be turned on:
|
|
8
|
-
# Typhoeus.configure do |config|
|
|
9
|
-
# config.block_connection = true
|
|
10
|
-
# end
|
|
11
|
-
#
|
|
12
|
-
# When trying to do real requests a NoStub error
|
|
13
|
-
# is raised.
|
|
14
|
-
#
|
|
15
|
-
# @api private
|
|
16
|
-
module BlockConnection
|
|
17
|
-
|
|
18
|
-
# Overrides add in order to check before if block connection
|
|
19
|
-
# is turned on. If thats the case a NoStub error is
|
|
20
|
-
# raised.
|
|
21
|
-
#
|
|
22
|
-
# @example Add the request.
|
|
23
|
-
# hydra.add(request)
|
|
24
|
-
#
|
|
25
|
-
# @param [ Request ] request The request to enqueue.
|
|
26
|
-
def add(request)
|
|
27
|
-
if request.blocked?
|
|
28
|
-
raise Typhoeus::Errors::NoStub.new(request)
|
|
29
|
-
else
|
|
30
|
-
super
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Hydra
|
|
3
|
-
|
|
4
|
-
# This module handles the GET request memoization
|
|
5
|
-
# on the hydra side. Memoization needs to be turned
|
|
6
|
-
# on:
|
|
7
|
-
# Typhoeus.configure do |config|
|
|
8
|
-
# config.memoize = true
|
|
9
|
-
# end
|
|
10
|
-
#
|
|
11
|
-
# @api private
|
|
12
|
-
module Memoizable
|
|
13
|
-
|
|
14
|
-
# Return the memory.
|
|
15
|
-
#
|
|
16
|
-
# @example Return the memory.
|
|
17
|
-
# hydra.memory
|
|
18
|
-
#
|
|
19
|
-
# @return [ Hash ] The memory.
|
|
20
|
-
def memory
|
|
21
|
-
@memory ||= {}
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Overrides add in order to check before if request
|
|
25
|
-
# is memoizable and already in memory. If thats the case,
|
|
26
|
-
# super is not called, instead the response is set and
|
|
27
|
-
# the on_complete callback called.
|
|
28
|
-
#
|
|
29
|
-
# @example Add the request.
|
|
30
|
-
# hydra.add(request)
|
|
31
|
-
#
|
|
32
|
-
# @param [ Request ] request The request to add.
|
|
33
|
-
#
|
|
34
|
-
# @return [ Request ] The added request.
|
|
35
|
-
def add(request)
|
|
36
|
-
if request.memoizable? && memory.has_key?(request)
|
|
37
|
-
response = memory[request]
|
|
38
|
-
request.finish(response, true)
|
|
39
|
-
dequeue
|
|
40
|
-
else
|
|
41
|
-
super
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# Overrides run to make sure the memory is cleared after
|
|
46
|
-
# each run.
|
|
47
|
-
#
|
|
48
|
-
# @example Run hydra.
|
|
49
|
-
# hydra.run
|
|
50
|
-
def run
|
|
51
|
-
super
|
|
52
|
-
memory.clear
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Hydra
|
|
3
|
-
|
|
4
|
-
# This module contains logic to run a hydra.
|
|
5
|
-
module Runnable
|
|
6
|
-
|
|
7
|
-
# Start the hydra run.
|
|
8
|
-
#
|
|
9
|
-
# @example Start hydra run.
|
|
10
|
-
# hydra.run
|
|
11
|
-
#
|
|
12
|
-
# @return [ Symbol ] Return value from multi.perform.
|
|
13
|
-
def run
|
|
14
|
-
dequeue_many
|
|
15
|
-
multi.perform
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Hydra
|
|
3
|
-
|
|
4
|
-
# This module handles stubbing on the hydra side.
|
|
5
|
-
# It plays well with the block_connection configuration,
|
|
6
|
-
# which raises when you make a request which is not stubbed.
|
|
7
|
-
#
|
|
8
|
-
# @api private
|
|
9
|
-
module Stubbable
|
|
10
|
-
|
|
11
|
-
# Override add in order to check for matching expecations.
|
|
12
|
-
# When an expecation is found, super is not called. Instead a
|
|
13
|
-
# canned response is assigned to the request.
|
|
14
|
-
#
|
|
15
|
-
# @example Add the request.
|
|
16
|
-
# hydra.add(request)
|
|
17
|
-
def add(request)
|
|
18
|
-
if response = Expectation.response_for(request)
|
|
19
|
-
request.execute_headers_callbacks(response)
|
|
20
|
-
request.on_body.each{ |callback| callback.call(response.body, response) }
|
|
21
|
-
request.finish(response)
|
|
22
|
-
else
|
|
23
|
-
super
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
require 'typhoeus/hydra/addable'
|
|
2
|
-
require 'typhoeus/hydra/before'
|
|
3
|
-
require 'typhoeus/hydra/cacheable'
|
|
4
|
-
require 'typhoeus/hydra/block_connection'
|
|
5
|
-
require 'typhoeus/hydra/memoizable'
|
|
6
|
-
require 'typhoeus/hydra/queueable'
|
|
7
|
-
require 'typhoeus/hydra/runnable'
|
|
8
|
-
require 'typhoeus/hydra/stubbable'
|
|
9
|
-
|
|
10
|
-
module Typhoeus
|
|
11
|
-
|
|
12
|
-
# Hydra manages making parallel HTTP requests. This
|
|
13
|
-
# is achieved by using libcurls multi interface:
|
|
14
|
-
# http://curl.haxx.se/libcurl/c/libcurl-multi.html
|
|
15
|
-
# The benefits are that you don't have to worry running
|
|
16
|
-
# the requests by yourself.
|
|
17
|
-
#
|
|
18
|
-
# Hydra will also handle how many requests you can
|
|
19
|
-
# make in parallel. Things will get flakey if you
|
|
20
|
-
# try to make too many requests at the same time.
|
|
21
|
-
# The built in limit is 200. When more requests than
|
|
22
|
-
# that are queued up, hydra will save them for later
|
|
23
|
-
# and start the requests as others are finished. You
|
|
24
|
-
# can raise or lower the concurrency limit through
|
|
25
|
-
# the Hydra constructor.
|
|
26
|
-
#
|
|
27
|
-
# Regarding the asynchronous behavior of the hydra,
|
|
28
|
-
# it is important to know that this is completely hidden
|
|
29
|
-
# from the developer and you are free to apply
|
|
30
|
-
# whatever technique you want to your code. That should not
|
|
31
|
-
# conflict with libcurls internal concurrency mechanism.
|
|
32
|
-
#
|
|
33
|
-
# @example Use the hydra to do multiple requests.
|
|
34
|
-
# hydra = Typhoeus::Hydra.new
|
|
35
|
-
# requests = (0..9).map{ Typhoeus::Request.new("www.example.com") }
|
|
36
|
-
# requests.each{ |request| hydra.queue(request) }
|
|
37
|
-
# hydra.run
|
|
38
|
-
#
|
|
39
|
-
# @note Callbacks are going to delay the request
|
|
40
|
-
# execution.
|
|
41
|
-
class Hydra
|
|
42
|
-
include Hydra::Addable
|
|
43
|
-
include Hydra::Runnable
|
|
44
|
-
include Hydra::Memoizable
|
|
45
|
-
include Hydra::Cacheable
|
|
46
|
-
include Hydra::BlockConnection
|
|
47
|
-
include Hydra::Stubbable
|
|
48
|
-
include Hydra::Before
|
|
49
|
-
include Hydra::Queueable
|
|
50
|
-
|
|
51
|
-
# @example Set max_concurrency.
|
|
52
|
-
# Typhoeus::Hydra.new(max_concurrency: 20)
|
|
53
|
-
attr_accessor :max_concurrency
|
|
54
|
-
|
|
55
|
-
# @api private
|
|
56
|
-
attr_reader :multi
|
|
57
|
-
|
|
58
|
-
class << self
|
|
59
|
-
|
|
60
|
-
# Returns a memoized hydra instance.
|
|
61
|
-
#
|
|
62
|
-
# @example Get a hydra.
|
|
63
|
-
# Typhoeus::Hydra.hydra
|
|
64
|
-
#
|
|
65
|
-
# @return [Typhoeus::Hydra] A new hydra.
|
|
66
|
-
def hydra
|
|
67
|
-
Thread.current[:typhoeus_hydra] ||= new
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
# Create a new hydra. All
|
|
72
|
-
# {http://rubydoc.info/github/typhoeus/ethon/Ethon/Multi#initialize-instance_method Ethon::Multi#initialize}
|
|
73
|
-
# options are also available.
|
|
74
|
-
#
|
|
75
|
-
# @example Create a hydra.
|
|
76
|
-
# Typhoeus::Hydra.new
|
|
77
|
-
#
|
|
78
|
-
# @example Create a hydra with max_concurrency.
|
|
79
|
-
# Typhoeus::Hydra.new(max_concurrency: 20)
|
|
80
|
-
#
|
|
81
|
-
# @param [ Hash ] options The options hash.
|
|
82
|
-
#
|
|
83
|
-
# @option options :max_concurrency [ Integer ] Number
|
|
84
|
-
# of max concurrent connections to create. Default is
|
|
85
|
-
# 200.
|
|
86
|
-
#
|
|
87
|
-
# @see http://rubydoc.info/github/typhoeus/ethon/Ethon/Multi#initialize-instance_method
|
|
88
|
-
# Ethon::Multi#initialize
|
|
89
|
-
def initialize(options = {})
|
|
90
|
-
@options = options
|
|
91
|
-
@max_concurrency = Integer(@options.fetch(:max_concurrency, 200))
|
|
92
|
-
@multi = Ethon::Multi.new(options.reject{|k,_| k==:max_concurrency})
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
require 'thread'
|
|
2
|
-
|
|
3
|
-
module Typhoeus
|
|
4
|
-
|
|
5
|
-
# The easy pool stores already initialized
|
|
6
|
-
# easy handles for future use. This is useful
|
|
7
|
-
# because creating them is expensive.
|
|
8
|
-
#
|
|
9
|
-
# @api private
|
|
10
|
-
module Pool
|
|
11
|
-
@mutex = Mutex.new
|
|
12
|
-
@pid = Process.pid
|
|
13
|
-
|
|
14
|
-
# Releases easy into the pool. The easy handle is
|
|
15
|
-
# reset before it gets back in.
|
|
16
|
-
#
|
|
17
|
-
# @example Release easy.
|
|
18
|
-
# Typhoeus::Pool.release(easy)
|
|
19
|
-
def self.release(easy)
|
|
20
|
-
easy.cookielist = "flush" # dump all known cookies to 'cookiejar'
|
|
21
|
-
easy.cookielist = "all" # remove all cookies from memory for this handle
|
|
22
|
-
easy.reset
|
|
23
|
-
@mutex.synchronize { easies << easy }
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# Return an easy from the pool.
|
|
27
|
-
#
|
|
28
|
-
# @example Return easy.
|
|
29
|
-
# Typhoeus::Pool.get
|
|
30
|
-
#
|
|
31
|
-
# @return [ Ethon::Easy ] The easy.
|
|
32
|
-
def self.get
|
|
33
|
-
@mutex.synchronize do
|
|
34
|
-
if @pid == Process.pid
|
|
35
|
-
easies.pop
|
|
36
|
-
else
|
|
37
|
-
# Process has forked. Clear all easies to avoid sockets being
|
|
38
|
-
# shared between processes.
|
|
39
|
-
@pid = Process.pid
|
|
40
|
-
easies.clear
|
|
41
|
-
nil
|
|
42
|
-
end
|
|
43
|
-
end || Ethon::Easy.new
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# Clear the pool
|
|
47
|
-
def self.clear
|
|
48
|
-
@mutex.synchronize { easies.clear }
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# Use yielded easy, will be released automatically afterwards.
|
|
52
|
-
#
|
|
53
|
-
# @example Use easy.
|
|
54
|
-
# Typhoeus::Pool.with_easy do |easy|
|
|
55
|
-
# # use easy
|
|
56
|
-
# end
|
|
57
|
-
def self.with_easy(&block)
|
|
58
|
-
easy = get
|
|
59
|
-
yield easy
|
|
60
|
-
ensure
|
|
61
|
-
release(easy) if easy
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
private
|
|
65
|
-
|
|
66
|
-
def self.easies
|
|
67
|
-
@easies ||= []
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Request
|
|
3
|
-
|
|
4
|
-
# This module provides a way to hook into before
|
|
5
|
-
# a request runs. This is very powerful
|
|
6
|
-
# and you should be careful because when you accidently
|
|
7
|
-
# return a falsy value the request won't be executed.
|
|
8
|
-
#
|
|
9
|
-
# @api private
|
|
10
|
-
module Before
|
|
11
|
-
|
|
12
|
-
# Overrride run in order to execute callbacks in
|
|
13
|
-
# Typhoeus.before. Will break and return when a
|
|
14
|
-
# callback returns nil or false. Calls super
|
|
15
|
-
# otherwise.
|
|
16
|
-
#
|
|
17
|
-
# @example Run the request.
|
|
18
|
-
# request.run
|
|
19
|
-
def run
|
|
20
|
-
Typhoeus.before.each do |callback|
|
|
21
|
-
value = callback.call(self)
|
|
22
|
-
if value.nil? || value == false || value.is_a?(Response)
|
|
23
|
-
return response
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
super
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Request
|
|
3
|
-
|
|
4
|
-
# This module handles the blocked connection request mode on
|
|
5
|
-
# the request side, where only stubbed requests
|
|
6
|
-
# are allowed.
|
|
7
|
-
# Connection blocking needs to be turned on:
|
|
8
|
-
# Typhoeus.configure do |config|
|
|
9
|
-
# config.block_connection = true
|
|
10
|
-
# end
|
|
11
|
-
#
|
|
12
|
-
# When trying to do real requests a NoStub error
|
|
13
|
-
# is raised.
|
|
14
|
-
#
|
|
15
|
-
# @api private
|
|
16
|
-
module BlockConnection
|
|
17
|
-
|
|
18
|
-
# Overrides run in order to check before if block connection
|
|
19
|
-
# is turned on. If thats the case a NoStub error is
|
|
20
|
-
# raised.
|
|
21
|
-
#
|
|
22
|
-
# @example Run request.
|
|
23
|
-
# request.run
|
|
24
|
-
#
|
|
25
|
-
# @raise [Typhoeus::Errors::NoStub] If connection is blocked
|
|
26
|
-
# and no stub defined.
|
|
27
|
-
def run
|
|
28
|
-
if blocked?
|
|
29
|
-
raise Typhoeus::Errors::NoStub.new(self)
|
|
30
|
-
else
|
|
31
|
-
super
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Returns wether a request is blocked or not. Takes
|
|
36
|
-
# request.block_connection and Typhoeus::Config.block_connection
|
|
37
|
-
# into consideration.
|
|
38
|
-
#
|
|
39
|
-
# @example Blocked?
|
|
40
|
-
# request.blocked?
|
|
41
|
-
#
|
|
42
|
-
# @return [ Boolean ] True if blocked, false else.
|
|
43
|
-
def blocked?
|
|
44
|
-
if block_connection.nil?
|
|
45
|
-
Typhoeus::Config.block_connection
|
|
46
|
-
else
|
|
47
|
-
block_connection
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Request
|
|
3
|
-
module Cacheable
|
|
4
|
-
def response=(response)
|
|
5
|
-
cache.set(self, response) if cacheable? && !response.cached?
|
|
6
|
-
super
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def cacheable?
|
|
10
|
-
cache
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def run
|
|
14
|
-
if response = cached_response
|
|
15
|
-
response.cached = true
|
|
16
|
-
finish(response)
|
|
17
|
-
else
|
|
18
|
-
super
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def cached_response
|
|
23
|
-
cacheable? && cache.get(self)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def cache_ttl
|
|
27
|
-
options[:cache_ttl]
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
def cache
|
|
33
|
-
return nil if options[:cache] === false
|
|
34
|
-
options[:cache] || Typhoeus::Config.cache
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Request
|
|
3
|
-
|
|
4
|
-
# This module handles the GET request memoization
|
|
5
|
-
# on the request side. Memoization needs to be turned
|
|
6
|
-
# on:
|
|
7
|
-
# Typhoeus.configure do |config|
|
|
8
|
-
# config.memoize = true
|
|
9
|
-
# end
|
|
10
|
-
#
|
|
11
|
-
# @api private
|
|
12
|
-
module Memoizable
|
|
13
|
-
|
|
14
|
-
# Override response setter and memoizes response
|
|
15
|
-
# if the request is memoizable.
|
|
16
|
-
#
|
|
17
|
-
# @param [ Response ] response The response to set.
|
|
18
|
-
#
|
|
19
|
-
# @example Set response.
|
|
20
|
-
# request.response = response
|
|
21
|
-
def response=(response)
|
|
22
|
-
hydra.memory[self] = response if memoizable?
|
|
23
|
-
super
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# Return whether a request is memoizable.
|
|
27
|
-
#
|
|
28
|
-
# @example Is request memoizable?
|
|
29
|
-
# request.memoizable?
|
|
30
|
-
#
|
|
31
|
-
# @return [ Boolean ] Return true if memoizable, false else.
|
|
32
|
-
def memoizable?
|
|
33
|
-
Typhoeus::Config.memoize &&
|
|
34
|
-
(options[:method].nil? || options[:method] == :get)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Request
|
|
3
|
-
|
|
4
|
-
# This module contains everything what is necessary
|
|
5
|
-
# to make a single request.
|
|
6
|
-
module Operations
|
|
7
|
-
|
|
8
|
-
# Run a request.
|
|
9
|
-
#
|
|
10
|
-
# @example Run a request.
|
|
11
|
-
# Typhoeus::Request.new("www.example.com").run
|
|
12
|
-
#
|
|
13
|
-
# @return [ Response ] The response.
|
|
14
|
-
def run
|
|
15
|
-
easy = EasyFactory.new(self).get
|
|
16
|
-
easy.perform
|
|
17
|
-
response
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Sets a response, the request on the response
|
|
21
|
-
# and executes the callbacks.
|
|
22
|
-
#
|
|
23
|
-
# @param [Typhoeus::Response] response The response.
|
|
24
|
-
# @param [Boolean] bypass_memoization Wether to bypass
|
|
25
|
-
# memoization or not. Decides how the response is set.
|
|
26
|
-
#
|
|
27
|
-
# @return [Typhoeus::Response] The response.
|
|
28
|
-
def finish(response, bypass_memoization = nil)
|
|
29
|
-
if bypass_memoization
|
|
30
|
-
@response = response
|
|
31
|
-
else
|
|
32
|
-
self.response = response
|
|
33
|
-
end
|
|
34
|
-
self.response.request = self
|
|
35
|
-
execute_callbacks
|
|
36
|
-
response
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Request
|
|
3
|
-
|
|
4
|
-
# This module contains logic for having a response
|
|
5
|
-
# getter and setter.
|
|
6
|
-
module Responseable
|
|
7
|
-
|
|
8
|
-
# Set the response.
|
|
9
|
-
#
|
|
10
|
-
# @example Set response.
|
|
11
|
-
# request.response = response
|
|
12
|
-
#
|
|
13
|
-
# @param [ Response ] value The response to set.
|
|
14
|
-
def response=(value)
|
|
15
|
-
@response = value
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Return the response.
|
|
19
|
-
#
|
|
20
|
-
# @example Return response.
|
|
21
|
-
# request.response
|
|
22
|
-
#
|
|
23
|
-
# @return [ Response ] The response.
|
|
24
|
-
def response
|
|
25
|
-
@response ||= nil
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module Typhoeus
|
|
2
|
-
class Request
|
|
3
|
-
|
|
4
|
-
# This module handles stubbing on the request side.
|
|
5
|
-
# It plays well with the block_connection configuration,
|
|
6
|
-
# which raises when you make a request which is not stubbed.
|
|
7
|
-
#
|
|
8
|
-
# @api private
|
|
9
|
-
module Stubbable
|
|
10
|
-
|
|
11
|
-
# Override run in order to check for matching expectations.
|
|
12
|
-
# When an expectation is found, super is not called. Instead a
|
|
13
|
-
# canned response is assigned to the request.
|
|
14
|
-
#
|
|
15
|
-
# @example Run the request.
|
|
16
|
-
# request.run
|
|
17
|
-
#
|
|
18
|
-
# @return [ Response ] The response.
|
|
19
|
-
def run
|
|
20
|
-
if response = Expectation.response_for(self)
|
|
21
|
-
execute_headers_callbacks(response)
|
|
22
|
-
self.on_body.each{ |callback| callback.call(response.body, response) }
|
|
23
|
-
finish(response)
|
|
24
|
-
else
|
|
25
|
-
super
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|