pax_global_header 0000666 0000000 0000000 00000000064 13742546043 0014522 g ustar 00root root 0000000 0000000 52 comment=571dc11c2faae7b43fc3b6f4e5750493b0d68fbc faraday-1.1.0/ 0000775 0000000 0000000 00000000000 13742546043 0013130 5 ustar 00root root 0000000 0000000 faraday-1.1.0/.codeclimate.yml 0000664 0000000 0000000 00000000064 13742546043 0016202 0 ustar 00root root 0000000 0000000 version: "2" plugins: rubocop: enabled: false faraday-1.1.0/.document 0000664 0000000 0000000 00000000101 13742546043 0014737 0 ustar 00root root 0000000 0000000 LICENSE.md README.md bin/* lib/**/*.rb test/**/*.rb .github/*.md faraday-1.1.0/.editorconfig 0000664 0000000 0000000 00000000223 13742546043 0015602 0 ustar 00root root 0000000 0000000 root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true faraday-1.1.0/.github/ 0000775 0000000 0000000 00000000000 13742546043 0014470 5 ustar 00root root 0000000 0000000 faraday-1.1.0/.github/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000006240 13742546043 0017271 0 ustar 00root root 0000000 0000000 # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainer at giuffrida.mattia AT gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ faraday-1.1.0/.github/CONTRIBUTING.md 0000664 0000000 0000000 00000005375 13742546043 0016733 0 ustar 00root root 0000000 0000000 ## Contributing In Faraday we always welcome new ideas and features, however we also have to ensure that the overall code quality stays on reasonable levels. For this reason, before adding any contribution to Faraday, we highly recommend reading this quick guide to ensure your PR can be reviewed and approved as quickly as possible. We are past our 1.0 release, and follow [Semantic Versioning][semver]. If your patch includes changes that break compatibility, note that so we can add it to the [Changelog][]. ### Required Checks Before pushing your code and opening a PR, we recommend you run the following checks to avoid our GitHub Actions Workflow to block your contribution. ```bash # Run unit tests and check code coverage $ bundle exec rspec # Run Rubocop and check code style $ bundle exec rubocop ``` ### New Features When adding a feature in Faraday: 1. also add tests to cover your new feature. 2. if the feature is for an adapter, the **attempt** must be made to add the same feature to all other adapters as well. 3. start opening an issue describing how the new feature will work, and only after receiving the green light by the core team start working on the PR. ### New Middleware & Adapters We prefer new adapters and middlewares to be added as separate gems. We can link to such gems from this project. This goes for the [faraday_middleware][] project as well. We encourage adapters that: 1. support SSL & streaming; 1. are proven and may have better performance than existing ones; or 1. have features not present in included adapters. ### Changes to Faraday Website The [Faraday Website][website] is included in the Faraday repository, under the `/docs` folder. If you want to apply changes to it, please test it locally before opening your PR. #### Test website changes using Docker Start cloning the repository and navigate to the newly cloned directory on your computer, then run the following: ```bash docker container run -p 80:4000 -v $(pwd)/docs:/site bretfisher/jekyll-serve ``` And that's it! Open your browser and go to `http://localhost` to see the website running. Any change done to files in the `/docs` folder will be automatically picked (except for config changes). #### Test website changes using `Jekyll` ```bash # Navigate into the /docs folder $ cd docs # Install Jekyll dependencies, this bundle is different from Faraday's one. $ bundle install # Run the Jekyll server with the Faraday website $ bundle exec jekyll serve # The site will now be reachable at http://127.0.0.1:4000/faraday/ ``` [semver]: https://semver.org/ [changelog]: https://github.com/lostisland/faraday/releases [faraday_middleware]: https://github.com/lostisland/faraday_middleware [website]: https://lostisland.github.io/faraday faraday-1.1.0/.github/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000001440 13742546043 0017174 0 ustar 00root root 0000000 0000000 ## Basic Info * Faraday Version: * Ruby Version: ## Issue description Please provide a description of the issue you're experiencing. Please also provide the exception message/stacktrace or any other useful detail. ## Steps to reproduce If possible, please provide the steps to reproduce the issue. ## CHECKLIST (delete before creating the issue) * If you're not reporting a bug/issue, you can ignore this whole template. * Are you using the latest Faraday version? If not, please check the [Releases](https://github.com/lostisland/faraday/releases) page to see if the issue has already been fixed. * Provide the Faraday and Ruby Version you're using while experiencing the issue. * Fill the `Issue description` and `Steps to Reproduce` sections. * Delete this checklist before posting the issue. faraday-1.1.0/.github/PULL_REQUEST_TEMPLATE.md 0000664 0000000 0000000 00000000420 13742546043 0020265 0 ustar 00root root 0000000 0000000 ## Description A few sentences describing the overall goals of the pull request's commits. Link to related issues if any. (As `Fixes #XXX`) ## Todos List any remaining work that needs to be done, i.e: - [ ] Tests - [ ] Documentation ## Additional Notes Optional section faraday-1.1.0/.github/workflows/ 0000775 0000000 0000000 00000000000 13742546043 0016525 5 ustar 00root root 0000000 0000000 faraday-1.1.0/.github/workflows/ci.yml 0000664 0000000 0000000 00000002413 13742546043 0017643 0 ustar 00root root 0000000 0000000 name: CI on: pull_request: push: branches: [master, 0.1x] env: GIT_COMMIT_SHA: ${{ github.sha }} GIT_BRANCH: ${{ github.ref }} CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} jobs: linting: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 - name: Rubocop run: | gem install bundler bundle config set without 'development test' bundle config set with 'lint' bundle install bundle exec rubocop --format progress - name: Yard-Junk run: | gem install yard-junk --no-document yard-junk --path lib build: needs: [linting] runs-on: ubuntu-latest strategy: matrix: ruby: ['2.4', '2.5', '2.6', '2.7'] steps: - uses: actions/checkout@v1 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Install dependencies run: | sudo apt-get install libcurl4-openssl-dev - name: Build run: | sudo apt-get install libcurl4-openssl-dev gem install bundler -v '<2' bundle install --jobs 4 --retry 3 - name: Test run: | bundle exec rake faraday-1.1.0/.github/workflows/publish.yml 0000664 0000000 0000000 00000001260 13742546043 0020715 0 ustar 00root root 0000000 0000000 name: Publish on: release: types: [published] jobs: build: name: Publish to Rubygems runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Set up Ruby 2.6 uses: actions/setup-ruby@v1 with: ruby-version: 2.6.x - name: Publish to RubyGems run: | mkdir -p $HOME/.gem touch $HOME/.gem/credentials chmod 0600 $HOME/.gem/credentials printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials gem build faraday.gemspec gem push faraday-*.gem env: GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }} faraday-1.1.0/.gitignore 0000664 0000000 0000000 00000000272 13742546043 0015121 0 ustar 00root root 0000000 0000000 ## PROJECT::GENERAL coverage rdoc doc log pkg/* tmp .rvmrc .ruby-version .yardoc ## BUNDLER *.gem .bundle Gemfile.lock vendor/bundle ## PROJECT::SPECIFIC .rbx ## IDEs .idea/ .yardoc/ faraday-1.1.0/.rspec 0000664 0000000 0000000 00000000065 13742546043 0014246 0 ustar 00root root 0000000 0000000 --require spec_helper --format documentation --color faraday-1.1.0/.rubocop.yml 0000664 0000000 0000000 00000001671 13742546043 0015407 0 ustar 00root root 0000000 0000000 inherit_from: .rubocop_todo.yml require: - rubocop-packaging - rubocop-performance AllCops: DisplayCopNames: true DisplayStyleGuide: true TargetRubyVersion: 2.4 Metrics/BlockLength: Exclude: - spec/**/*.rb - examples/**/*.rb Layout/EmptyLinesAroundAttributeAccessor: # (0.83) Enabled: true Layout/LineLength: Exclude: - spec/**/*.rb - examples/**/*.rb Layout/SpaceAroundMethodCallOperator: Enabled: true Lint/DeprecatedOpenSSLConstant: # (0.84) Enabled: true Lint/RaiseException: Enabled: true Lint/StructNewOverride: Enabled: true Style/DoubleNegation: Enabled: false Style/Documentation: Exclude: - 'spec/**/*' - 'examples/**/*' Style/ExponentialNotation: Enabled: true Style/HashEachMethods: Enabled: true Style/HashTransformKeys: Enabled: true Style/HashTransformValues: Enabled: true Style/IfUnlessModifier: Enabled: false Style/SlicingWithRange: # (0.83) Enabled: true faraday-1.1.0/.rubocop_todo.yml 0000664 0000000 0000000 00000001377 13742546043 0016437 0 ustar 00root root 0000000 0000000 # This configuration was generated by # `rubocop --auto-gen-config` # on 2019-04-08 21:22:38 +0200 using RuboCop version 0.67.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. # Offense count: 37 Metrics/AbcSize: Max: 67 # Offense count: 4 # Configuration parameters: CountComments. Metrics/ClassLength: Max: 234 # Offense count: 17 Metrics/CyclomaticComplexity: Max: 16 # Offense count: 48 # Configuration parameters: CountComments, ExcludedMethods. Metrics/MethodLength: Max: 48 # Offense count: 13 Metrics/PerceivedComplexity: Max: 16 faraday-1.1.0/.yardopts 0000664 0000000 0000000 00000000241 13742546043 0014773 0 ustar 00root root 0000000 0000000 --no-private --exclude test --exclude .github --exclude coverage --exclude doc --exclude script --markup markdown --readme README.md lib/**/*.rb - CHANGELOG.md faraday-1.1.0/CHANGELOG.md 0000664 0000000 0000000 00000024725 13742546043 0014753 0 ustar 00root root 0000000 0000000 # Faraday Changelog ## v1.0 Features: * Add #trace support to Faraday::Connection #861 (@technoweenie) * Add the log formatter that is easy to override and safe to inherit #889 (@prikha) * Support standalone adapters #941 (@iMacTia) * Introduce Faraday::ConflictError for 409 response code #979 (@lucasmoreno) * Add support for setting `read_timeout` option separately #1003 (@springerigor) * Refactor and cleanup timeout settings across adapters #1022 (@technoweenie) * Create ParamPart class to allow multipart posts with JSON content and file upload at the same time #1017 (@jeremy-israel) * Copy UploadIO const -> FilePart for consistency with ParamPart #1018, #1021 (@technoweenie) * Implement streaming responses in the Excon adapter #1026 (@technoweenie) * Add default implementation of `Middleware#close`. #1069 (@ioquatix) * Add `Adapter#close` so that derived classes can call super. #1091 (@ioquatix) * Add log_level option to logger default formatter #1079 (@amrrbakry) * Fix empty array for FlatParamsEncoder `{key: []} -> "key="` #1084 (@mrexox) Bugs: * Explicitly require date for DateTime library in Retry middleware #844 (@nickpresta) * Refactor Adapter as final endpoints #846 (@iMacTia) * Separate Request and Response bodies in Faraday::Env #847 (@iMacTia) * Implement Faraday::Connection#options to make HTTP requests with the OPTIONS verb. #857 (@technoweenie) * Multipart: Drop Ruby 1.8 String behavior compat #892 (@olleolleolle) * Fix Ruby warnings in Faraday::Options.memoized #962 (@technoweenie) * Allow setting min/max SSL version for a Net::HTTP::Persistent connection #972, #973 (@bdewater, @olleolleolle) * Fix instances of frozen empty string literals #1040 (@BobbyMcWho) * remove temp_proxy and improve proxy tests #1063 (@technoweenie) * improve error initializer consistency #1095 (@technoweenie) Misc: * Convert minitest suite to RSpec #832 (@iMacTia, with help from @gaynetdinov, @Insti, @technoweenie) * Major effort to update code to RuboCop standards. #854 (@olleolleolle, @iMacTia, @technoweenie, @htwroclau, @jherdman, @Drenmi, @Insti) * Rubocop #1044, #1047 (@BobbyMcWho, @olleolleolle) * Documentation tweaks (@adsteel, @Hubro, @iMacTia, @olleolleolle, @technoweenie) * Update license year #981 (@Kevin-Kawai) * Configure Jekyll plugin jekyll-remote-theme to support Docker usage #999 (@Lewiscowles1986) * Fix Ruby 2.7 warnings #1009 (@tenderlove) * Cleanup adapter connections #1023 (@technoweenie) * Describe clearing cached stubs #1045 (@viraptor) * Add project metadata to the gemspec #1046 (@orien) ## v0.17.3 Fixes: * Reverts changes in error classes hierarchy. #1092 (@iMacTia) * Fix Ruby 1.9 syntax errors and improve Error class testing #1094 (@BanzaiMan, @mrexox, @technoweenie) Misc: * Stops using `&Proc.new` for block forwarding. #1083 (@olleolleolle) * Update CI to test against ruby 2.0-2.7 #1087, #1099 (@iMacTia, @olleolleolle, @technoweenie) * require FARADAY_DEPRECATE=warn to show Faraday v1.0 deprecation warnings #1098 (@technoweenie) ## v0.17.1 Final release before Faraday v1.0, with important fixes for Ruby 2.7. Fixes: * RaiseError response middleware raises exception if HTTP client returns a nil status. #1042 (@jonnyom, @BobbyMcWho) Misc: * Fix Ruby 2.7 warnings (#1009) * Add `Faraday::Deprecate` to warn about upcoming v1.0 changes. (#1054, #1059, #1076, #1077) * Add release notes up to current in CHANGELOG.md (#1066) * Port minimal rspec suite from main branch to run backported tests. (#1058) ## v0.17.0 This release is the same as v0.15.4. It was pushed to cover up releases v0.16.0-v0.16.2. ## v0.15.4 * Expose `pool_size` as a option for the NetHttpPersistent adapter (#834) ## v0.15.3 * Make Faraday::Request serialisable with Marshal. (#803) * Add DEFAULT_EXCEPTIONS constant to Request::Retry (#814) * Add support for Ruby 2.6 Net::HTTP write_timeout (#824) ## v0.15.2 * Prevents `Net::HTTP` adapters to retry request internally by setting `max_retries` to 0 if available (Ruby 2.5+). (#799) * Fixes `NestedParamsEncoder` handling of empty array values (#801) ## v0.15.1 * NetHttpPersistent adapter better reuse of SSL connections (#793) * Refactor: inline cached_connection (#797) * Logger middleware: use $stdout instead of STDOUT (#794) * Fix: do not memoize/reuse Patron session (#796) Also in this release: * Allow setting min/max ssl version for Net::HTTP (#792) * Allow setting min/max ssl version for Excon (#795) ## v0.15.0 Features: * Added retry block option to retry middleware. (#770) * Retry middleware improvements (honour Retry-After header, retry statuses) (#773) * Improve response logger middleware output (#784) Fixes: * Remove unused class error (#767) * Fix minor typo in README (#760) * Reuse persistent connections when using net-http-persistent (#778) * Fix Retry middleware documentation (#781) * Returns the http response when giving up on retrying by status (#783) ## v0.14.0 Features: * Allow overriding env proxy #754 (@iMacTia) * Remove legacy Typhoeus adapter #715 (@olleolleolle) * External Typhoeus Adapter Compatibility #748 (@iMacTia) * Warn about missing adapter when making a request #743 (@antstorm) * Faraday::Adapter::Test stubs now support entire urls (with host) #741 (@erik-escobedo) Fixes: * If proxy is manually provided, this takes priority over `find_proxy` #724 (@iMacTia) * Fixes the behaviour for Excon's open_timeout (not setting write_timeout anymore) #731 (@apachelogger) * Handle all connection timeout messages in Patron #687 (@stayhero) ## v0.13.1 * Fixes an incompatibility with Addressable::URI being used as uri_parser ## v0.13.0 Features: * Dynamically reloads the proxy when performing a request on an absolute domain (#701) * Adapter support for Net::HTTP::Persistent v3.0.0 (#619) Fixes: * Prefer #hostname over #host. (#714) * Fixes an edge-case issue with response headers parsing (missing HTTP header) (#719) ## v0.12.2 * Parse headers from aggregated proxy requests/responses (#681) * Guard against invalid middleware configuration with warning (#685) * Do not use :insecure option by default in Patron (#691) * Fixes an issue with HTTPClient not raising a `Faraday::ConnectionFailed` (#702) * Fixes YAML serialization/deserialization for `Faraday::Utils::Headers` (#690) * Fixes an issue with Options having a nil value (#694) * Fixes an issue with Faraday.default_connection not using Faraday.default_connection_options (#698) * Fixes an issue with Options.merge! and Faraday instrumentation middleware (#710) ## v0.12.1 * Fix an issue with Patron tests failing on jruby * Fix an issue with new `rewind_files` feature that was causing an exception when the body was not an Hash * Expose wrapped_exception in all client errors * Add Authentication Section to the ReadMe ## v0.12.0.1 * Hotfix release to address an issue with TravisCI deploy on Rubygems ## v0.12.0 Features: * Proxy feature now relies on Ruby `URI::Generic#find_proxy` and can use `no_proxy` ENV variable (not compatible with ruby < 2.0) * Adds support for `context` request option to pass arbitrary information to middlewares Fixes: * Fix an issue with options that was causing new options to override defaults ones unexpectedly * Rewind `UploadIO`s on retry to fix a compatibility issue * Make multipart boundary unique * Improvements in `README.md` ## v0.11.0 Features: * Add `filter` method to Logger middleware * Add support for Ruby2.4 and Minitest 6 * Introduce block syntax to customise the adapter Fixes: * Fix an issue that was allowing to override `default_connection_options` from a connection instance * Fix a bug that was causing newline escape characters ("\n") to be used when building the Authorization header ## v0.10.1 - Fix an issue with HTTPClient adapter that was causing the SSL to be reset on every request - Rescue `IOError` instead of specific subclass - `Faraday::Utils::Headers` can now be successfully serialised in YAML - Handle `default_connection_options` set with hash ## v0.10.0 Breaking changes: - Drop support for Ruby 1.8 Features: - Include wrapped exception/reponse in ClientErrors - Add `response.reason_phrase` - Provide option to selectively skip logging request/response headers - Add regex support for pattern matching in `test` adapter Fixes: - Add `Faraday.respond_to?` to find methods managed by `method_missing` - em-http: `request.host` instead of `connection.host` should be taken for SSL validations - Allow `default_connection_options` to be merged when options are passed as url parameter - Improve splitting key-value pairs in raw HTTP headers ## v0.9.2 Adapters: - Enable gzip compression for httpclient - Fixes default certificate store for httpclient not having default paths. - Make excon adapter compatible with 0.44 excon version - Add compatibility with Patron 0.4.20 - Determine default port numbers in Net::HTTP adapters (Addressable compatibility) - em-http: wrap "connection closed by server" as ConnectionFailed type - Wrap Errno::ETIMEDOUT in Faraday::Error::TimeoutError Utils: - Add Rack-compatible support for parsing `a[][b]=c` nested queries - Encode nil values in queries different than empty strings. Before: `a=`; now: `a`. - Have `Faraday::Utils::Headers#replace` clear internal key cache - Dup the internal key cache when a Headers hash is copied Env and middleware: - Ensure `env` stored on middleware response has reference to the response - Ensure that Response properties are initialized during `on_complete` (VCR compatibility) - Copy request options in Faraday::Connection#dup - Env custom members should be copied by Env.from(env) - Honour per-request `request.options.params_encoder` - Fix `interval_randomness` data type for Retry middleware - Add maximum interval option for Retry middleware ## v0.9.1 * Refactor Net:HTTP adapter so that with_net_http_connection can be overridden to allow pooled connections. (@Ben-M) * Add configurable methods that bypass `retry_if` in the Retry request middleware. (@mike-bourgeous) ## v0.9.0 * Add HTTPClient adapter (@hakanensari) * Improve Retry handler (@mislav) * Remove autoloading by default (@technoweenie) * Improve internal docs (@technoweenie, @mislav) * Respect user/password in http proxy string (@mislav) * Adapter options are structs. Reinforces consistent options across adapters (@technoweenie) * Stop stripping trailing / off base URLs in a Faraday::Connection. (@technoweenie) * Add a configurable URI parser. (@technoweenie) * Remove need to manually autoload when using the authorization header helpers on `Faraday::Connection`. (@technoweenie) * `Faraday::Adapter::Test` respects the `Faraday::RequestOptions#params_encoder` option. (@technoweenie) faraday-1.1.0/Gemfile 0000664 0000000 0000000 00000001571 13742546043 0014427 0 ustar 00root root 0000000 0000000 # frozen_string_literal: true source 'https://rubygems.org' ruby RUBY_VERSION gem 'jruby-openssl', '~> 0.8.8', platforms: :jruby group :development, :test do gem 'pry' gem 'rake' end group :lint, :development do gem 'rubocop', '~> 0.90.0' gem 'rubocop-packaging', '~> 0.5' gem 'rubocop-performance', '~> 1.0' end group :test, :development do gem 'coveralls', require: false gem 'em-http-request', '>= 1.1', require: 'em-http' gem 'em-synchrony', '>= 1.0.3', require: %w[em-synchrony em-synchrony/em-http] gem 'excon', '>= 0.27.4' gem 'httpclient', '>= 2.2' gem 'multipart-parser' gem 'net-http-persistent', '~> 3.0' gem 'patron', '>= 0.4.2', platforms: :ruby gem 'rack-test', '>= 0.6', require: 'rack/test' gem 'rspec', '~> 3.7' gem 'rspec_junit_formatter', '~> 0.4' gem 'simplecov' gem 'typhoeus', '~> 1.4' gem 'webmock', '~> 3.4' end gemspec faraday-1.1.0/LICENSE.md 0000664 0000000 0000000 00000002060 13742546043 0014532 0 ustar 00root root 0000000 0000000 Copyright (c) 2009-2020 Rick Olson, Zack Hobson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. faraday-1.1.0/README.md 0000664 0000000 0000000 00000005047 13742546043 0014415 0 ustar 00root root 0000000 0000000 # [][website] [](https://rubygems.org/gems/faraday) [](https://github.com/lostisland/faraday/actions?query=workflow%3ACI) [](https://codeclimate.com/github/lostisland/faraday/maintainability) [](https://gitter.im/lostisland/faraday?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) Faraday is an HTTP client library that provides a common interface over many adapters (such as Net::HTTP) and embraces the concept of Rack middleware when processing the request/response cycle. ## Getting Started The best starting point is the [Faraday Website][website], with its introduction and explanation. Need more details? See the [Faraday API Documentation][apidoc] to see how it works internally. ## Supported Ruby versions This library aims to support and is [tested against][actions] the following Ruby implementations: * Ruby 2.4+ If something doesn't work on one of these Ruby versions, it's a bug. This library may inadvertently work (or seem to work) on other Ruby implementations and versions, however support will only be provided for the versions listed above. If you would like this library to support another Ruby version, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped. ## Contribute Do you want to contribute to Faraday? Open the issues page and check for the `help wanted` label! But before you start coding, please read our [Contributing Guide][contributing] ## Copyright © 2009 - 2020, the [Faraday Team][faraday_team]. Website and branding design by [Elena Lo Piccolo](https://elelopic.design). [website]: https://lostisland.github.io/faraday [faraday_team]: https://lostisland.github.io/faraday/team [contributing]: https://github.com/lostisland/faraday/blob/master/.github/CONTRIBUTING.md [apidoc]: http://www.rubydoc.info/gems/faraday [actions]: https://github.com/lostisland/faraday/actions [jruby]: http://jruby.org/ [rubinius]: http://rubini.us/ [license]: LICENSE.md faraday-1.1.0/Rakefile 0000664 0000000 0000000 00000000165 13742546043 0014577 0 ustar 00root root 0000000 0000000 # frozen_string_literal: true require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) task default: :spec faraday-1.1.0/UPGRADING.md 0000664 0000000 0000000 00000005040 13742546043 0014771 0 ustar 00root root 0000000 0000000 ## Faraday 2.0 ### Others * Rename `Faraday::Request#method` to `#http_method`. ## Faraday 1.0 ### Errors * Removes sub-class constants definition from `Faraday::Error`. A sub-class (e.g. `ClientError`) was previously accessible either through the `Faraday` module (e.g. `Faraday::ClientError`) or through the `Faraday::Error` class (e.g. `Faraday::Error::ClientError`). The latter is no longer available and the former should be used instead, so check your `rescue`s. * Introduces a new `Faraday::ServerError` (5xx status codes) alongside the existing `Faraday::ClientError` (4xx status codes). Please note `Faraday::ClientError` was previously used for both. * Introduces new Errors that describe the most common REST status codes: * Faraday::BadRequestError (400) * Faraday::UnauthorizedError (401) * Faraday::ForbiddenError (403) * Faraday::ProxyAuthError (407). Please note this raised a `Faraday::ConnectionFailed` before. * Faraday::ConflictError (409) * Faraday::UnprocessableEntityError (422) * The following error classes have changed the hierarchy to better mirror their real-world usage and semantic meaning: * TimeoutError < ServerError (was < ClientError) * ConnectionFailed < Error (was < ClientError) * SSLError < Error (was < ClientError) * ParsingError < Error (was < ClientError) * RetriableResponse < Error (was < ClientError) ### Custom adapters If you have written a custom adapter, please be aware that `env.body` is now an alias to the two new properties `request_body` and `response_body`. This should work without you noticing if your adapter inherits from `Faraday::Adapter` and calls `save_response`, but if it doesn't, then please ensure you set the `status` BEFORE the `body` while processing the response. ### Others * Dropped support for jruby and Rubinius. * Officially supports Ruby 2.4+ * In order to specify the adapter you now MUST use the `#adapter` method on the connection builder. If you don't do so and your adapter inherits from `Faraday::Adapter` then Faraday will raise an exception. Otherwise, Faraday will automatically push the default adapter at the end of the stack causing your request to be executed twice. ```ruby class OfficialAdapter < Faraday::Adapter ... end class MyAdapter ... end # This will raise an exception conn = Faraday.new(...) do |f| f.use OfficialAdapter end # This will cause Faraday inserting the default adapter at the end of the stack conn = Faraday.new(...) do |f| f.use MyAdapter end # You MUST use `adapter` method conn = Faraday.new(...) do |f| f.adapter AnyAdapter end ``` faraday-1.1.0/docs/ 0000775 0000000 0000000 00000000000 13742546043 0014060 5 ustar 00root root 0000000 0000000 faraday-1.1.0/docs/.gitignore 0000664 0000000 0000000 00000000043 13742546043 0016045 0 ustar 00root root 0000000 0000000 _site .sass-cache .jekyll-metadata faraday-1.1.0/docs/404.html 0000664 0000000 0000000 00000000616 13742546043 0015260 0 ustar 00root root 0000000 0000000 --- layout: default ---
Page not found :(
The requested page could not be found.
{% if page.prev_link %} {{ page.prev_name }} {% endif %}
{% if page.top_link %} {{ page.top_name }} {% endif %}
{% if page.next_link %} {{ page.next_name }} {% endif %}