├── docs ├── .gitignore ├── assets │ ├── img │ │ ├── logo.png │ │ ├── favicon.png │ │ ├── home-banner.jpg │ │ ├── middleware.png │ │ ├── repo-card.png │ │ ├── repo-card-slim.png │ │ └── featured-bg.svg │ ├── css │ │ └── main.scss │ └── js │ │ └── team.js ├── _layouts │ └── documentation.md ├── _sass │ ├── _variables.scss │ └── faraday.sass ├── 404.html ├── README.md ├── _includes │ ├── docs_nav.md │ ├── footer.html │ └── header.html ├── team.md ├── middleware │ ├── request │ │ ├── json.md │ │ ├── url_encoded.md │ │ ├── instrumentation.md │ │ └── authentication.md │ ├── response │ │ ├── json.md │ │ ├── raise_error.md │ │ └── logger.md │ ├── list.md │ ├── custom.md │ └── index.md ├── _posts │ └── 2019-03-12-welcome-to-jekyll.markdown ├── Gemfile ├── index.md ├── _config.yml ├── usage │ ├── streaming.md │ └── customize.md └── adapters │ ├── index.md │ ├── testing.md │ └── write_your_adapter.md ├── .rspec ├── lib └── faraday │ ├── version.rb │ ├── parameters.rb │ ├── methods.rb │ ├── adapter_registry.rb │ ├── options │ ├── request_options.rb │ ├── connection_options.rb │ ├── proxy_options.rb │ └── ssl_options.rb │ ├── middleware.rb │ ├── response │ ├── logger.rb │ ├── json.rb │ └── raise_error.rb │ ├── utils │ ├── params_hash.rb │ └── headers.rb │ ├── request │ ├── json.rb │ ├── url_encoded.rb │ ├── instrumentation.rb │ └── authorization.rb │ ├── response.rb │ ├── middleware_registry.rb │ ├── adapter.rb │ ├── utils.rb │ ├── encoders │ └── flat_params_encoder.rb │ ├── logging │ └── formatter.rb │ ├── request.rb │ ├── error.rb │ └── options.rb ├── config └── external.yaml ├── bin ├── setup ├── test └── console ├── Rakefile ├── .editorconfig ├── .yardopts ├── spec ├── support │ ├── disabling_stub.rb │ ├── fake_safe_buffer.rb │ ├── shared_examples │ │ ├── params_encoder.rb │ │ └── adapter.rb │ ├── streaming_response_checker.rb │ └── helper_methods.rb ├── external_adapters │ └── faraday_specs_setup.rb ├── faraday │ ├── options │ │ ├── request_options_spec.rb │ │ ├── proxy_options_spec.rb │ │ └── env_spec.rb │ ├── adapter_registry_spec.rb │ ├── middleware_registry_spec.rb │ ├── params_encoders │ │ ├── flat_spec.rb │ │ └── nested_spec.rb │ ├── adapter_spec.rb │ ├── middleware_spec.rb │ ├── request │ │ ├── instrumentation_spec.rb │ │ ├── json_spec.rb │ │ ├── url_encoded_spec.rb │ │ └── authorization_spec.rb │ ├── error_spec.rb │ ├── response_spec.rb │ ├── response │ │ └── json_spec.rb │ ├── utils_spec.rb │ ├── utils │ │ └── headers_spec.rb │ └── request_spec.rb └── faraday_spec.rb ├── .gitignore ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── workflows │ ├── refresh_team_page.yml │ ├── publish.yml │ └── ci.yml ├── ISSUE_TEMPLATE.md ├── CODE_OF_CONDUCT.md └── CONTRIBUTING.md ├── Gemfile ├── LICENSE.md ├── faraday.gemspec ├── .rubocop_todo.yml ├── README.md └── examples ├── client_spec.rb └── client_test.rb /docs/.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .sass-cache 3 | .jekyll-metadata 4 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | --format documentation 3 | --color 4 | -------------------------------------------------------------------------------- /docs/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/faraday/main/docs/assets/img/logo.png -------------------------------------------------------------------------------- /docs/assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/faraday/main/docs/assets/img/favicon.png -------------------------------------------------------------------------------- /lib/faraday/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Faraday 4 | VERSION = '2.7.4' 5 | end 6 | -------------------------------------------------------------------------------- /docs/assets/img/home-banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/faraday/main/docs/assets/img/home-banner.jpg -------------------------------------------------------------------------------- /docs/assets/img/middleware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/faraday/main/docs/assets/img/middleware.png -------------------------------------------------------------------------------- /docs/assets/img/repo-card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/faraday/main/docs/assets/img/repo-card.png -------------------------------------------------------------------------------- /docs/_layouts/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | --- 4 | 5 | {{ content }} 6 | 7 | {% include docs_nav.md %} 8 | -------------------------------------------------------------------------------- /docs/assets/img/repo-card-slim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/faraday/main/docs/assets/img/repo-card-slim.png -------------------------------------------------------------------------------- /config/external.yaml: -------------------------------------------------------------------------------- 1 | faraday-net_http: 2 | url: https://github.com/lostisland/faraday-net_http.git 3 | command: bundle exec rspec 4 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | gem install bundler 7 | bundle install --jobs 4 8 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rspec/core/rake_task' 4 | 5 | RSpec::Core::RakeTask.new(:spec) 6 | 7 | task default: :spec 8 | -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle exec rubocop -a --format progress 7 | bundle exec rspec 8 | -------------------------------------------------------------------------------- /lib/faraday/parameters.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'forwardable' 4 | require 'faraday/encoders/nested_params_encoder' 5 | require 'faraday/encoders/flat_params_encoder' 6 | -------------------------------------------------------------------------------- /lib/faraday/methods.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Faraday 4 | METHODS_WITH_QUERY = %w[get head delete trace].freeze 5 | METHODS_WITH_BODY = %w[post put patch].freeze 6 | end 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | -------------------------------------------------------------------------------- /docs/assets/css/main.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "variables"; 5 | @import "type-theme"; 6 | @import "faraday"; 7 | @import "https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" 8 | -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- 1 | --no-private 2 | --exclude test 3 | --exclude .github 4 | --exclude coverage 5 | --exclude doc 6 | --exclude script 7 | --markup markdown 8 | --readme README.md 9 | 10 | lib/**/*.rb 11 | - 12 | CHANGELOG.md 13 | -------------------------------------------------------------------------------- /spec/support/disabling_stub.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Allows to disable WebMock stubs 4 | module DisablingStub 5 | def disable 6 | @disabled = true 7 | end 8 | 9 | def disabled? 10 | @disabled 11 | end 12 | 13 | WebMock::RequestStub.prepend self 14 | end 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## PROJECT::GENERAL 2 | coverage 3 | rdoc 4 | doc 5 | log 6 | pkg/* 7 | tmp 8 | .rvmrc 9 | .ruby-version 10 | .yardoc 11 | 12 | ## BUNDLER 13 | *.gem 14 | .bundle 15 | Gemfile.lock 16 | vendor/bundle 17 | external 18 | 19 | ## PROJECT::SPECIFIC 20 | .rbx 21 | 22 | ## IDEs 23 | .idea/ 24 | .yardoc/ 25 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | A few sentences describing the overall goals of the pull request's commits. 3 | Link to related issues if any. (As `Fixes #XXX`) 4 | 5 | ## Todos 6 | List any remaining work that needs to be done, i.e: 7 | - [ ] Tests 8 | - [ ] Documentation 9 | 10 | ## Additional Notes 11 | Optional section 12 | -------------------------------------------------------------------------------- /docs/_sass/_variables.scss: -------------------------------------------------------------------------------- 1 | // Override theme variables. 2 | 3 | @import url('https://fonts.googleapis.com/css?family=Raleway:700'); 4 | 5 | $link-color: #EE4266; 6 | $text-color: #3C3C3C; 7 | $font-family-main: 'KohinoorTelugu-Regular', Helvetica, Arial, sans-serif; 8 | $font-family-headings: 'Raleway', Helvetica, Arial, sans-serif; 9 | $search-color: #EE4266; 10 | -------------------------------------------------------------------------------- /.github/workflows/refresh_team_page.yml: -------------------------------------------------------------------------------- 1 | name: Refresh Team Page 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | permissions: {} 8 | jobs: 9 | build: 10 | name: Refresh Contributors Stats 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Call GitHub API 14 | run: | 15 | curl "https://api.github.com/repos/${{ github.repository }}/stats/contributors" 16 | -------------------------------------------------------------------------------- /spec/support/fake_safe_buffer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # emulates ActiveSupport::SafeBuffer#gsub 4 | FakeSafeBuffer = Struct.new(:string) do 5 | def to_s 6 | self 7 | end 8 | 9 | def gsub(regex) 10 | string.gsub(regex) do 11 | match, = Regexp.last_match(0), '' =~ /a/ # rubocop:disable Performance/StringInclude 12 | yield(match) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require 'bundler/setup' 5 | require 'faraday' 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require 'irb' 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /docs/404.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | 18 | 19 |
Page not found :(
23 |The requested page could not be found.
24 |4 | {% if page.prev_link %} 5 | {{ page.prev_name }} 6 | {% endif %} 7 |
8 |9 | {% if page.top_link %} 10 | {{ page.top_name }} 11 | {% endif %} 12 |
13 |14 | {% if page.next_link %} 15 | {{ page.next_name }} 16 | {% endif %} 17 |
18 |Website and branding design: Elena Lo Piccolo
24 |' + 7 | member.author.login + 8 | '
' + 9 | '' + 10 | '