pax_global_header 0000666 0000000 0000000 00000000064 14335663702 0014523 g ustar 00root root 0000000 0000000 52 comment=c6668ef8a8dc16113d6a4d1c7e88521413b7e4eb faraday-2.7.1/ 0000775 0000000 0000000 00000000000 14335663702 0013141 5 ustar 00root root 0000000 0000000 faraday-2.7.1/.editorconfig 0000664 0000000 0000000 00000000223 14335663702 0015613 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-2.7.1/.github/ 0000775 0000000 0000000 00000000000 14335663702 0014501 5 ustar 00root root 0000000 0000000 faraday-2.7.1/.github/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000006240 14335663702 0017302 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-2.7.1/.github/CONTRIBUTING.md 0000664 0000000 0000000 00000010453 14335663702 0016735 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 in the Pull Request, so we can add it to the [Changelog][]. ### Policy on inclusive language You have read our [Code of Conduct][], which includes a note about **inclusive language**. This section tries to make that actionable. Faraday has a large and diverse userbase. To make Faraday a pleasant and effective experience for everyone, we use inclusive language. These resources can help: - Google's tutorial [Writing inclusive documentation](https://developers.google.com/style/inclusive-documentation) teaches by example, how to reword non-inclusive things. - Linux kernel mailing list's [Coding Style: Inclusive Terminology](https://lkml.org/lkml/2020/7/4/229) said "Add no new instances of non-inclusive words, here is a list of words not include new ones of." - Linguistic Society of America published [Guidelines for Inclusive Language](https://www.linguisticsociety.org/resource/guidelines-inclusive-language) which concluded: "We encourage all linguists to consider the possible reactions of their potential audience to their writing and, in so doing, to choose expository practices and content that is positive, inclusive, and respectful." This project attempts to improve in these areas. Join us in doing that important work. If you want to privately raise any breach to this policy with the Faraday team, feel free to reach out to [@iMacTia](https://twitter.com/iMacTia) and [@olleolleolle](https://twitter.com/olleolleolle) on Twitter. ### 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 # 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 the 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 by 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 navigate to `http://localhost` to see the website running. Any change done to files in the `/docs` folder will be automatically picked up (with the exception of config changes). #### Test website changes using Jekyll You can test website changes locally, on your machine, too. Here's how: Navigate into the /docs folder: ```bash $ cd docs ``` Install Jekyll dependencies, this bundle is different from Faraday's one. ```bash $ bundle install ``` Run the Jekyll server with the Faraday website ```bash $ bundle exec jekyll serve ``` Now, navigate to http://127.0.0.1:4000/faraday/ to see the website running. [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 [Code of Conduct]: ./CODE_OF_CONDUCT.md faraday-2.7.1/.github/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000001440 14335663702 0017205 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-2.7.1/.github/PULL_REQUEST_TEMPLATE.md 0000664 0000000 0000000 00000000420 14335663702 0020276 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-2.7.1/.github/workflows/ 0000775 0000000 0000000 00000000000 14335663702 0016536 5 ustar 00root root 0000000 0000000 faraday-2.7.1/.github/workflows/ci.yml 0000664 0000000 0000000 00000002764 14335663702 0017665 0 ustar 00root root 0000000 0000000 name: CI on: pull_request: push: branches: [ main, 1.x, 0.1x ] env: GIT_COMMIT_SHA: ${{ github.sha }} GIT_BRANCH: ${{ github.ref }} COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} permissions: contents: read # to fetch code (actions/checkout) jobs: linting: runs-on: ubuntu-latest env: BUNDLE_WITH: lint BUNDLE_WITHOUT: development:test steps: - uses: actions/checkout@v3 - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 bundler-cache: true - name: Rubocop run: bundle exec rubocop --format progress - name: Yard-Junk run: bundle exec yard-junk --path lib build: needs: [ linting ] runs-on: ubuntu-latest name: build ${{ matrix.ruby }} strategy: fail-fast: false matrix: ruby: [ '2.6', '2.7', '3.0', '3.1' ] experimental: [false] include: - ruby: head experimental: true - ruby: truffleruby-head experimental: true steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: RSpec continue-on-error: ${{ matrix.experimental }} run: bundle exec rake - name: Test External Adapters if: ${{ matrix.ruby != '2.6' }} continue-on-error: ${{ matrix.experimental }} run: bundle exec bake test:external faraday-2.7.1/.github/workflows/publish.yml 0000664 0000000 0000000 00000000763 14335663702 0020735 0 ustar 00root root 0000000 0000000 name: Publish on: release: types: [published] permissions: contents: read # to checkout the code (actions/checkout) jobs: build: name: Publish to Rubygems runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Ruby 2.7 uses: actions/setup-ruby@v1 with: ruby-version: 2.7 - name: Publish to RubyGems uses: dawidd6/action-publish-gem@v1 with: api_key: ${{secrets.RUBYGEMS_AUTH_TOKEN}} faraday-2.7.1/.github/workflows/refresh_team_page.yml 0000664 0000000 0000000 00000000456 14335663702 0022726 0 ustar 00root root 0000000 0000000 name: Refresh Team Page on: push: branches: [ main ] permissions: {} jobs: build: name: Refresh Contributors Stats runs-on: ubuntu-latest steps: - name: Call GitHub API run: | curl "https://api.github.com/repos/${{ github.repository }}/stats/contributors" faraday-2.7.1/.gitignore 0000664 0000000 0000000 00000000303 14335663702 0015125 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 external ## PROJECT::SPECIFIC .rbx ## IDEs .idea/ .yardoc/ faraday-2.7.1/.rspec 0000664 0000000 0000000 00000000065 14335663702 0014257 0 ustar 00root root 0000000 0000000 --require spec_helper --format documentation --color faraday-2.7.1/.rubocop.yml 0000664 0000000 0000000 00000012251 14335663702 0015414 0 ustar 00root root 0000000 0000000 inherit_from: .rubocop_todo.yml require: - rubocop-packaging - rubocop-performance AllCops: DisplayCopNames: true DisplayStyleGuide: true TargetRubyVersion: 2.6 # Custom config Gemspec/RequireMFA: # we don't know if this works with auto-deployments yet Enabled: false Layout/LineLength: Exclude: - spec/**/*.rb - examples/**/*.rb Metrics/BlockLength: Exclude: - spec/**/*.rb - examples/**/*.rb Style/Documentation: Exclude: - 'spec/**/*' - 'examples/**/*' Style/DoubleNegation: Enabled: false Style/IfUnlessModifier: Enabled: false # New cops Gemspec/DeprecatedAttributeAssignment: # new in 1.30 Enabled: true Layout/LineContinuationLeadingSpace: # new in 1.31 Enabled: true Layout/LineContinuationSpacing: # new in 1.31 Enabled: true Layout/LineEndStringConcatenationIndentation: # new in 1.18 Enabled: true Layout/SpaceBeforeBrackets: # new in 1.7 Enabled: true Lint/AmbiguousAssignment: # new in 1.7 Enabled: true Lint/AmbiguousOperatorPrecedence: # new in 1.21 Enabled: true Lint/AmbiguousRange: # new in 1.19 Enabled: true Lint/ConstantOverwrittenInRescue: # new in 1.31 Enabled: true Lint/DeprecatedConstants: # new in 1.8 Enabled: true Lint/DuplicateBranch: # new in 1.3 Enabled: true Lint/DuplicateRegexpCharacterClassElement: # new in 1.1 Enabled: true Lint/EmptyBlock: # new in 1.1 Enabled: true Lint/EmptyClass: # new in 1.3 Enabled: true Lint/EmptyInPattern: # new in 1.16 Enabled: true Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21 Enabled: true Lint/LambdaWithoutLiteralBlock: # new in 1.8 Enabled: true Lint/NoReturnInBeginEndBlocks: # new in 1.2 Enabled: true Lint/NonAtomicFileOperation: # new in 1.31 Enabled: true Lint/NumberedParameterAssignment: # new in 1.9 Enabled: true Lint/OrAssignmentToConstant: # new in 1.9 Enabled: true Lint/RedundantDirGlobSort: # new in 1.8 Enabled: true Lint/RefinementImportMethods: # new in 1.27 Enabled: true Lint/RequireRangeParentheses: # new in 1.32 Enabled: true Lint/RequireRelativeSelfPath: # new in 1.22 Enabled: true Lint/SymbolConversion: # new in 1.9 Enabled: true Lint/ToEnumArguments: # new in 1.1 Enabled: true Lint/TripleQuotes: # new in 1.9 Enabled: true Lint/UnexpectedBlockArity: # new in 1.5 Enabled: true Lint/UnmodifiedReduceAccumulator: # new in 1.1 Enabled: true Lint/UselessRuby2Keywords: # new in 1.23 Enabled: true Naming/BlockForwarding: # new in 1.24 Enabled: true Security/CompoundHash: # new in 1.28 Enabled: true Security/IoMethods: # new in 1.22 Enabled: true Style/ArgumentsForwarding: # new in 1.1 Enabled: true Style/CollectionCompact: # new in 1.2 Enabled: true Style/DocumentDynamicEvalDefinition: # new in 1.1 Enabled: true Style/EmptyHeredoc: # new in 1.32 Enabled: true Style/EndlessMethod: # new in 1.8 Enabled: true Style/EnvHome: # new in 1.29 Enabled: true Style/FetchEnvVar: # new in 1.28 Enabled: true Style/FileRead: # new in 1.24 Enabled: true Style/FileWrite: # new in 1.24 Enabled: true Style/HashConversion: # new in 1.10 Enabled: true Style/HashExcept: # new in 1.7 Enabled: true Style/IfWithBooleanLiteralBranches: # new in 1.9 Enabled: true Style/InPatternThen: # new in 1.16 Enabled: true Style/MapCompactWithConditionalBlock: # new in 1.30 Enabled: true Style/MapToHash: # new in 1.24 Enabled: true Style/MultilineInPatternThen: # new in 1.16 Enabled: true Style/NegatedIfElseCondition: # new in 1.2 Enabled: true Style/NestedFileDirname: # new in 1.26 Enabled: true Style/NilLambda: # new in 1.3 Enabled: true Style/NumberedParameters: # new in 1.22 Enabled: true Style/NumberedParametersLimit: # new in 1.22 Enabled: true Style/ObjectThen: # new in 1.28 Enabled: true Style/OpenStructUse: # new in 1.23 Enabled: true Style/QuotedSymbols: # new in 1.16 Enabled: true Style/RedundantArgument: # new in 1.4 Enabled: true Style/RedundantInitialize: # new in 1.27 Enabled: true Style/RedundantSelfAssignmentBranch: # new in 1.19 Enabled: true Style/SelectByRegexp: # new in 1.22 Enabled: true Style/StringChars: # new in 1.12 Enabled: true Style/SwapValues: # new in 1.1 Enabled: true Performance/AncestorsInclude: # new in 1.7 Enabled: true Performance/BigDecimalWithNumericArgument: # new in 1.7 Enabled: true Performance/BlockGivenWithExplicitBlock: # new in 1.9 Enabled: true Performance/CollectionLiteralInLoop: # new in 1.8 Enabled: true Performance/ConcurrentMonotonicTime: # new in 1.12 Enabled: true Performance/ConstantRegexp: # new in 1.9 Enabled: true Performance/MapCompact: # new in 1.11 Enabled: true Performance/MethodObjectAsBlock: # new in 1.9 Enabled: true Performance/RedundantEqualityComparisonBlock: # new in 1.10 Enabled: true Performance/RedundantSortBlock: # new in 1.7 Enabled: true Performance/RedundantSplitRegexpArgument: # new in 1.10 Enabled: true Performance/RedundantStringChars: # new in 1.7 Enabled: true Performance/ReverseFirst: # new in 1.7 Enabled: true Performance/SortReverse: # new in 1.7 Enabled: true Performance/Squeeze: # new in 1.7 Enabled: true Performance/StringIdentifierArgument: # new in 1.13 Enabled: true Performance/StringInclude: # new in 1.7 Enabled: true Performance/Sum: # new in 1.8 Enabled: true faraday-2.7.1/.rubocop_todo.yml 0000664 0000000 0000000 00000003471 14335663702 0016445 0 ustar 00root root 0000000 0000000 # This configuration was generated by # `rubocop --auto-gen-config` # on 2022-08-08 14:26:32 UTC using RuboCop version 1.33.0. # 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: 6 # Configuration parameters: AllowedMethods. # AllowedMethods: enums Lint/ConstantDefinitionInBlock: Exclude: - 'spec/faraday/options/options_spec.rb' - 'spec/faraday/rack_builder_spec.rb' - 'spec/faraday/request/instrumentation_spec.rb' # Offense count: 11 # Configuration parameters: AllowComments, AllowEmptyLambdas. Lint/EmptyBlock: Exclude: - 'spec/faraday/connection_spec.rb' - 'spec/faraday/rack_builder_spec.rb' - 'spec/faraday/response_spec.rb' # Offense count: 12 # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: Max: 42 # Offense count: 4 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: Max: 230 # Offense count: 9 # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/CyclomaticComplexity: Max: 13 # Offense count: 26 # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/MethodLength: Max: 33 # Offense count: 1 # Configuration parameters: CountKeywordArgs, MaxOptionalParameters. Metrics/ParameterLists: Max: 6 # Offense count: 6 # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. Metrics/PerceivedComplexity: Max: 14 # Offense count: 3 Style/DocumentDynamicEvalDefinition: Exclude: - 'lib/faraday/connection.rb' - 'lib/faraday/options.rb' faraday-2.7.1/.yardopts 0000664 0000000 0000000 00000000241 14335663702 0015004 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-2.7.1/CHANGELOG.md 0000664 0000000 0000000 00000057774 14335663702 0014776 0 ustar 00root root 0000000 0000000 # Faraday Changelog ## The changelog has moved! This file is not being updated anymore. Instead, please check the [Releases](https://github.com/lostisland/faraday/releases) page. ## [2.2.0](https://github.com/lostisland/faraday/compare/v2.1.0...v2.2.0) (2022-02-03) * Reintroduce the possibility to register middleware with symbols, strings or procs in [#1391](https://github.com/lostisland/faraday/pull/1391) ## [2.1.0](https://github.com/lostisland/faraday/compare/v2.0.1...v2.1.0) (2022-01-15) * Fix test adapter thread safety by @iMacTia in [#1380](https://github.com/lostisland/faraday/pull/1380) * Add default adapter options by @hirasawayuki in [#1382](https://github.com/lostisland/faraday/pull/1382) * CI: Add Ruby 3.1 to matrix by @petergoldstein in [#1374](https://github.com/lostisland/faraday/pull/1374) * docs: fix regex pattern in logger.md examples by @hirasawayuki in [#1378](https://github.com/lostisland/faraday/pull/1378) ## [2.0.1](https://github.com/lostisland/faraday/compare/v2.0.0...v2.0.1) (2022-01-05) * Re-add `faraday-net_http` as default adapter by @iMacTia in [#1366](https://github.com/lostisland/faraday/pull/1366) * Updated sample format in UPGRADING.md by @vimutter in [#1361](https://github.com/lostisland/faraday/pull/1361) * docs: Make UPGRADING examples more copyable by @olleolleolle in [#1363](https://github.com/lostisland/faraday/pull/1363) ## [2.0.0](https://github.com/lostisland/faraday/compare/v1.8.0...v2.0.0) (2022-01-04) The next major release is here, and it comes almost 2 years after the release of v1.0! This release changes the way you use Faraday and embraces a new paradigm of Faraday as an ecosystem, rather than a library. What does that mean? It means that Faraday is less of a bundled tool and more of a framework for the community to build on top of. As a result, all adapters and some middleware have moved out and are now shipped as standalone gems 🙌! But this doesn't mean that upgrading from Faraday 1.x to Faraday 2.0 should be hard, in fact we've listed everything you need to do in the [UPGRADING.md](https://github.com/lostisland/faraday/blob/main/UPGRADING.md) doc. Moreover, we've setup a new [awesome-faraday](https://github.com/lostisland/awesome-faraday) repository that will showcase a curated list of adapters and middleware 😎. This release was the result of the efforts of the core team and all the contributors, new and old, that have helped achieve this milestone 👏. ## What's Changed * Autoloading, dependency loading and middleware registry cleanup by @iMacTia in [#1301](https://github.com/lostisland/faraday/pull/1301) * Move JSON middleware (request and response) from faraday_middleware by @iMacTia in [#1300](https://github.com/lostisland/faraday/pull/1300) * Remove deprecated `Faraday::Request#method` by @olleolleolle in [#1303](https://github.com/lostisland/faraday/pull/1303) * Remove deprecated `Faraday::UploadIO` by @iMacTia in [#1307](https://github.com/lostisland/faraday/pull/1307) * [1.x] Deprecate Authorization helpers in `Faraday::Connection` by @iMacTia in [#1306](https://github.com/lostisland/faraday/pull/1306) * Drop deprecated auth helpers from Connection and refactor auth middleware by @iMacTia in [#1308](https://github.com/lostisland/faraday/pull/1308) * Add Faraday 1.x examples in authentication.md docs by @iMacTia in [#1320](https://github.com/lostisland/faraday/pull/1320) * Fix passing a URL with embedded basic auth by @iMacTia in [#1324](https://github.com/lostisland/faraday/pull/1324) * Register JSON middleware by @mollerhoj in [#1331](https://github.com/lostisland/faraday/pull/1331) * Retry middleware should handle string exception class name consistently by @jrochkind in [#1334](https://github.com/lostisland/faraday/pull/1334) * Improve request info in exceptions raised by RaiseError Middleware by @willianzocolau in [#1335](https://github.com/lostisland/faraday/pull/1335) * Remove net-http adapter and update docs by @iMacTia in [#1336](https://github.com/lostisland/faraday/pull/1336) * Explain plan for faraday_middleware in UPGRADING.md by @iMacTia in [#1339](https://github.com/lostisland/faraday/pull/1339) * Scripts folder cleanup by @iMacTia in [#1340](https://github.com/lostisland/faraday/pull/1340) * Replace `Hash#merge` with `Utils#deep_merge` for connection options by @xkwd in [#1343](https://github.com/lostisland/faraday/pull/1343) * Callable authorizers by @sled in [#1345](https://github.com/lostisland/faraday/pull/1345) * Default value for exc error by @DariuszMusielak in [#1351](https://github.com/lostisland/faraday/pull/1351) * Don't call `retry_block` unless a retry is going to happen by @jrochkind in [#1350](https://github.com/lostisland/faraday/pull/1350) * Improve documentation for v2 by @iMacTia in [#1353](https://github.com/lostisland/faraday/pull/1353) * Remove default `default_adapter` (yes, you read that right) by @iMacTia in [#1354](https://github.com/lostisland/faraday/pull/1354) * Remove retry middleware by @iMacTia in [#1356](https://github.com/lostisland/faraday/pull/1356) * Remove multipart middleware and all its documentation and tests by @iMacTia in [#1357](https://github.com/lostisland/faraday/pull/1357) ## [1.9.3](https://github.com/lostisland/faraday/compare/v1.9.2...v1.9.3) (2022-01-06) * Re-add support for Ruby 2.4+ by @iMacTia in [#1371](https://github.com/lostisland/faraday/pull/1371) ## [1.9.2](https://github.com/lostisland/faraday/compare/v1.9.1...v1.9.2) (2022-01-06) * Add alias with legacy name to gemified middleware by @iMacTia in [#1372](https://github.com/lostisland/faraday/pull/1372) ## [1.9.1](https://github.com/lostisland/faraday/compare/v1.9.0...v1.9.1) (2022-01-06) * Update adapter dependencies in Gemspec by @iMacTia in [#1370](https://github.com/lostisland/faraday/pull/1370) ## [1.9.0](https://github.com/lostisland/faraday/compare/v1.8.0...v1.9.0) (2022-01-06) * Use external multipart and retry middleware by @iMacTia in [#1367](https://github.com/lostisland/faraday/pull/1367) ## [1.8.0](https://github.com/lostisland/faraday/releases/tag/v1.8.0) (2021-09-18) ### Features * Backport authorization procs (#1322, @jarl-dk) ## [v1.7.0](https://github.com/lostisland/faraday/releases/tag/v1.7.0) (2021-08-09) ### Features * Add strict_mode to Test::Stubs (#1298, @yykamei) ## [v1.6.0](https://github.com/lostisland/faraday/releases/tag/v1.6.0) (2021-08-01) ### Misc * Use external Rack adapter (#1296, @iMacTia) ## [v1.5.1](https://github.com/lostisland/faraday/releases/tag/v1.5.1) (2021-07-11) ### Fixes * Fix JRuby incompatibility after moving out EM adapters (#1294, @ahorek) ### Documentation * Update YARD to follow RackBuilder (#1292, @kachick) ## [v1.5.0](https://github.com/lostisland/faraday/releases/tag/v1.5.0) (2021-07-04) ### Misc * Use external httpclient adapter (#1289, @iMacTia) * Use external patron adapter (#1290, @iMacTia) ## [v1.4.3](https://github.com/lostisland/faraday/releases/tag/v1.4.3) (2021-06-24) ### Fixes * Silence warning (#1286, @gurgeous) * Always dup url_prefix in Connection#build_exclusive_url (#1288, @alexeyds) ## [v1.4.2](https://github.com/lostisland/faraday/releases/tag/v1.4.2) (2021-05-22) ### Fixes * Add proxy setting when url_prefix is changed (#1276, @ci) * Default proxy scheme to http:// if necessary, fixes #1282 (#1283, @gurgeous) ### Documentation * Improve introduction page (#1273, @gurgeous) * Docs: add more middleware examples (#1277, @gurgeous) ### Misc * Use external `em_http` and `em_synchrony` adapters (#1274, @iMacTia) ## [v1.4.1](https://github.com/lostisland/faraday/releases/tag/v1.4.1) (2021-04-18) ### Fixes * Fix dependencies from external adapter gems (#1269, @iMacTia) ## [v1.4.0](https://github.com/lostisland/faraday/releases/tag/v1.4.0) (2021-04-16) ### Highlights With this release, we continue the work of gradually moving out adapters into their own gems 🎉 Thanks to @MikeRogers0 for helping the Faraday team in progressing with this quest 👏 And thanks to @olleolleolle efforts, Faraday is becoming more inclusive than ever 🤗 Faraday's `master` branch has been renamed into `main`, we have an official policy on inclusive language and even a rubocop plugin to check for non-inclusive words ❤️! Checkout the "Misc" section below for more details 🙌 ! ### Fixes * Fix NoMethodError undefined method 'coverage' (#1255, @Maroo-b) ### Documentation * Some docs on EventMachine adapters. (#1232, @damau) * CONTRIBUTING: Fix grammar and layout (#1261, @olleolleolle) ### Misc * Replacing Net::HTTP::Persistent with faraday-net_http_persistent (#1250, @MikeRogers0) * CI: Configure the regenerated Coveralls token (#1256, @olleolleolle) * Replace Excon adapter with Faraday::Excon gem, and fix autoloading issue with Faraday::NetHttpPersistent (#1257, @iMacTia) * Drop CodeClimate (#1259, @olleolleolle) * CI: Rename default branch to main (#1263, @olleolleolle) * Drop RDoc support file .document (#1264, @olleolleolle, @iMacTia) * CONTRIBUTING: add a policy on inclusive language (#1262, @olleolleolle) * Add rubocop-inclusivity (#1267, @olleolleolle, @iMacTia) ## [v1.3.1](https://github.com/lostisland/faraday/releases/tag/v1.3.1) (2021-04-16) ### Fixes * Escape colon in path segment (#1237, @yarafan) * Handle IPv6 address String on Faraday::Connection#proxy_from_env (#1252, @cosmo0920) ### Documentation * Fix broken Rubydoc.info links (#1236, @nickcampbell18) * Add httpx to list of external adapters (#1246, @HoneyryderChuck) ### Misc * Refactor CI to remove duplicated line (#1230, @tricknotes) * Gemspec: Pick a good ruby2_keywords release (#1241, @olleolleolle) ## [v1.3.0](https://github.com/lostisland/faraday/releases/tag/v1.3.0) (2020-12-31) ### Highlights Faraday v1.3.0 is the first release to officially support Ruby 3.0 in the CI pipeline 🎉 🍾! This is also the first release with a previously "included" adapter (Net::HTTP) being isolated into a [separate gem](https://github.com/lostisland/faraday-net_http) 🎊! The new adapter is added to Faraday as a dependency for now, so that means full backwards-compatibility, but just to be safe be careful when upgrading! This is a huge step towards are Faraday v2.0 objective of pushing adapters and middleware into separate gems. Many thanks to the Faraday Team, @JanDintel and everyone who attended the [ROSS Conf remote event](https://www.rossconf.io/event/remote/) ### Features * Improves consistency with Faraday::Error and Faraday::RaiseError (#1229, @qsona, @iMacTia) ### Fixes * Don't assign to global ::Timer (#1227, @bpo) ### Documentation * CHANGELOG: add releases after 1.0 (#1225, @olleolleolle) * Improves retry middleware documentation. (#1228, @iMacTia) ### Misc * Move out Net::HTTP adapter (#1222, @JanDintel, @iMacTia) * Adds Ruby 3.0 to CI Matrix (#1226, @iMacTia) ## [v1.2.0](https://github.com/lostisland/faraday/releases/tag/v1.2.0) (2020-12-23) ### Features * Introduces `on_request` and `on_complete` methods in `Faraday::Middleware`. (#1194, @iMacTia) ### Fixes * Require 'date' to avoid retry exception (#1206, @rustygeldmacher) * Fix rdebug recursion issue (#1205, @native-api) * Update call to `em_http_ssl_patch` (#1202, @kylekeesling) * `EmHttp` adapter: drop superfluous loaded? check (#1213, @olleolleolle) * Avoid 1 use of keyword hackery (#1211, @grosser) * Fix #1219 `Net::HTTP` still uses env proxy (#1221, @iMacTia) ### Documentation * Add comment in gemspec to explain exposure of `examples` and `spec` folders. (#1192, @iMacTia) * Adapters, how to create them (#1193, @olleolleolle) * Update documentation on using the logger (#1196, @tijmenb) * Adjust the retry documentation and spec to align with implementation (#1198, @nbeyer) ### Misc * Test against ruby head (#1208, @grosser) ## [v1.1.0](https://github.com/lostisland/faraday/releases/tag/v1.1.0) (2020-10-17) ### Features * Makes parameters sorting configurable (#1162 @wishdev) * Introduces `flat_encode` option for multipart adapter. (#1163 @iMacTia) * Include request info in exceptions raised by RaiseError Middleware (#1181 @SandroDamilano) ### Fixes * Avoid `last arg as keyword param` warning when building user middleware on Ruby 2.7 (#1153 @dgholz) * Limits net-http-persistent version to < 4.0 (#1156 @iMacTia) * Update `typhoeus` to new stable version (`1.4`) (#1159 @AlexWayfer) * Properly fix test failure with Rack 2.1+. (#1171 @voxik) ### Documentation * Improves documentation on how to contribute to the site by using Docker. (#1175 @iMacTia) * Remove retry_change_requests from documentation (#1185 @stim371) ### Misc * Link from GitHub Actions badge to CI workflow (#1141 @olleolleolle) * Return tests of `Test` adapter (#1147 @AlexWayfer) * Add 1.0 release to wording in CONTRIBUTING (#1155 @olleolleolle) * Fix linting bumping Rubocop to 0.90.0 (#1182 @iMacTia) * Drop `git ls-files` in gemspec (#1183 @utkarsh2102) * Upgrade CI to ruby/setup-ruby (#1187 @gogainda) ## [v1.0.1](https://github.com/lostisland/faraday/releases/tag/v1.0.1) (2020-03-29) ### Fixes * Use Net::HTTP#start(&block) to ensure closed TCP connections (#1117) * Fully qualify constants to be checked (#1122) * Allows `parse` method to be private/protected in response middleware (#1123) * Encode Spaces in Query Strings as '%20' Instead of '+' (#1125) * Limits rack to v2.0.x (#1127) * Adapter Registry reads also use mutex (#1136) ### Documentation * Retry middleware documentation fix (#1109) * Docs(retry): precise usage of retry-after (#1111) * README: Link the logo to the website (#1112) * Website: add search bar (#1116) * Fix request/response mix-up in docs text (#1132) ## [v1.0](https://github.com/lostisland/faraday/releases/tag/v1.0.0) (2020-01-22) 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.4 Fixes: * NetHttp adapter: wrap Errno::EADDRNOTAVAIL (#1114, @embs) * Fix === for subclasses of deprecated classes (#1243, @mervync) ## 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-2.7.1/Gemfile 0000664 0000000 0000000 00000001314 14335663702 0014433 0 ustar 00root root 0000000 0000000 # frozen_string_literal: true source 'https://rubygems.org' # Even though we don't officially support JRuby, this dependency makes Faraday # compatible with it, so we're leaving it in for jruby users to use it. gem 'jruby-openssl', '~> 0.11.0', platforms: :jruby group :development, :test do gem 'bake-test-external' gem 'coveralls_reborn', require: false gem 'pry' gem 'rack', '~> 2.2' gem 'rake' gem 'rspec', '~> 3.7' gem 'rspec_junit_formatter', '~> 0.4' gem 'simplecov' gem 'webmock', '~> 3.4' end group :development, :lint do gem 'rubocop' gem 'rubocop-packaging', github: 'utkarsh2102/rubocop-packaging' # '~> 0.5' gem 'rubocop-performance', '~> 1.0' gem 'yard-junk' end gemspec faraday-2.7.1/LICENSE.md 0000664 0000000 0000000 00000002060 14335663702 0014543 0 ustar 00root root 0000000 0000000 Copyright (c) 2009-2022 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-2.7.1/README.md 0000664 0000000 0000000 00000005623 14335663702 0014426 0 ustar 00root root 0000000 0000000 # [][website] [](https://rubygems.org/gems/faraday) [](https://github.com/lostisland/faraday/actions?query=workflow%3ACI) [](https://github.com/lostisland/faraday/discussions) Faraday is an HTTP client library abstraction layer 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. You probably don't want to use Faraday directly in your project, as it will lack an actual client library to perform requests. Instead, you probably want to have a look at [Awesome Faraday][awesome] for a list of available adapters. ## 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 currently officially supported Ruby implementations. This means that, even without a major release, we could add or drop support for Ruby versions, following their [EOL](https://endoflife.date/ruby). Currently that means we support Ruby 2.6+ 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 - 2022, the [Faraday Team][faraday_team]. Website and branding design by [Elena Lo Piccolo](https://elelopic.design). [awesome]: https://github.com/lostisland/awesome-faraday/#adapters [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]: https://www.rubydoc.info/github/lostisland/faraday [actions]: https://github.com/lostisland/faraday/actions [jruby]: http://jruby.org/ [rubinius]: http://rubini.us/ [license]: LICENSE.md faraday-2.7.1/Rakefile 0000664 0000000 0000000 00000000165 14335663702 0014610 0 ustar 00root root 0000000 0000000 # frozen_string_literal: true require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) task default: :spec faraday-2.7.1/UPGRADING.md 0000664 0000000 0000000 00000024546 14335663702 0015016 0 ustar 00root root 0000000 0000000 ## Faraday 2.0 ### Adapters have moved! With this release, we've officially moved all adapters, except for the `net_http` one, out of Faraday. What that means, is that they won't be available out-of-the-box anymore, and you'll instead need to add them to your Gemfile. **NOTE: the `net_http` adapter was originally removed as well in version `2.0`, but quickly reintroduced in version `2.0.1`. We strongly suggest you to skip version `2.0` and instead use version `2.0.1` or greater.** #### Why was this decision made? We've taken this decision for the following technical reasons: * We wanted the Faraday gem to focus on providing a clean, standardized, middleware-stack-based API. * We wanted to free the core team from maintaining all the different adapters, relying more on the community to maintain them based on the broad interest. This will allow the core team to focus on implementing features focused on the Faraday API more quickly, without having to push it on all adapters immediately. * With the community creating more and more adapters, we wanted to avoid having first and second-class adapters by having some of them included with the gem and others available externally. * Moving adapters into separate gems allow to solve the dependency issues once and for all. Faraday will remain a dependency-free gem, while adapter gems will be able to automatically pull any necessary dependency, without having to rely on the developer to do so. #### So what will this mean for me? We did our best to make this transition as painless as possible for you, so here is what we did. * All adapters, except for the `net_http` one, have already been moved out and released as separate gems. They've then been re-added into Faraday's v1 dependencies so that you wouldn't notice. This means that immediately after v2.0 will be released, all the adapters that were previously available will be already compatible with Faraday 2.0! * We've setup an [Awesome Faraday](https://github.com/lostisland/awesome-faraday) repository, where you can find and discover adapters. We also highlighted their unique features and level of compliance with Faraday's features. #### That's great! What should I change in my code immediately after upgrading? * If you just use the default `net_http` adapter, then you don't need to do anything! * Otherwise, add the corresponding adapter gem to your Gemfile (e.g. `faraday-net_http_persistent`). Then, simply require them after you require `faraday`. ```ruby # Gemfile gem 'faraday' gem 'faraday-net_http_persistent' # Code require 'faraday' require 'faraday/net_http_persistent' ``` ### Faraday Middleware Deprecation In case you never used it, [Faraday Middleware](https://github.com/lostisland/faraday_middleware) is a handy collection of middleware that have so far been maintained by the Faraday core team. With Faraday 2.0 focusing on becoming an ecosystem, rather than an out-of-the-box solution, it only made sense to take the same approach for middleware as we did for adapters. For this reason, `faraday_middleware` will not be updated to support Faraday 2.0. Instead, we'll support the transition from centralised-repo collection of middleware to individual middleware gems, effectively replicating what we did with adapters. Each middleware will have its own repository and gem, and it will allow developers to only add the ones they require to their Gemfile. So don't fret yet! We're doing our best to support our `faraday_middleware` users out there, so here are the steps we've taken to make this work: * We've promoted the highly popular JSON middleware (both request encoding and response parsing) to a core middleware and it will now be shipped together with Faraday. We expect many `faraday_middleware` users will be able to just stop using the extra dependency thanks to this. * We've created a [faraday-middleware-template](https://github.com/lostisland/faraday-middleware-template) repository that will make creating a new middleware gem simple and straightforward. * We've added a middleware section to the [awesome-faraday](https://github.com/lostisland/awesome-faraday) repo, so you can easily find available middleware when you need it. It will obviously take time for some of the middleware in `faraday_middleware` to make its way into a separate gem, so we appreciate this might be an upgrade obstacle for some. However this is part of an effort to focus the core team resources tackling the most requested features. We'll be listening to the community and prioritize middleware that are most used, and will be welcoming contributors who want to become owners of the middleware when these become separate from the `faraday_middleware` repo. ### Bundled middleware moved out Moving middleware into its own gem makes sense not only for `faraday_middleware`, but also for middleware bundled with Faraday. As of v2.0, the `retry` and `multipart` middleware have been moved to separate `faraday-retry` and `faraday-multipart` gems. These have been identified as good candidates due to their complexity and external dependencies. Thanks to this change, we were able to make Faraday 2.0 completely dependency free 🎉 (the only exception being `ruby2_keywords`, which will be necessary only while we keep supporting Ruby 2.6). #### So what should I do if I currently use the `retry` or `multipart` middleware? Upgrading is pretty simple, because the middleware was simply moved out to external gems. All you need to do is to add them to your gemfile (either `faraday-retry` or `faraday-multipart` and require them before usage: ```ruby # Gemfile gem 'faraday-multipart' gem 'faraday-retry' # Connection initializer require 'faraday/retry' require 'faraday/multipart' conn = Faraday.new(url) do |f| f.request :multipart f.request :retry # ... end ``` ### Autoloading and dependencies Faraday has until now provided and relied on a complex dynamic dependencies system. This would allow to reference classes and require dependencies only when needed (e.g. when running the first request) based on the middleware/adapters used. As part of Faraday v2.0, we've removed all external dependencies, which means we don't really need this anymore. This change should not affect you directly, but if you're registering middleware then be aware of the new syntax: ```ruby # `name` here can be anything you want. # `klass` is your custom middleware class. # This method can also be called on `Faraday::Adapter`, `Faraday::Request` and `Faraday::Response` Faraday::Middleware.register_middleware(name: klass) ``` The `register_middleware` method also previously allowed to provide a symbol, string, proc, or array but this has been removed from the v2.0 release to simplify the interface. (EDIT: symbol/string/proc have subsequently been reintroduced in v2.2, but not the array). ### Authentication helper methods in Connection have been removed You were previously able to call `authorization`, `basic_auth` and `token_auth` against the `Connection` object, but this helper methods have now been dropped. Instead, you should be using the equivalent middleware, as explained in [this page](https://lostisland.github.io/faraday/middleware/authentication). For more details, see https://github.com/lostisland/faraday/pull/1306 ### The `dependency` method in middlewares has been removed In Faraday 1, a deferred require was used with the `dependency` method. In Faraday 2, that method has been removed. In your middleware gems, use a regular `require` at the top of the file, ### Others * Rename `Faraday::Request#method` to `#http_method`. * Remove `Faraday::Response::Middleware`. You can now use the new `on_complete` callback provided by `Faraday::Middleware`. * `Faraday.default_connection_options` will now be deep-merged into new connections to avoid overriding them (e.g. headers). * `Faraday::Builder#build` method is not exposed through `Faraday::Connection` anymore and does not reset the handlers if called multiple times. This method should be used internally only. ## 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-2.7.1/bin/ 0000775 0000000 0000000 00000000000 14335663702 0013711 5 ustar 00root root 0000000 0000000 faraday-2.7.1/bin/console 0000775 0000000 0000000 00000000564 14335663702 0015306 0 ustar 00root root 0000000 0000000 #!/usr/bin/env ruby # frozen_string_literal: true require 'bundler/setup' require 'faraday' # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. # (If you use this, don't forget to add pry to your Gemfile!) # require "pry" # Pry.start require 'irb' IRB.start(__FILE__) faraday-2.7.1/bin/setup 0000775 0000000 0000000 00000000147 14335663702 0015001 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' set -vx gem install bundler bundle install --jobs 4 faraday-2.7.1/bin/test 0000775 0000000 0000000 00000000166 14335663702 0014621 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' set -vx bundle exec rubocop -a --format progress bundle exec rspec faraday-2.7.1/config/ 0000775 0000000 0000000 00000000000 14335663702 0014406 5 ustar 00root root 0000000 0000000 faraday-2.7.1/config/external.yaml 0000664 0000000 0000000 00000000151 14335663702 0017111 0 ustar 00root root 0000000 0000000 faraday-net_http: url: https://github.com/lostisland/faraday-net_http.git command: bundle exec rspec faraday-2.7.1/docs/ 0000775 0000000 0000000 00000000000 14335663702 0014071 5 ustar 00root root 0000000 0000000 faraday-2.7.1/docs/.gitignore 0000664 0000000 0000000 00000000043 14335663702 0016056 0 ustar 00root root 0000000 0000000 _site .sass-cache .jekyll-metadata faraday-2.7.1/docs/404.html 0000664 0000000 0000000 00000000616 14335663702 0015271 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 %}