Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faraday 2.0 compatibility update #8

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ jobs:
bundler-cache: true

- name: Standard
run: |
gem install standardrb
bundle exec standardrb
run: bundle exec standardrb
build:
needs: [linting]
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.5', '2.6', '2.7']
ruby: ['2.6', '2.7', '3.0']

steps:
- uses: actions/checkout@v1
Expand All @@ -45,5 +43,4 @@ jobs:
bundler-cache: true

- name: Test
run: |
bundle exec rake
run: bundle exec rake
12 changes: 8 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# frozen_string_literal: true

source "https://rubygems.org"
gemspec

# TODO: remove this once v4 is released
options = (RUBY_VERSION.start_with?("3") ? {github: "grosser/net-http-persistent", branch: "grosser/spec"} : {})
gem "net-http-persistent", ">= 3.1", **options
gem "bundler", "~> 2.0"
gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "simplecov", "~> 0.19.0"
gem "standardrb", "~> 1.0"

gemspec
gem "multipart-parser", "~> 0.1.1"
gem "webmock", "~> 3.4"
16 changes: 3 additions & 13 deletions faraday-net_http_persistent.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,11 @@ Gem::Specification.new do |spec|

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/lostisland/faraday-net_http_persistent"
spec.metadata["changelog_uri"] = "https://github.com/lostisland/faraday-net_http_persistent"
spec.metadata["changelog_uri"] = "https://github.com/lostisland/faraday-net_http_persistent/releases/tag/v#{spec.version}"

spec.files = Dir.glob("lib/**/*") + %w[README.md LICENSE.md]
spec.require_paths = ["lib"]

# TODO: make this a normal dependency when releasing v2.0
spec.add_development_dependency "net-http-persistent", ">= 3.1"

spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "faraday", "~> 1.0"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "simplecov", "~> 0.19.0"
spec.add_development_dependency "standardrb", "~> 1.0"

spec.add_development_dependency "multipart-parser", "~> 0.1.1"
spec.add_development_dependency "webmock", "~> 3.4"
spec.add_dependency "faraday-net_http", "~> 2.0.0.alpha-1"
spec.add_dependency "net-http-persistent", "~> 4.0"
end
2 changes: 0 additions & 2 deletions lib/faraday/adapter/net_http_persistent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ module Faraday
class Adapter
# Net::HTTP::Persistent adapter.
class NetHttpPersistent < NetHttp
dependency "net/http/persistent"

private

def net_http_connection(env)
Expand Down
2 changes: 2 additions & 0 deletions lib/faraday/net_http_persistent.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "faraday/net_http"
require "net/http/persistent"
require_relative "adapter/net_http_persistent"
require_relative "net_http_persistent/version"

Expand Down