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

Allow using Faraday 1.x release in gemspec #421

Merged
merged 3 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/zendesk_api/middleware/request/etag_cache.rb
Expand Up @@ -30,7 +30,11 @@ def call(environment)

@app.call(environment).on_complete do |env|
if cached && env[:status] == 304 # not modified
# Handle differences in serialized env keys in Faraday < 1.0 and 1.0
# See https://github.com/lostisland/faraday/pull/847
env[:body] = cached[:body]
env[:response_body] = cached[:response_body]

env[:response_headers].merge!(
:etag => cached[:response_headers][:etag],
:content_type => cached[:response_headers][:content_type],
Expand Down
2 changes: 1 addition & 1 deletion lib/zendesk_api/middleware/response/raise_error.rb
Expand Up @@ -6,7 +6,7 @@ module Response
class RaiseError < Faraday::Response::RaiseError
def call(env)
super
rescue Faraday::Error::TimeoutError, Faraday::Error::ConnectionFailed => e
rescue Faraday::TimeoutError, Faraday::ConnectionFailed => e
raise Error::NetworkError.new(e, env)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/core/middleware/response/raise_error_spec.rb
Expand Up @@ -4,7 +4,7 @@
context "with a failed connection" do
context "connection failed" do
before(:each) do
stub_request(:any, /.*/).to_raise(Faraday::Error::ConnectionFailed)
stub_request(:any, /.*/).to_raise(Faraday::ConnectionFailed)
end

it "should raise NetworkError" do
Expand Down
2 changes: 1 addition & 1 deletion zendesk_api.gemspec
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 2.3"
s.required_rubygems_version = ">= 1.3.6"

s.add_runtime_dependency "faraday", ">= 0.9.0", "< 1.0.0"
s.add_runtime_dependency "faraday", ">= 0.9.0", "< 2.0.0"
s.add_runtime_dependency "hashie", ">= 3.5.2", "< 4.0.0"
s.add_runtime_dependency "inflection"
s.add_runtime_dependency "multipart-post", "~> 2.0"
Expand Down