acfs 2.2.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/acfs.gemspec +4 -4
  4. data/lib/acfs/errors.rb +6 -6
  5. data/lib/acfs/global.rb +3 -1
  6. data/lib/acfs/resource/attributes.rb +5 -6
  7. data/lib/acfs/resource/locatable.rb +4 -4
  8. data/lib/acfs/resource/persistence.rb +7 -7
  9. data/lib/acfs/resource/service.rb +2 -2
  10. data/lib/acfs/runner.rb +5 -0
  11. data/lib/acfs/version.rb +3 -3
  12. data/spec/acfs/adapter/typhoeus_spec.rb +2 -1
  13. data/spec/acfs/global_spec.rb +21 -2
  14. data/spec/acfs/runner_spec.rb +16 -2
  15. data/vendor/bundle/ruby/4.0.0/bundler/gems/{rubocop-config-2b861962124a → rubocop-config-9832479830d9}/README.md +3 -3
  16. data/vendor/bundle/ruby/4.0.0/bundler/gems/{rubocop-config-2b861962124a → rubocop-config-9832479830d9}/rubocop-config.gemspec +8 -8
  17. data/vendor/bundle/ruby/4.0.0/gems/{actionpack-8.1.3 → actionpack-8.1.4.1}/CHANGELOG.md +216 -0
  18. data/vendor/bundle/ruby/4.0.0/gems/{actionview-8.1.3 → actionview-8.1.4.1}/CHANGELOG.md +107 -0
  19. data/vendor/bundle/ruby/4.0.0/gems/{activemodel-8.1.3 → activemodel-8.1.4.1}/CHANGELOG.md +48 -0
  20. data/vendor/bundle/ruby/4.0.0/gems/{activesupport-8.1.3 → activesupport-8.1.4.1}/CHANGELOG.md +242 -0
  21. data/vendor/bundle/ruby/4.0.0/gems/{addressable-2.9.0 → addressable-2.9.2}/CHANGELOG.md +97 -0
  22. data/vendor/bundle/ruby/4.0.0/gems/{bigdecimal-4.1.2 → bigdecimal-4.1.3}/bigdecimal.gemspec +2 -0
  23. data/vendor/bundle/ruby/4.0.0/gems/{concurrent-ruby-1.3.7 → concurrent-ruby-1.3.8}/CHANGELOG.md +6 -0
  24. data/vendor/bundle/ruby/4.0.0/gems/{connection_pool-3.0.2 → connection_pool-3.0.3}/connection_pool.gemspec +1 -0
  25. data/vendor/bundle/ruby/4.0.0/gems/{crass-1.0.6 → crass-1.0.8}/LICENSE +1 -1
  26. data/vendor/bundle/ruby/4.0.0/gems/crass-1.0.8/README.md +153 -0
  27. data/vendor/bundle/ruby/4.0.0/gems/crass-1.0.8/crass.gemspec +32 -0
  28. data/vendor/bundle/ruby/4.0.0/gems/ethon-0.19.2/CHANGELOG.md +1164 -0
  29. data/vendor/bundle/ruby/4.0.0/gems/ethon-0.19.2/README.md +308 -0
  30. data/vendor/bundle/ruby/4.0.0/gems/{hashdiff-1.2.1 → hashdiff-1.2.2}/changelog.md +5 -0
  31. data/vendor/bundle/ruby/4.0.0/gems/{json-2.19.9 → json-3.1.0}/README.md +9 -91
  32. data/vendor/bundle/ruby/4.0.0/gems/{loofah-2.25.1 → loofah-2.25.3}/CHANGELOG.md +42 -0
  33. data/vendor/bundle/ruby/4.0.0/gems/{minitest-6.0.6 → minitest-6.1.0}/README.rdoc +19 -10
  34. data/vendor/bundle/ruby/4.0.0/gems/{msgpack-1.8.3 → msgpack-1.8.7}/ChangeLog +25 -1
  35. data/vendor/bundle/ruby/4.0.0/gems/{msgpack-1.8.3 → msgpack-1.8.7}/msgpack.gemspec +0 -9
  36. data/vendor/bundle/ruby/4.0.0/gems/{multi_json-1.21.1 → multi_json-1.21.2}/README.md +6 -6
  37. data/vendor/bundle/ruby/4.0.0/gems/{nokogiri-1.19.4-x86_64-linux-gnu → nokogiri-1.19.7-x86_64-linux-gnu}/LICENSE-DEPENDENCIES.md +29 -0
  38. data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-api-1.10.0 → opentelemetry-api-1.11.1}/CHANGELOG.md +13 -3
  39. data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-common-0.25.0 → opentelemetry-common-0.25.2}/CHANGELOG.md +8 -0
  40. data/vendor/bundle/ruby/4.0.0/gems/{prism-1.9.0 → prism-2.1.0-x86_64-linux-gnu}/CHANGELOG.md +144 -40
  41. data/vendor/bundle/ruby/4.0.0/gems/{prism-1.9.0 → prism-2.1.0-x86_64-linux-gnu}/LICENSE.md +1 -1
  42. data/vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/README.md +83 -0
  43. data/vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/prism.gemspec +251 -0
  44. data/vendor/bundle/ruby/4.0.0/gems/{rack-3.2.6 → rack-3.2.9}/CHANGELOG.md +137 -1
  45. data/vendor/bundle/ruby/4.0.0/gems/{rack-test-2.2.0 → rack-test-2.3.0}/MIT-LICENSE.txt +1 -1
  46. data/vendor/bundle/ruby/4.0.0/gems/{rack-test-2.2.0 → rack-test-2.3.0}/README.md +16 -0
  47. data/vendor/bundle/ruby/4.0.0/gems/{rails-html-sanitizer-1.7.0 → rails-html-sanitizer-1.7.2}/CHANGELOG.md +54 -0
  48. data/vendor/bundle/ruby/4.0.0/gems/{rails-html-sanitizer-1.7.0 → rails-html-sanitizer-1.7.2}/README.md +3 -2
  49. data/vendor/bundle/ruby/4.0.0/gems/{regexp_parser-2.12.0 → regexp_parser-2.13.4}/LICENSE +1 -1
  50. data/vendor/bundle/ruby/4.0.0/gems/{regexp_parser-2.12.0 → regexp_parser-2.13.4}/regexp_parser.gemspec +3 -9
  51. data/vendor/bundle/ruby/4.0.0/gems/{rspec-core-3.13.6 → rspec-core-3.13.7}/Changelog.md +10 -2
  52. data/vendor/bundle/ruby/4.0.0/gems/{rspec-expectations-3.13.5 → rspec-expectations-3.13.6}/Changelog.md +11 -2
  53. data/vendor/bundle/ruby/4.0.0/gems/{rspec-mocks-3.13.8 → rspec-mocks-3.13.9}/Changelog.md +17 -3
  54. data/vendor/bundle/ruby/4.0.0/gems/{rspec-support-3.13.7 → rspec-support-3.13.8}/Changelog.md +12 -2
  55. data/vendor/bundle/ruby/4.0.0/gems/{rubocop-1.88.0 → rubocop-1.92.3}/README.md +1 -1
  56. data/vendor/bundle/ruby/4.0.0/gems/rubocop-ast-1.53.0/lib/rubocop/ast/vendor/parser/LICENSE.txt +26 -0
  57. data/vendor/bundle/ruby/4.0.0/gems/{rubocop-capybara-2.23.0 → rubocop-capybara-3.1.0}/CHANGELOG.md +53 -0
  58. data/vendor/bundle/ruby/4.0.0/gems/{rubocop-capybara-2.23.0 → rubocop-capybara-3.1.0}/README.md +1 -1
  59. data/vendor/bundle/ruby/4.0.0/gems/{rubocop-performance-1.26.1 → rubocop-performance-1.27.0}/LICENSE.txt +1 -1
  60. data/vendor/bundle/ruby/4.0.0/gems/{rubocop-rspec_rails-2.32.0 → rubocop-rspec_rails-2.33.0}/CHANGELOG.md +21 -0
  61. data/vendor/bundle/ruby/4.0.0/gems/{simplecov-0.22.0 → simplecov-1.3.2}/LICENSE +1 -1
  62. data/vendor/bundle/ruby/4.0.0/gems/simplecov-1.3.2/README.md +272 -0
  63. data/vendor/bundle/ruby/4.0.0/gems/{simplecov-cobertura-3.2.0 → simplecov-cobertura-4.0.0}/README.md +2 -3
  64. data/vendor/bundle/ruby/4.0.0/gems/{simplecov-cobertura-3.2.0 → simplecov-cobertura-4.0.0}/simplecov-cobertura.gemspec +2 -2
  65. data/vendor/bundle/ruby/4.0.0/gems/{typhoeus-1.6.0 → typhoeus-1.8.0}/CHANGELOG.md +297 -3
  66. data/vendor/bundle/ruby/4.0.0/gems/typhoeus-1.8.0/README.md +825 -0
  67. data/vendor/bundle/ruby/4.0.0/gems/{typhoeus-1.6.0 → typhoeus-1.8.0}/typhoeus.gemspec +15 -3
  68. data/vendor/bundle/ruby/4.0.0/gems/{unicode-display_width-3.2.0 → unicode-display_width-3.3.0}/CHANGELOG.md +6 -0
  69. data/vendor/bundle/ruby/4.0.0/gems/{unicode-display_width-3.2.0 → unicode-display_width-3.3.0}/MIT-LICENSE.txt +1 -1
  70. data/vendor/bundle/ruby/4.0.0/gems/{unicode-display_width-3.2.0 → unicode-display_width-3.3.0}/README.md +2 -2
  71. data/vendor/bundle/ruby/4.0.0/gems/{unicode-emoji-4.2.0 → unicode-emoji-4.3.0}/CHANGELOG.md +4 -0
  72. data/vendor/bundle/ruby/4.0.0/gems/{unicode-emoji-4.2.0 → unicode-emoji-4.3.0}/MIT-LICENSE.txt +1 -1
  73. data/vendor/bundle/ruby/4.0.0/gems/{unicode-emoji-4.2.0 → unicode-emoji-4.3.0}/README.md +4 -4
  74. data/vendor/bundle/ruby/4.0.0/gems/{webmock-3.26.2 → webmock-3.38.0}/CHANGELOG.md +406 -0
  75. data/vendor/bundle/ruby/4.0.0/gems/{webmock-3.26.2 → webmock-3.38.0}/README.md +271 -5
  76. data/vendor/bundle/ruby/4.0.0/specifications/{actionpack-8.1.3.gemspec → actionpack-8.1.4.1.gemspec} +8 -8
  77. data/vendor/bundle/ruby/4.0.0/specifications/{actionview-8.1.3.gemspec → actionview-8.1.4.1.gemspec} +9 -9
  78. data/vendor/bundle/ruby/4.0.0/specifications/{activemodel-8.1.3.gemspec → activemodel-8.1.4.1.gemspec} +6 -6
  79. data/vendor/bundle/ruby/4.0.0/specifications/{activesupport-8.1.3.gemspec → activesupport-8.1.4.1.gemspec} +5 -5
  80. data/vendor/bundle/ruby/4.0.0/specifications/{addressable-2.9.0.gemspec → addressable-2.9.2.gemspec} +5 -5
  81. data/vendor/bundle/ruby/4.0.0/specifications/appraisal-2.5.0.gemspec +1 -1
  82. data/vendor/bundle/ruby/4.0.0/specifications/ast-2.4.3.gemspec +1 -1
  83. data/vendor/bundle/ruby/4.0.0/specifications/base64-0.3.0.gemspec +1 -1
  84. data/vendor/bundle/ruby/4.0.0/specifications/{bigdecimal-4.1.2.gemspec → bigdecimal-4.1.3.gemspec} +3 -3
  85. data/vendor/bundle/ruby/4.0.0/specifications/builder-3.3.0.gemspec +1 -1
  86. data/vendor/bundle/ruby/4.0.0/specifications/{concurrent-ruby-1.3.7.gemspec → concurrent-ruby-1.3.8.gemspec} +4 -4
  87. data/vendor/bundle/ruby/4.0.0/specifications/{connection_pool-3.0.2.gemspec → connection_pool-3.0.3.gemspec} +5 -4
  88. data/vendor/bundle/ruby/4.0.0/specifications/crack-1.0.1.gemspec +1 -1
  89. data/vendor/bundle/ruby/4.0.0/specifications/{crass-1.0.6.gemspec → crass-1.0.8.gemspec} +8 -8
  90. data/vendor/bundle/ruby/4.0.0/specifications/diff-lcs-1.6.2.gemspec +1 -1
  91. data/vendor/bundle/ruby/4.0.0/specifications/drb-2.2.3.gemspec +1 -1
  92. data/vendor/bundle/ruby/4.0.0/specifications/erubi-1.13.1.gemspec +1 -1
  93. data/vendor/bundle/ruby/4.0.0/specifications/{ethon-0.18.0.gemspec → ethon-0.19.2.gemspec} +6 -6
  94. data/vendor/bundle/ruby/4.0.0/specifications/ffi-1.17.4-x86_64-linux-gnu.gemspec +1 -1
  95. data/vendor/bundle/ruby/4.0.0/specifications/{hashdiff-1.2.1.gemspec → hashdiff-1.2.2.gemspec} +4 -4
  96. data/vendor/bundle/ruby/4.0.0/specifications/i18n-1.15.2.gemspec +1 -1
  97. data/vendor/bundle/ruby/4.0.0/specifications/{json-2.19.9.gemspec → json-3.1.0.gemspec} +0 -0
  98. data/vendor/bundle/ruby/4.0.0/specifications/{language_server-protocol-3.17.0.5.gemspec → language_server-protocol-3.17.0.6.gemspec} +4 -4
  99. data/vendor/bundle/ruby/4.0.0/specifications/lint_roller-1.1.0.gemspec +1 -1
  100. data/vendor/bundle/ruby/4.0.0/specifications/logger-1.7.0.gemspec +1 -1
  101. data/vendor/bundle/ruby/4.0.0/specifications/{loofah-2.25.1.gemspec → loofah-2.25.3.gemspec} +6 -6
  102. data/vendor/bundle/ruby/4.0.0/specifications/{minitest-6.0.6.gemspec → minitest-6.1.0.gemspec} +8 -9
  103. data/vendor/bundle/ruby/4.0.0/specifications/{msgpack-1.8.3.gemspec → msgpack-1.8.7.gemspec} +4 -15
  104. data/vendor/bundle/ruby/4.0.0/specifications/{multi_json-1.21.1.gemspec → multi_json-1.21.2.gemspec} +5 -5
  105. data/vendor/bundle/ruby/4.0.0/specifications/{nokogiri-1.19.4-x86_64-linux-gnu.gemspec → nokogiri-1.19.7-x86_64-linux-gnu.gemspec} +3 -3
  106. data/vendor/bundle/ruby/4.0.0/specifications/opentelemetry-api-1.11.1.gemspec +27 -0
  107. data/vendor/bundle/ruby/4.0.0/specifications/opentelemetry-common-0.25.2.gemspec +26 -0
  108. data/vendor/bundle/ruby/4.0.0/specifications/{parallel-2.1.0.gemspec → parallel-2.3.0.gemspec} +4 -4
  109. data/vendor/bundle/ruby/4.0.0/specifications/{parser-3.3.11.1.gemspec → parser-3.3.14.0.gemspec} +5 -5
  110. data/vendor/bundle/ruby/4.0.0/specifications/prism-2.1.0-x86_64-linux-gnu.gemspec +22 -0
  111. data/vendor/bundle/ruby/4.0.0/specifications/public_suffix-7.0.5.gemspec +1 -1
  112. data/vendor/bundle/ruby/4.0.0/specifications/racc-1.8.1.gemspec +1 -1
  113. data/vendor/bundle/ruby/4.0.0/specifications/{rack-3.2.6.gemspec → rack-3.2.9.gemspec} +4 -4
  114. data/vendor/bundle/ruby/4.0.0/specifications/rack-session-2.1.2.gemspec +1 -1
  115. data/vendor/bundle/ruby/4.0.0/specifications/{rack-test-2.2.0.gemspec → rack-test-2.3.0.gemspec} +5 -5
  116. data/vendor/bundle/ruby/4.0.0/specifications/rails-dom-testing-2.3.0.gemspec +1 -1
  117. data/vendor/bundle/ruby/4.0.0/specifications/{rails-html-sanitizer-1.7.0.gemspec → rails-html-sanitizer-1.7.2.gemspec} +7 -7
  118. data/vendor/bundle/ruby/4.0.0/specifications/rainbow-3.1.1.gemspec +1 -1
  119. data/vendor/bundle/ruby/4.0.0/specifications/rake-13.4.2.gemspec +1 -1
  120. data/vendor/bundle/ruby/4.0.0/specifications/rake-release-1.4.0.gemspec +1 -1
  121. data/vendor/bundle/ruby/4.0.0/specifications/{regexp_parser-2.12.0.gemspec → regexp_parser-2.13.4.gemspec} +5 -5
  122. data/vendor/bundle/ruby/4.0.0/specifications/rexml-3.4.4.gemspec +1 -1
  123. data/vendor/bundle/ruby/4.0.0/specifications/rspec-3.13.2.gemspec +1 -1
  124. data/vendor/bundle/ruby/4.0.0/specifications/{rspec-core-3.13.6.gemspec → rspec-core-3.13.7.gemspec} +7 -7
  125. data/vendor/bundle/ruby/4.0.0/specifications/{rspec-expectations-3.13.5.gemspec → rspec-expectations-3.13.6.gemspec} +7 -7
  126. data/vendor/bundle/ruby/4.0.0/specifications/{rspec-mocks-3.13.8.gemspec → rspec-mocks-3.13.9.gemspec} +6 -6
  127. data/vendor/bundle/ruby/4.0.0/specifications/{rspec-support-3.13.7.gemspec → rspec-support-3.13.8.gemspec} +7 -7
  128. data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-1.88.0.gemspec → rubocop-1.92.3.gemspec} +7 -7
  129. data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-ast-1.49.1.gemspec → rubocop-ast-1.53.0.gemspec} +7 -5
  130. data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-capybara-2.23.0.gemspec → rubocop-capybara-3.1.0.gemspec} +5 -5
  131. data/vendor/bundle/ruby/4.0.0/specifications/rubocop-factory_bot-2.28.0.gemspec +1 -1
  132. data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-performance-1.26.1.gemspec → rubocop-performance-1.27.0.gemspec} +7 -7
  133. data/vendor/bundle/ruby/4.0.0/specifications/rubocop-rspec-3.10.2.gemspec +1 -1
  134. data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-rspec_rails-2.32.0.gemspec → rubocop-rspec_rails-2.33.0.gemspec} +5 -5
  135. data/vendor/bundle/ruby/4.0.0/specifications/ruby-progressbar-1.13.0.gemspec +1 -1
  136. data/vendor/bundle/ruby/4.0.0/specifications/securerandom-0.4.1.gemspec +1 -1
  137. data/vendor/bundle/ruby/4.0.0/specifications/simplecov-1.3.2.gemspec +25 -0
  138. data/vendor/bundle/ruby/4.0.0/specifications/{simplecov-cobertura-3.2.0.gemspec → simplecov-cobertura-4.0.0.gemspec} +5 -5
  139. data/vendor/bundle/ruby/4.0.0/specifications/thor-1.5.0.gemspec +1 -1
  140. data/vendor/bundle/ruby/4.0.0/specifications/{typhoeus-1.6.0.gemspec → typhoeus-1.8.0.gemspec} +7 -7
  141. data/vendor/bundle/ruby/4.0.0/specifications/tzinfo-2.0.6.gemspec +1 -1
  142. data/vendor/bundle/ruby/4.0.0/specifications/{unicode-display_width-3.2.0.gemspec → unicode-display_width-3.3.0.gemspec} +8 -8
  143. data/vendor/bundle/ruby/4.0.0/specifications/{unicode-emoji-4.2.0.gemspec → unicode-emoji-4.3.0.gemspec} +6 -6
  144. data/vendor/bundle/ruby/4.0.0/specifications/{uri-1.1.1.gemspec → uri-1.1.2.gemspec} +3 -3
  145. data/vendor/bundle/ruby/4.0.0/specifications/useragent-0.16.11.gemspec +1 -1
  146. data/vendor/bundle/ruby/4.0.0/specifications/{webmock-3.26.2.gemspec → webmock-3.38.0.gemspec} +5 -5
  147. metadata +174 -185
  148. data/vendor/bundle/ruby/4.0.0/gems/crass-1.0.6/README.md +0 -192
  149. data/vendor/bundle/ruby/4.0.0/gems/crass-1.0.6/crass.gemspec +0 -31
  150. data/vendor/bundle/ruby/4.0.0/gems/docile-1.4.1/LICENSE +0 -21
  151. data/vendor/bundle/ruby/4.0.0/gems/docile-1.4.1/README.md +0 -409
  152. data/vendor/bundle/ruby/4.0.0/gems/docile-1.4.1/docile.gemspec +0 -36
  153. data/vendor/bundle/ruby/4.0.0/gems/ethon-0.18.0/CHANGELOG.md +0 -417
  154. data/vendor/bundle/ruby/4.0.0/gems/ethon-0.18.0/README.md +0 -118
  155. data/vendor/bundle/ruby/4.0.0/gems/prism-1.9.0/README.md +0 -143
  156. data/vendor/bundle/ruby/4.0.0/gems/prism-1.9.0/prism.gemspec +0 -172
  157. data/vendor/bundle/ruby/4.0.0/gems/simplecov-0.22.0/CHANGELOG.md +0 -191
  158. data/vendor/bundle/ruby/4.0.0/gems/simplecov-0.22.0/README.md +0 -974
  159. data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/CHANGELOG.md +0 -114
  160. data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/LICENSE +0 -20
  161. data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/README.md +0 -30
  162. data/vendor/bundle/ruby/4.0.0/gems/simplecov_json_formatter-0.1.4/CHANGELOG.md +0 -13
  163. data/vendor/bundle/ruby/4.0.0/gems/simplecov_json_formatter-0.1.4/README.md +0 -29
  164. data/vendor/bundle/ruby/4.0.0/gems/typhoeus-1.6.0/README.md +0 -588
  165. data/vendor/bundle/ruby/4.0.0/specifications/docile-1.4.1.gemspec +0 -22
  166. data/vendor/bundle/ruby/4.0.0/specifications/opentelemetry-api-1.10.0.gemspec +0 -35
  167. data/vendor/bundle/ruby/4.0.0/specifications/opentelemetry-common-0.25.0.gemspec +0 -33
  168. data/vendor/bundle/ruby/4.0.0/specifications/prism-1.9.0.gemspec +0 -24
  169. data/vendor/bundle/ruby/4.0.0/specifications/simplecov-0.22.0.gemspec +0 -28
  170. data/vendor/bundle/ruby/4.0.0/specifications/simplecov-html-0.13.2.gemspec +0 -22
  171. data/vendor/bundle/ruby/4.0.0/specifications/simplecov_json_formatter-0.1.4.gemspec +0 -21
  172. /data/vendor/bundle/ruby/4.0.0/bundler/gems/{rubocop-config-2b861962124a → rubocop-config-9832479830d9}/LICENSE +0 -0
  173. /data/vendor/bundle/ruby/4.0.0/gems/{actionpack-8.1.3 → actionpack-8.1.4.1}/MIT-LICENSE +0 -0
  174. /data/vendor/bundle/ruby/4.0.0/gems/{actionpack-8.1.3 → actionpack-8.1.4.1}/README.rdoc +0 -0
  175. /data/vendor/bundle/ruby/4.0.0/gems/{actionview-8.1.3 → actionview-8.1.4.1}/MIT-LICENSE +0 -0
  176. /data/vendor/bundle/ruby/4.0.0/gems/{actionview-8.1.3 → actionview-8.1.4.1}/README.rdoc +0 -0
  177. /data/vendor/bundle/ruby/4.0.0/gems/{activemodel-8.1.3 → activemodel-8.1.4.1}/MIT-LICENSE +0 -0
  178. /data/vendor/bundle/ruby/4.0.0/gems/{activemodel-8.1.3 → activemodel-8.1.4.1}/README.rdoc +0 -0
  179. /data/vendor/bundle/ruby/4.0.0/gems/{activesupport-8.1.3 → activesupport-8.1.4.1}/MIT-LICENSE +0 -0
  180. /data/vendor/bundle/ruby/4.0.0/gems/{activesupport-8.1.3 → activesupport-8.1.4.1}/README.rdoc +0 -0
  181. /data/vendor/bundle/ruby/4.0.0/gems/{addressable-2.9.0 → addressable-2.9.2}/LICENSE.txt +0 -0
  182. /data/vendor/bundle/ruby/4.0.0/gems/{addressable-2.9.0 → addressable-2.9.2}/README.md +0 -0
  183. /data/vendor/bundle/ruby/4.0.0/gems/{bigdecimal-4.1.2 → bigdecimal-4.1.3}/LICENSE +0 -0
  184. /data/vendor/bundle/ruby/4.0.0/gems/{concurrent-ruby-1.3.7 → concurrent-ruby-1.3.8}/LICENSE.txt +0 -0
  185. /data/vendor/bundle/ruby/4.0.0/gems/{concurrent-ruby-1.3.7 → concurrent-ruby-1.3.8}/README.md +0 -0
  186. /data/vendor/bundle/ruby/4.0.0/gems/{connection_pool-3.0.2 → connection_pool-3.0.3}/LICENSE +0 -0
  187. /data/vendor/bundle/ruby/4.0.0/gems/{connection_pool-3.0.2 → connection_pool-3.0.3}/README.md +0 -0
  188. /data/vendor/bundle/ruby/4.0.0/gems/{ethon-0.18.0 → ethon-0.19.2}/LICENSE +0 -0
  189. /data/vendor/bundle/ruby/4.0.0/gems/{ethon-0.18.0 → ethon-0.19.2}/ethon.gemspec +0 -0
  190. /data/vendor/bundle/ruby/4.0.0/gems/{hashdiff-1.2.1 → hashdiff-1.2.2}/LICENSE +0 -0
  191. /data/vendor/bundle/ruby/4.0.0/gems/{hashdiff-1.2.1 → hashdiff-1.2.2}/README.md +0 -0
  192. /data/vendor/bundle/ruby/4.0.0/gems/{hashdiff-1.2.1 → hashdiff-1.2.2}/hashdiff.gemspec +0 -0
  193. /data/vendor/bundle/ruby/4.0.0/gems/{json-2.19.9 → json-3.1.0}/json.gemspec +0 -0
  194. /data/vendor/bundle/ruby/4.0.0/gems/{language_server-protocol-3.17.0.5 → language_server-protocol-3.17.0.6}/LICENSE.txt +0 -0
  195. /data/vendor/bundle/ruby/4.0.0/gems/{language_server-protocol-3.17.0.5 → language_server-protocol-3.17.0.6}/README.md +0 -0
  196. /data/vendor/bundle/ruby/4.0.0/gems/{loofah-2.25.1 → loofah-2.25.3}/MIT-LICENSE.txt +0 -0
  197. /data/vendor/bundle/ruby/4.0.0/gems/{loofah-2.25.1 → loofah-2.25.3}/README.md +0 -0
  198. /data/vendor/bundle/ruby/4.0.0/gems/{msgpack-1.8.3 → msgpack-1.8.7}/LICENSE +0 -0
  199. /data/vendor/bundle/ruby/4.0.0/gems/{msgpack-1.8.3 → msgpack-1.8.7}/README.md +0 -0
  200. /data/vendor/bundle/ruby/4.0.0/gems/{multi_json-1.21.1 → multi_json-1.21.2}/LICENSE.md +0 -0
  201. /data/vendor/bundle/ruby/4.0.0/gems/{nokogiri-1.19.4-x86_64-linux-gnu → nokogiri-1.19.7-x86_64-linux-gnu}/LICENSE.md +0 -0
  202. /data/vendor/bundle/ruby/4.0.0/gems/{nokogiri-1.19.4-x86_64-linux-gnu → nokogiri-1.19.7-x86_64-linux-gnu}/README.md +0 -0
  203. /data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-api-1.10.0 → opentelemetry-api-1.11.1}/LICENSE +0 -0
  204. /data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-api-1.10.0 → opentelemetry-api-1.11.1}/README.md +0 -0
  205. /data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-common-0.25.0 → opentelemetry-common-0.25.2}/LICENSE +0 -0
  206. /data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-common-0.25.0 → opentelemetry-common-0.25.2}/README.md +0 -0
  207. /data/vendor/bundle/ruby/4.0.0/gems/{parallel-2.1.0 → parallel-2.3.0}/MIT-LICENSE.txt +0 -0
  208. /data/vendor/bundle/ruby/4.0.0/gems/{parser-3.3.11.1 → parser-3.3.14.0}/LICENSE.txt +0 -0
  209. /data/vendor/bundle/ruby/4.0.0/gems/{parser-3.3.11.1 → parser-3.3.14.0}/parser.gemspec +0 -0
  210. /data/vendor/bundle/ruby/4.0.0/gems/{rack-3.2.6 → rack-3.2.9}/MIT-LICENSE +0 -0
  211. /data/vendor/bundle/ruby/4.0.0/gems/{rack-3.2.6 → rack-3.2.9}/README.md +0 -0
  212. /data/vendor/bundle/ruby/4.0.0/gems/{rails-html-sanitizer-1.7.0 → rails-html-sanitizer-1.7.2}/MIT-LICENSE +0 -0
  213. /data/vendor/bundle/ruby/4.0.0/gems/{rspec-core-3.13.6 → rspec-core-3.13.7}/LICENSE.md +0 -0
  214. /data/vendor/bundle/ruby/4.0.0/gems/{rspec-core-3.13.6 → rspec-core-3.13.7}/README.md +0 -0
  215. /data/vendor/bundle/ruby/4.0.0/gems/{rspec-expectations-3.13.5 → rspec-expectations-3.13.6}/LICENSE.md +0 -0
  216. /data/vendor/bundle/ruby/4.0.0/gems/{rspec-expectations-3.13.5 → rspec-expectations-3.13.6}/README.md +0 -0
  217. /data/vendor/bundle/ruby/4.0.0/gems/{rspec-mocks-3.13.8 → rspec-mocks-3.13.9}/LICENSE.md +0 -0
  218. /data/vendor/bundle/ruby/4.0.0/gems/{rspec-mocks-3.13.8 → rspec-mocks-3.13.9}/README.md +0 -0
  219. /data/vendor/bundle/ruby/4.0.0/gems/{rspec-support-3.13.7 → rspec-support-3.13.8}/LICENSE.md +0 -0
  220. /data/vendor/bundle/ruby/4.0.0/gems/{rspec-support-3.13.7 → rspec-support-3.13.8}/README.md +0 -0
  221. /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-1.88.0 → rubocop-1.92.3}/LICENSE.txt +0 -0
  222. /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-ast-1.49.1 → rubocop-ast-1.53.0}/LICENSE.txt +0 -0
  223. /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-ast-1.49.1 → rubocop-ast-1.53.0}/README.md +0 -0
  224. /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-capybara-2.23.0 → rubocop-capybara-3.1.0}/MIT-LICENSE.md +0 -0
  225. /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-performance-1.26.1 → rubocop-performance-1.27.0}/README.md +0 -0
  226. /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-rspec_rails-2.32.0 → rubocop-rspec_rails-2.33.0}/MIT-LICENSE.md +0 -0
  227. /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-rspec_rails-2.32.0 → rubocop-rspec_rails-2.33.0}/README.md +0 -0
  228. /data/vendor/bundle/ruby/4.0.0/gems/{simplecov-cobertura-3.2.0 → simplecov-cobertura-4.0.0}/LICENSE +0 -0
  229. /data/vendor/bundle/ruby/4.0.0/gems/{typhoeus-1.6.0 → typhoeus-1.8.0}/LICENSE +0 -0
  230. /data/vendor/bundle/ruby/4.0.0/gems/{unicode-emoji-4.2.0 → unicode-emoji-4.3.0}/unicode-emoji.gemspec +0 -0
  231. /data/vendor/bundle/ruby/4.0.0/gems/{uri-1.1.1 → uri-1.1.2}/README.md +0 -0
  232. /data/vendor/bundle/ruby/4.0.0/gems/{webmock-3.26.2 → webmock-3.38.0}/LICENSE +0 -0
@@ -0,0 +1,825 @@
1
+ # Typhoeus [![Gem Version](https://badge.fury.io/rb/typhoeus.svg)](https://badge.fury.io/rb/typhoeus) [![CI](https://github.com/typhoeus/typhoeus/actions/workflows/ci.yml/badge.svg)](https://github.com/typhoeus/typhoeus/actions/workflows/ci.yml) [![Experimental](https://github.com/typhoeus/typhoeus/actions/workflows/experimental.yml/badge.svg)](https://github.com/typhoeus/typhoeus/actions/workflows/experimental.yml)
2
+
3
+ Typhoeus is a Ruby HTTP client built on [libcurl](https://curl.se/libcurl/).
4
+ Run individual requests, or queue many on `Typhoeus::Hydra` to execute them in
5
+ parallel. It supports redirects, timeouts, streaming, caching, memoization,
6
+ stubbing, and callbacks while still exposing libcurl's options.
7
+
8
+ - `Typhoeus::Request` and `Typhoeus::Response` model a single transfer.
9
+ - `Typhoeus::Hydra` queues requests and runs them concurrently.
10
+ - `Typhoeus.get`, `.post`, and the other shortcuts cover common cases.
11
+
12
+ ## Example
13
+
14
+ A single request:
15
+
16
+ ```ruby
17
+ Typhoeus.get("www.example.com", followlocation: true)
18
+ ```
19
+
20
+ Parallel requests:
21
+
22
+ ```ruby
23
+ hydra = Typhoeus::Hydra.new
24
+ 10.times do
25
+ hydra.queue(Typhoeus::Request.new("www.example.com", followlocation: true))
26
+ end
27
+ hydra.run
28
+ ```
29
+
30
+ ## Installation
31
+
32
+ Add the gem to your bundle:
33
+
34
+ ```sh
35
+ bundle add typhoeus
36
+ ```
37
+
38
+ Or install it directly:
39
+
40
+ ```sh
41
+ gem install typhoeus
42
+ ```
43
+
44
+ Typhoeus requires Ruby 2.6 or later and Ethon 0.19.2 or later.
45
+
46
+ ## Documentation
47
+
48
+ - [API documentation](https://rubydoc.info/github/typhoeus/typhoeus) (master)
49
+ - [Changelog](https://github.com/typhoeus/typhoeus/blob/master/CHANGELOG.md)
50
+
51
+ ## Usage
52
+
53
+ ### Introduction
54
+
55
+ Typhoeus's primary interface consists of three classes: `Request`, `Response`,
56
+ and `Hydra`. A request describes an HTTP call, a response exposes its result,
57
+ and a hydra runs requests in parallel.
58
+
59
+ ```ruby
60
+ request = Typhoeus::Request.new(
61
+ "www.example.com",
62
+ method: :post,
63
+ body: "this is a request body",
64
+ params: { field1: "a field" },
65
+ headers: { Accept: "text/html" }
66
+ )
67
+ ```
68
+
69
+ The first argument is the URL and the second is an options hash. All options
70
+ are optional, and the method defaults to `:get`.
71
+
72
+ URL parameters go in `:params`. Form-encoded body parameters go in `:body`.
73
+ `:params` are appended to the URL; `:body` becomes the request body.
74
+
75
+ #### Sending requests through the proxy
76
+
77
+ Add `proxy` to the options:
78
+
79
+ ```ruby
80
+ options = { proxy: "http://myproxy.org" }
81
+ request = Typhoeus::Request.new(url, options)
82
+ ```
83
+
84
+ If the proxy requires authentication, set `proxyuserpwd` to `user:password`,
85
+ just like the basic-auth `userpwd` option:
86
+
87
+ ```ruby
88
+ options = { proxy: "http://proxyurl.com", proxyuserpwd: "user:password" }
89
+ request = Typhoeus::Request.new(url, options)
90
+ ```
91
+
92
+ Run the request directly or queue it on a hydra:
93
+
94
+ ```ruby
95
+ request.run
96
+ #=> <Typhoeus::Response ... >
97
+ ```
98
+
99
+ ```ruby
100
+ hydra = Typhoeus::Hydra.hydra
101
+ hydra.queue(request)
102
+ hydra.run
103
+ ```
104
+
105
+ After the request finishes, read the response:
106
+
107
+ ```ruby
108
+ response = request.response
109
+ response.code
110
+ response.total_time
111
+ response.headers
112
+ response.body
113
+ ```
114
+
115
+ ### Making Quick Requests
116
+
117
+ Typhoeus provides convenience methods for single requests. They take the same
118
+ URL and options as `Request.new`.
119
+
120
+ ```ruby
121
+ Typhoeus.get("www.example.com")
122
+ Typhoeus.head("www.example.com")
123
+ Typhoeus.put("www.example.com/posts/1", body: "a body")
124
+ Typhoeus.patch("www.example.com/posts/1", body: "a new body")
125
+ Typhoeus.post("www.example.com/posts", body: { title: "test post", content: "this is my test" })
126
+ Typhoeus.delete("www.example.com/posts/1")
127
+ Typhoeus.options("www.example.com")
128
+ ```
129
+
130
+ #### Sending params in the body with PUT
131
+
132
+ POST sets `Content-Type` to `application/x-www-form-urlencoded` when the body
133
+ is a hash. Other methods, including PUT, PATCH, and HEAD, do not. To receive a
134
+ PUT hash as form parameters, set the header yourself:
135
+
136
+ ```ruby
137
+ Typhoeus.put(
138
+ "www.example.com/posts/1",
139
+ headers: { "Content-Type" => "application/x-www-form-urlencoded" },
140
+ body: { title: "test post updated title", content: "this is my updated content" }
141
+ )
142
+ ```
143
+
144
+ ### Before callbacks
145
+
146
+ Use `Typhoeus.before` for every request, or `request.before` for a single
147
+ request. Callbacks receive the request, run before it is performed, and can
148
+ modify it. Returning `nil` or `false` skips the request and returns its current
149
+ response; returning a `Typhoeus::Response` skips the request and returns that
150
+ response. The returned response is treated as a mock, so it is not cached.
151
+
152
+ ```ruby
153
+ Typhoeus.before { |request| request.options[:timeout] ||= 5 }
154
+
155
+ request = Typhoeus::Request.new("www.example.com")
156
+ request.before { |request| request.options[:headers] ||= {} }
157
+ ```
158
+
159
+ To skip before callbacks globally, for example when your application does not
160
+ use them:
161
+
162
+ ```ruby
163
+ Typhoeus::Config.exclude_features = [:before]
164
+ ```
165
+
166
+ ### Handling HTTP errors
167
+
168
+ After the request completes, inspect the response. `success?` covers both
169
+ transport and HTTP failures, `timed_out?` identifies timeouts, and a zero code
170
+ means no HTTP response was received. Define callbacks before running the
171
+ request.
172
+
173
+ ```ruby
174
+ request = Typhoeus::Request.new("www.example.com", followlocation: true)
175
+
176
+ request.on_complete do |response|
177
+ if response.success?
178
+ # Request succeeded
179
+ elsif response.timed_out?
180
+ log("request timed out")
181
+ elsif response.code == 0
182
+ log(response.return_message)
183
+ else
184
+ log("HTTP request failed: #{response.code}")
185
+ end
186
+ end
187
+
188
+ request.run
189
+ ```
190
+
191
+ This works for blocking and parallel requests; both return a `Response`.
192
+
193
+ ### Handling file uploads
194
+
195
+ Pass a `File` in the body to upload a file with a POST request. Typhoeus sends
196
+ the original file name and detects the content type with Mime::Types when the
197
+ optional `mime-types` gem is installed. Without that gem, it uses
198
+ `application/octet-stream`.
199
+
200
+ ```ruby
201
+ Typhoeus.post(
202
+ "http://localhost:3000/posts",
203
+ body: {
204
+ title: "test post",
205
+ content: "this is my test",
206
+ file: File.open("thesis.txt", "r")
207
+ }
208
+ )
209
+ ```
210
+
211
+ Set the content type of a part, or override the filename and content type of a
212
+ file, with `Typhoeus::Multipart::Part`:
213
+
214
+ ```ruby
215
+ Typhoeus.post(
216
+ "http://localhost:3000/posts",
217
+ body: {
218
+ metadata: Typhoeus::Multipart::Part.new(
219
+ JSON.generate(title: "test post"),
220
+ content_type: "application/json"
221
+ ),
222
+ file: Typhoeus::Multipart::Part.new(
223
+ File.open("thesis.txt", "r"),
224
+ filename: "paper.txt",
225
+ content_type: "text/plain"
226
+ )
227
+ }
228
+ )
229
+ ```
230
+
231
+ A string part with a filename is sent as an in-memory upload, so the data does
232
+ not need a file on disk:
233
+
234
+ ```ruby
235
+ Typhoeus.post(
236
+ "http://localhost:3000/posts",
237
+ body: {
238
+ file: Typhoeus::Multipart::Part.new(
239
+ "file contents",
240
+ filename: "notes.txt",
241
+ content_type: "text/plain"
242
+ )
243
+ }
244
+ )
245
+ ```
246
+
247
+ ### Streaming the response body
248
+
249
+ Set `on_body` to receive response chunks as they arrive. This is useful for
250
+ large responses, and Typhoeus does not retain the complete body.
251
+
252
+ ```ruby
253
+ downloaded_file = File.open("huge.iso", "wb")
254
+ request = Typhoeus::Request.new("www.example.com/huge.iso")
255
+ request.on_headers do |response|
256
+ raise "Request failed" if response.code != 200
257
+ end
258
+ request.on_body do |chunk|
259
+ downloaded_file.write(chunk)
260
+ end
261
+ request.on_complete do |response|
262
+ downloaded_file.close
263
+ # response.body is empty
264
+ end
265
+ request.run
266
+ ```
267
+
268
+ Return `:abort` from the `on_body` block to stop the transfer cleanly:
269
+
270
+ ```ruby
271
+ request.on_body do |chunk|
272
+ buffer << chunk
273
+ :abort if buffer.size > 1024 * 1024
274
+ end
275
+ ```
276
+
277
+ Returning `:abort` stops the transfer without buffering the rest of the
278
+ response. Leaving the block with `return`, `throw`, or `raise` can leave the
279
+ transfer in an inconsistent state.
280
+
281
+ ### Progress callbacks
282
+
283
+ Set `on_progress` to observe the transfer. The callback receives the total and
284
+ current number of downloaded and uploaded bytes:
285
+
286
+ ```ruby
287
+ request = Typhoeus::Request.new("www.example.com/huge.iso")
288
+ request.on_progress do |dltotal, dlnow, ultotal, ulnow|
289
+ puts "#{dlnow}/#{dltotal} bytes"
290
+ end
291
+ request.run
292
+ ```
293
+
294
+ Progress callbacks run during the transfer. Use `on_complete` for completion.
295
+
296
+ ### Making Parallel Requests
297
+
298
+ Use `Hydra` to run requests in parallel. `hydra.run` blocks until all queued
299
+ requests finish.
300
+
301
+ ```ruby
302
+ hydra = Typhoeus::Hydra.hydra
303
+
304
+ first_request = Typhoeus::Request.new("http://example.com/posts/1")
305
+ first_request.on_complete do |response|
306
+ third_request = Typhoeus::Request.new(response.body)
307
+ hydra.queue(third_request)
308
+ end
309
+ second_request = Typhoeus::Request.new("http://example.com/posts/2")
310
+
311
+ hydra.queue(first_request)
312
+ hydra.queue(second_request)
313
+ hydra.run # blocks until all requests are complete
314
+ ```
315
+
316
+ `hydra.run` starts the first two requests. When the first completes, its
317
+ `on_complete` callback queues a third request, which starts immediately while
318
+ the second request continues. `hydra.run` returns when all three finish.
319
+
320
+ Collect responses from the requests after the run:
321
+
322
+ ```ruby
323
+ hydra = Typhoeus::Hydra.new
324
+ requests = 10.times.map do
325
+ request = Typhoeus::Request.new("www.example.com", followlocation: true)
326
+ hydra.queue(request)
327
+ request
328
+ end
329
+ hydra.run
330
+
331
+ responses = requests.map { |request| request.response.body }
332
+ ```
333
+
334
+ To handle responses as they complete, use `on_complete` instead:
335
+
336
+ ```ruby
337
+ hydra = Typhoeus::Hydra.new
338
+ 10.times do
339
+ request = Typhoeus::Request.new("www.example.com", followlocation: true)
340
+ request.on_complete do |response|
341
+ # handle response
342
+ end
343
+ hydra.queue(request)
344
+ end
345
+ hydra.run
346
+ ```
347
+
348
+ #### Reusing connections between hydras
349
+
350
+ A hydra keeps libcurl's connection cache for as long as its native multi
351
+ handle lives, so a new `Hydra` starts with no open connections and pays for a
352
+ fresh TLS handshake. Returning the handle to the pool lets the next hydra
353
+ reuse it:
354
+
355
+ ```ruby
356
+ hydra = Typhoeus::Hydra.new
357
+ hydra.queue(Typhoeus::Request.new("https://example.com"))
358
+ hydra.run
359
+ hydra.release # keeps the connection cache for the next hydra
360
+
361
+ # Takes the released handle, so the TLS connection is still there.
362
+ hydra = Typhoeus::Hydra.new
363
+ ```
364
+
365
+ `release` does nothing while requests are still queued. A hydra created with
366
+ multi options, such as `maxconnects:`, is not pooled, because a later hydra
367
+ with different options cannot reconfigure the handle. `Typhoeus::Config.max_idle_multis`
368
+ (default 5) limits the pool; set it to `0` to disable multi pooling.
369
+
370
+ ### Making Parallel Requests with Faraday + Typhoeus
371
+
372
+ Typhoeus ships a Faraday adapter that supports Faraday 1.x and 2.x.
373
+
374
+ ```ruby
375
+ require "faraday"
376
+
377
+ conn = Faraday.new(url: "http://httppage.com") do |builder|
378
+ builder.request :url_encoded
379
+ builder.response :logger
380
+ builder.adapter :typhoeus
381
+ end
382
+
383
+ conn.in_parallel do
384
+ response1 = conn.get("/first")
385
+ response2 = conn.get("/second")
386
+
387
+ # Inside in_parallel, the responses are not complete yet.
388
+ response1.body
389
+ response2.body
390
+ end
391
+
392
+ # After in_parallel returns, the responses are populated.
393
+ response1.body
394
+ response2.body
395
+ ```
396
+
397
+ A request with an `on_data` callback streams the body to it in chunks, and its
398
+ `response.body` is then empty.
399
+
400
+ ### Specifying Max Concurrency
401
+
402
+ Hydra runs at most 200 requests concurrently by default. Additional queued
403
+ requests wait until a running request finishes. Set a lower or higher limit on
404
+ the constructor:
405
+
406
+ ```ruby
407
+ Typhoeus::Hydra.new(max_concurrency: 20)
408
+ ```
409
+
410
+ ### Memoization
411
+
412
+ With memoization enabled, Hydra sends a single request for identical GET
413
+ requests in a run and executes each request's `on_complete` callback.
414
+ Memoization is disabled by default:
415
+
416
+ ```ruby
417
+ Typhoeus::Config.memoize = true
418
+
419
+ hydra = Typhoeus::Hydra.new(max_concurrency: 1)
420
+ 2.times do
421
+ hydra.queue(Typhoeus::Request.new("www.example.com"))
422
+ end
423
+ hydra.run
424
+ ```
425
+
426
+ With memoization disabled, Hydra sends both requests:
427
+
428
+ ```ruby
429
+ Typhoeus::Config.memoize = false
430
+
431
+ hydra = Typhoeus::Hydra.new(max_concurrency: 1)
432
+ 2.times do
433
+ hydra.queue(Typhoeus::Request.new("www.example.com"))
434
+ end
435
+ hydra.run
436
+ ```
437
+
438
+ ### Caching
439
+
440
+ Typhoeus can cache responses. A cache store implements `get(request)` and
441
+ `set(request, response)`, and a cache hit is delivered through the request's
442
+ `on_complete` callback.
443
+
444
+ ```ruby
445
+ class Cache
446
+ def initialize
447
+ @memory = {}
448
+ end
449
+
450
+ def get(request)
451
+ @memory[request]
452
+ end
453
+
454
+ def set(request, response)
455
+ @memory[request] = response
456
+ end
457
+ end
458
+
459
+ Typhoeus::Config.cache = Cache.new
460
+
461
+ Typhoeus.get("www.example.com").cached?
462
+ #=> false
463
+ Typhoeus.get("www.example.com").cached?
464
+ #=> true
465
+ ```
466
+
467
+ Typhoeus ships adapters for [Dalli](https://github.com/mperham/dalli), Rails,
468
+ and [Redis](https://github.com/redis/redis-rb):
469
+
470
+ ```ruby
471
+ require "typhoeus/cache/dalli"
472
+
473
+ dalli = Dalli::Client.new(...)
474
+ Typhoeus::Config.cache = Typhoeus::Cache::Dalli.new(dalli)
475
+ ```
476
+
477
+ ```ruby
478
+ require "typhoeus/cache/rails"
479
+
480
+ Typhoeus::Config.cache = Typhoeus::Cache::Rails.new
481
+ ```
482
+
483
+ ```ruby
484
+ require "typhoeus/cache/redis"
485
+
486
+ redis = Redis.new(...)
487
+ Typhoeus::Config.cache = Typhoeus::Cache::Redis.new(redis)
488
+ ```
489
+
490
+ Each adapter accepts a `default_ttl` in seconds for requests without a
491
+ `cache_ttl`:
492
+
493
+ ```ruby
494
+ Typhoeus::Config.cache = Typhoeus::Cache::Dalli.new(dalli, default_ttl: 3600)
495
+ ```
496
+
497
+ Disable caching for one request with `cache: false`, or pass a different store:
498
+
499
+ ```ruby
500
+ Typhoeus.get("www.example.com", cache: false)
501
+ Typhoeus.get("www.example.com", cache: Cache.new)
502
+ ```
503
+
504
+ The cache key includes the URL and all request options except the cache store
505
+ and `cache_ttl`. The store decides where a response is cached and the TTL
506
+ decides how long it is cached; neither changes which response is cached.
507
+
508
+ ### Stubbing
509
+
510
+ Stub URLs or patterns to keep tests off the network. A stub matches the
511
+ request's base URL.
512
+
513
+ ```ruby
514
+ response = Typhoeus::Response.new(code: 200, body: "{'name' : 'paul'}")
515
+ Typhoeus.stub("www.example.com").and_return(response)
516
+
517
+ Typhoeus.get("www.example.com") == response
518
+ #=> true
519
+ ```
520
+
521
+ Pass a regexp to match multiple URLs:
522
+
523
+ ```ruby
524
+ response = Typhoeus::Response.new(code: 200, body: "{'name' : 'paul'}")
525
+ Typhoeus.stub(/example/).and_return(response)
526
+
527
+ Typhoeus.get("www.example.com") == response
528
+ #=> true
529
+ ```
530
+
531
+ Pass an array to return responses in sequence:
532
+
533
+ ```ruby
534
+ Typhoeus.stub("www.example.com").and_return([response1, response2])
535
+
536
+ Typhoeus.get("www.example.com") == response1 #=> true
537
+ Typhoeus.get("www.example.com") == response2 #=> true
538
+ ```
539
+
540
+ To make a real request while `Typhoeus::Config.block_connection` is enabled,
541
+ wrap it in `Typhoeus.with_connection`. Stubs are bypassed inside the block,
542
+ which lets a stub forward to a real service:
543
+
544
+ ```ruby
545
+ Typhoeus::Config.block_connection = true
546
+ Typhoeus.stub("http://elastic:9200") do |request|
547
+ Typhoeus.with_connection { request.run }
548
+ end
549
+ ```
550
+
551
+ Clear expectations between tests, or stubs will leak into later examples:
552
+
553
+ ```ruby
554
+ RSpec.configure do |config|
555
+ config.before :each do
556
+ Typhoeus::Expectation.clear
557
+ end
558
+ end
559
+ ```
560
+
561
+ ### Timeouts
562
+
563
+ Typhoeus does not raise on HTTP timeouts. Check the response instead:
564
+
565
+ ```ruby
566
+ response = Typhoeus.get("www.example.com", timeout: 1)
567
+ response.timed_out? #=> true
568
+ response.success? #=> false
569
+ ```
570
+
571
+ Two timeouts are available: [`timeout`](http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTIMEOUT)
572
+ and [`connecttimeout`](http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCONNECTTIMEOUT).
573
+ `timeout` limits the entire request, while `connecttimeout` limits only the
574
+ connection phase. Both are in seconds.
575
+
576
+ `timeout_ms` and `connecttimeout_ms` offer millisecond precision, but are not
577
+ available on every platform (for example, Linux without `nosignal: true`).
578
+ When a timeout is a float, Typhoeus also sets the corresponding `*_ms` option
579
+ and rounds the seconds value up.
580
+
581
+ DNS timeouts under one second require libcurl built with an asynchronous
582
+ resolver.
583
+
584
+ `timeout` defaults to 0, which means no transfer timeout. `connecttimeout`
585
+ defaults to 300 seconds; passing 0 also uses 300 seconds.
586
+
587
+ ### Threads and forking
588
+
589
+ Typhoeus delegates handle management to Ethon. Ethon raises
590
+ `Ethon::Errors::ForkSafety` for `Ethon::Easy` and `Ethon::Multi` handles
591
+ inherited across `fork`. Typhoeus clears its easy pool in the child process,
592
+ and `Typhoeus::Hydra.hydra` replaces the hydra it memoized in the parent.
593
+ A hydra creates its native multi handle lazily, so creating or memoizing a
594
+ hydra during boot does not initialize libcurl. Typhoeus cannot reset libcurl's
595
+ process-global state. If libcurl is initialized before forking, for example by
596
+ making a request during boot, use `fork` followed by `exec`, or fork before the
597
+ first request. A server that forks workers from a process that has already
598
+ made requests, such as Pitchfork with reforking or Puma with `fork_worker`, can
599
+ instead call `Ethon::Curl.allow_handles_after_fork!` in each worker before its
600
+ first request, except on macOS, as Ethon's README describes.
601
+
602
+ On macOS, libcurl's global initialization can touch Objective-C and crash a
603
+ forked child with `objc_initializeAfterForkError`. Initializing libcurl in the
604
+ parent doesn't avoid that: the child then raises `Ethon::Errors::ForkSafety`,
605
+ and `Ethon::Curl.allow_handles_after_fork!` raises there too. Create handles
606
+ only after the fork, and if the child crashes, set
607
+ `OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES` in the environment, which skips the
608
+ Objective-C check, or use `fork` followed by `exec`.
609
+
610
+ Typhoeus keeps at most `Typhoeus::Config.max_idle_easies` idle easy handles in
611
+ the pool (20 by default). Handles beyond that limit are cleaned up instead of
612
+ pooled. Set it to `nil` to keep every handle or `0` to disable pooling.
613
+
614
+ Exceptions raised by `on_body` and `on_complete` callbacks are propagated by
615
+ Ethon. Typhoeus releases the underlying easy handle before re-raising.
616
+
617
+ ### Ethon 0.19
618
+
619
+ Typhoeus requires Ethon 0.19.2. Ethon 0.19 makes several previously
620
+ silent errors visible:
621
+
622
+ - Unknown enum and bitmask option values raise `Ethon::Errors::InvalidValue`,
623
+ and options the loaded libcurl does not know raise
624
+ `Ethon::Errors::UnsupportedOption`. Guard optional options with
625
+ `Ethon::Curl.supports_option?` when you need to support older libcurl builds.
626
+ - Exceptions raised by `on_body` and `on_complete` callbacks are re-raised.
627
+ - Multipart PUT requests are sent as `multipart/form-data`.
628
+ - Pass `errorbuffer: true` to expose libcurl's detailed error as
629
+ `response.error_message`.
630
+
631
+ ### Following Redirections
632
+
633
+ Enable redirects with `followlocation: true`:
634
+
635
+ ```ruby
636
+ Typhoeus.get("www.example.com", followlocation: true)
637
+ ```
638
+
639
+ ### Basic Authentication
640
+
641
+ Pass `userpwd` as `username:password`:
642
+
643
+ ```ruby
644
+ Typhoeus::Request.get("www.example.com", userpwd: "user:password")
645
+ ```
646
+
647
+ ### Compression
648
+
649
+ Use `accept_encoding` to request and decompress a compressed response:
650
+
651
+ ```ruby
652
+ Typhoeus.get("www.example.com", accept_encoding: "gzip")
653
+ ```
654
+
655
+ Setting the `Accept-Encoding` header directly does not add libcurl's automatic
656
+ decompression, so the response stays compressed:
657
+
658
+ ```ruby
659
+ Typhoeus.get("www.example.com", headers: { "Accept-Encoding" => "gzip" })
660
+ ```
661
+
662
+ ### Cookies
663
+
664
+ Pass a file to read cookies from and a file to write them to:
665
+
666
+ ```ruby
667
+ Typhoeus::Request.get(
668
+ "www.example.com",
669
+ cookiefile: "/path/to/file",
670
+ cookiejar: "/path/to/file"
671
+ )
672
+ ```
673
+
674
+ `cookiefile` is read before the request and `cookiejar` is written after it.
675
+ Use the same path for both if you want one file for reading and writing.
676
+
677
+ ### Other curl options
678
+
679
+ Any libcurl option can be passed as a request option. See the
680
+ [Ethon option documentation](http://rubydoc.info/github/typhoeus/ethon/Ethon/Easy/Options).
681
+
682
+ An empty header value suppresses libcurl's default header. To send a header
683
+ with an empty value, end the key with a semicolon:
684
+
685
+ ```ruby
686
+ Typhoeus.get("www.example.com", headers: { "X-Empty;" => "" })
687
+ ```
688
+
689
+ Typhoeus sends an empty `Expect` header by default to suppress the
690
+ `100-continue` handshake. Pass `nil` to leave the decision to libcurl, which
691
+ adds the header for uploads with an unknown size and for multipart bodies:
692
+
693
+ ```ruby
694
+ Typhoeus.post("www.example.com", headers: { "Expect" => nil }, body: data)
695
+ ```
696
+
697
+ ### SSL
698
+
699
+ SSL is handled by libcurl. HTTPS URLs work when libcurl was built with SSL
700
+ support and the [CA bundle](http://curl.haxx.se/docs/caextract.html) is valid.
701
+ If `SSL_CERT_FILE` or `SSL_CERT_DIR` is set, Typhoeus uses it as the default CA
702
+ bundle or directory; explicit `:cainfo` and `:capath` options take precedence.
703
+ Check libcurl's build with:
704
+
705
+ ```sh
706
+ curl --version
707
+ ```
708
+
709
+ If a certificate cannot be verified, disable peer verification:
710
+
711
+ ```ruby
712
+ Typhoeus.get("https://www.example.com", ssl_verifypeer: false)
713
+ ```
714
+
715
+ If the certificate does not match the host, disable host verification:
716
+
717
+ ```ruby
718
+ # Verify the host name (default)
719
+ Typhoeus.get("https://www.example.com", ssl_verifyhost: 2)
720
+ # Do not verify the host name
721
+ Typhoeus.get("https://www.example.com", ssl_verifyhost: 0)
722
+ ```
723
+
724
+ Only disable these checks in controlled environments.
725
+
726
+ ### Verbose debug output
727
+
728
+ Enable verbose output per request:
729
+
730
+ ```ruby
731
+ Typhoeus.get("http://example.com", verbose: true)
732
+ ```
733
+
734
+ Or globally:
735
+
736
+ ```ruby
737
+ Typhoeus::Config.verbose = true
738
+ ```
739
+
740
+ Ethon routes libcurl's verbose output through `Ethon.logger` at the debug
741
+ level, so it no longer prints to STDERR directly. Enable debug logging to see
742
+ it:
743
+
744
+ ```ruby
745
+ require "logger"
746
+ Ethon.logger = Logger.new(STDERR)
747
+ Ethon.logger.level = Logger::DEBUG
748
+ ```
749
+
750
+ ### Thread safety
751
+
752
+ `Typhoeus::Request` and `Typhoeus::Hydra` instances are not thread-safe. An
753
+ `Ethon::Easy` handle is checked out of the process-wide pool for the duration
754
+ of a request and checked back in when it completes, so create requests and
755
+ hydras per thread. `Typhoeus::Hydra.hydra` is memoized per thread.
756
+ `Typhoeus.with_connection` only changes the setting for the current thread.
757
+
758
+ These are process-wide and should be configured during boot rather than while
759
+ requests are running:
760
+
761
+ - `Typhoeus::Config` (`block_connection`, `cache`, `exclude_features`,
762
+ `max_idle_easies`, `memoize`, timeouts, `proxy`, `user_agent`, `verbose`)
763
+ - `Typhoeus.before`, `Typhoeus.on_complete`, `Typhoeus.on_success`,
764
+ `Typhoeus.on_failure`, `Typhoeus.on_progress`, and `Typhoeus.on_headers`
765
+ - `Typhoeus.stub` and `Typhoeus::Expectation.all`
766
+ - the easy pool used by `Typhoeus::Pool`
767
+
768
+ The easy pool belongs to the process that created it. It keeps at most
769
+ `Typhoeus::Config.max_idle_easies` idle handles (20 by default) and is cleared
770
+ after `fork`.
771
+
772
+ ### Default User Agent Header
773
+
774
+ Set a User-Agent for every request:
775
+
776
+ ```ruby
777
+ Typhoeus::Config.user_agent = "custom user agent"
778
+ ```
779
+
780
+ ### Running the specs
781
+
782
+ Install dependencies and run the suite:
783
+
784
+ ```sh
785
+ bundle install
786
+ bundle exec rake
787
+ ```
788
+
789
+ Run `COVERAGE=true bundle exec rake` to write an HTML report to `coverage/`.
790
+
791
+ Run `bundle exec rake perf` to benchmark the request hot path. It reports
792
+ throughput, allocations, and retained memory for building, queueing, adding,
793
+ and performing requests.
794
+
795
+ ## Semantic Versioning
796
+
797
+ This project conforms to [semver](http://semver.org/).
798
+
799
+ ## License
800
+
801
+ (The MIT License)
802
+
803
+ Copyright © 2009-2010 [Paul Dix](http://www.pauldix.net/)
804
+
805
+ Copyright © 2011-2012 [David Balatero](https://github.com/dbalatero/)
806
+
807
+ Copyright © 2012-2016 [Hans Hasselberg](http://github.com/i0rek/)
808
+
809
+ Permission is hereby granted, free of charge, to any person obtaining a
810
+ copy of this software and associated documentation files (the "Software"),
811
+ to deal in the Software without restriction, including without
812
+ limitation the rights to use, copy, modify, merge, publish, distribute,
813
+ sublicense, and/or sell copies of the Software, and to permit persons
814
+ to whom the Software is furnished to do so, subject to the following conditions:
815
+
816
+ The above copyright notice and this permission notice shall be included
817
+ in all copies or substantial portions of the Software.
818
+
819
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
820
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
821
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
822
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
823
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
824
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
825
+ OTHER DEALINGS IN THE SOFTWARE.