Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit f534224

Browse files
author
Tim Rogers
authored
Merge pull request #20 from duffelhq/dependabot/bundler/faraday-gte-0.9.2-and-lt-3
Allow using the gem with Faraday 2.x
2 parents daaeeed + e687951 commit f534224

File tree

9 files changed

+323
-9
lines changed

9 files changed

+323
-9
lines changed

.circleci/config.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
- ruby/rubocop-check
3838
- ruby/rspec-test
3939
docs:
40-
executor: ruby
40+
executor:
41+
name: ruby
4142
steps:
4243
- checkout
4344
- setup_ruby
@@ -46,8 +47,21 @@ jobs:
4647
command: bundle exec yard
4748
- store_artifacts:
4849
path: doc
50+
test-regressions:
51+
executor:
52+
name: ruby
53+
steps:
54+
- checkout
55+
- setup_ruby
56+
- run:
57+
name: Install dependencies per Appraisal
58+
command: bundle exec appraisal install
59+
- run:
60+
name: Run tests per Appraisal
61+
command: bundle exec appraisal rspec
4962
coverage:
50-
executor: ruby
63+
executor:
64+
name: ruby
5165
environment:
5266
COVERAGE: true
5367
steps:
@@ -59,7 +73,8 @@ jobs:
5973
- store_artifacts:
6074
path: coverage
6175
code_examples:
62-
executor: ruby
76+
executor:
77+
name: ruby
6378
steps:
6479
- checkout
6580
- setup_ruby
@@ -94,3 +109,4 @@ workflows:
94109
requires:
95110
- test
96111
- docs
112+
- test-regressions

Appraisals

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
# vim: syntax=ruby
4+
5+
appraise "faraday-1" do
6+
gem "faraday", "1.8.0"
7+
end
8+
9+
appraise "faraday-2" do
10+
gem "faraday", "2.0.1"
11+
end

duffel_api.gemspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ Gem::Specification.new do |spec|
2020
# Specify which files should be added to the gem when it is released.
2121
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
2222
spec.files = Dir.chdir(File.expand_path(__dir__)) do
23-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
23+
`git ls-files -z`.split("\x0").reject do |f|
24+
f.match(%r{\A(?:test|spec|features|gemfiles|.circleci|.github)/})
25+
end
2426
end
2527

2628
spec.bindir = "exe"
2729
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
2830
spec.require_paths = ["lib"]
2931

3032
spec.add_dependency "base16", "~> 0.0.2"
31-
spec.add_dependency "faraday", [">= 0.9.2", "< 2"]
33+
spec.add_dependency "faraday", ">= 0.9.2", "< 3"
3234

33-
# Uncomment to register a new dependency of your gem
34-
# spec.add_dependency "example-gem", "~> 1.0"
35+
spec.add_development_dependency "appraisal", "~> 2.4"
3536

3637
# For more information and examples about making a new gem, checkout our
3738
# guide at: https://bundler.io/guides/creating_gem.html

gemfiles/faraday_1.gemfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
# This file was generated by Appraisal
4+
5+
source "https://rubygems.org"
6+
7+
gem "faraday", "1.8.0"
8+
9+
group :development, :test do
10+
gem "gc_ruboconfig", "~> 2.29.0"
11+
gem "pry", "~> 0.14.1"
12+
gem "rake", "~> 13.0"
13+
gem "rspec", "~> 3.10.0"
14+
gem "rspec-its", "~> 1.3.0"
15+
gem "rspec_junit_formatter", "~> 0.4.1"
16+
gem "rubocop", "~> 1.24.0"
17+
gem "rubocop-rake", "~> 0.6.0"
18+
gem "simplecov", "~> 0.21.2"
19+
gem "webmock", "~> 3.14.0"
20+
end
21+
22+
gemspec path: "../"

gemfiles/faraday_1.gemfile.lock

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
PATH
2+
remote: ..
3+
specs:
4+
duffel_api (0.1.0)
5+
faraday (>= 0.9.2, < 3)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
addressable (2.8.0)
11+
public_suffix (>= 2.0.2, < 5.0)
12+
appraisal (2.4.1)
13+
bundler
14+
rake
15+
thor (>= 0.14.0)
16+
ast (2.4.2)
17+
coderay (1.1.3)
18+
crack (0.4.5)
19+
rexml
20+
diff-lcs (1.5.0)
21+
docile (1.4.0)
22+
faraday (1.8.0)
23+
faraday-em_http (~> 1.0)
24+
faraday-em_synchrony (~> 1.0)
25+
faraday-excon (~> 1.1)
26+
faraday-httpclient (~> 1.0.1)
27+
faraday-net_http (~> 1.0)
28+
faraday-net_http_persistent (~> 1.1)
29+
faraday-patron (~> 1.0)
30+
faraday-rack (~> 1.0)
31+
multipart-post (>= 1.2, < 3)
32+
ruby2_keywords (>= 0.0.4)
33+
faraday-em_http (1.0.0)
34+
faraday-em_synchrony (1.0.0)
35+
faraday-excon (1.1.0)
36+
faraday-httpclient (1.0.1)
37+
faraday-net_http (1.0.1)
38+
faraday-net_http_persistent (1.2.0)
39+
faraday-patron (1.0.0)
40+
faraday-rack (1.0.0)
41+
gc_ruboconfig (2.29.0)
42+
rubocop (>= 1.19)
43+
rubocop-performance (>= 1.11)
44+
rubocop-rspec (>= 2.4.0)
45+
hashdiff (1.0.1)
46+
method_source (1.0.0)
47+
multipart-post (2.1.1)
48+
parallel (1.21.0)
49+
parser (3.1.0.0)
50+
ast (~> 2.4.1)
51+
pry (0.14.1)
52+
coderay (~> 1.1)
53+
method_source (~> 1.0)
54+
public_suffix (4.0.6)
55+
rainbow (3.0.0)
56+
rake (13.0.6)
57+
regexp_parser (2.2.0)
58+
rexml (3.2.5)
59+
rspec (3.10.0)
60+
rspec-core (~> 3.10.0)
61+
rspec-expectations (~> 3.10.0)
62+
rspec-mocks (~> 3.10.0)
63+
rspec-core (3.10.1)
64+
rspec-support (~> 3.10.0)
65+
rspec-expectations (3.10.1)
66+
diff-lcs (>= 1.2.0, < 2.0)
67+
rspec-support (~> 3.10.0)
68+
rspec-its (1.3.0)
69+
rspec-core (>= 3.0.0)
70+
rspec-expectations (>= 3.0.0)
71+
rspec-mocks (3.10.2)
72+
diff-lcs (>= 1.2.0, < 2.0)
73+
rspec-support (~> 3.10.0)
74+
rspec-support (3.10.3)
75+
rspec_junit_formatter (0.4.1)
76+
rspec-core (>= 2, < 4, != 2.12.0)
77+
rubocop (1.24.1)
78+
parallel (~> 1.10)
79+
parser (>= 3.0.0.0)
80+
rainbow (>= 2.2.2, < 4.0)
81+
regexp_parser (>= 1.8, < 3.0)
82+
rexml
83+
rubocop-ast (>= 1.15.1, < 2.0)
84+
ruby-progressbar (~> 1.7)
85+
unicode-display_width (>= 1.4.0, < 3.0)
86+
rubocop-ast (1.15.1)
87+
parser (>= 3.0.1.1)
88+
rubocop-performance (1.13.1)
89+
rubocop (>= 1.7.0, < 2.0)
90+
rubocop-ast (>= 0.4.0)
91+
rubocop-rake (0.6.0)
92+
rubocop (~> 1.0)
93+
rubocop-rspec (2.7.0)
94+
rubocop (~> 1.19)
95+
ruby-progressbar (1.11.0)
96+
ruby2_keywords (0.0.5)
97+
simplecov (0.21.2)
98+
docile (~> 1.1)
99+
simplecov-html (~> 0.11)
100+
simplecov_json_formatter (~> 0.1)
101+
simplecov-html (0.12.3)
102+
simplecov_json_formatter (0.1.3)
103+
thor (1.2.1)
104+
unicode-display_width (2.1.0)
105+
webmock (3.14.0)
106+
addressable (>= 2.8.0)
107+
crack (>= 0.3.2)
108+
hashdiff (>= 0.4.0, < 2.0.0)
109+
110+
PLATFORMS
111+
x86_64-darwin-20
112+
113+
DEPENDENCIES
114+
appraisal (~> 2.4)
115+
duffel_api!
116+
faraday (= 1.8.0)
117+
gc_ruboconfig (~> 2.29.0)
118+
pry (~> 0.14.1)
119+
rake (~> 13.0)
120+
rspec (~> 3.10.0)
121+
rspec-its (~> 1.3.0)
122+
rspec_junit_formatter (~> 0.4.1)
123+
rubocop (~> 1.24.0)
124+
rubocop-rake (~> 0.6.0)
125+
simplecov (~> 0.21.2)
126+
webmock (~> 3.14.0)
127+
128+
BUNDLED WITH
129+
2.3.3

gemfiles/faraday_2.gemfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
# This file was generated by Appraisal
4+
5+
source "https://rubygems.org"
6+
7+
gem "faraday", "2.0.1"
8+
9+
group :development, :test do
10+
gem "gc_ruboconfig", "~> 2.29.0"
11+
gem "pry", "~> 0.14.1"
12+
gem "rake", "~> 13.0"
13+
gem "rspec", "~> 3.10.0"
14+
gem "rspec-its", "~> 1.3.0"
15+
gem "rspec_junit_formatter", "~> 0.4.1"
16+
gem "rubocop", "~> 1.24.0"
17+
gem "rubocop-rake", "~> 0.6.0"
18+
gem "simplecov", "~> 0.21.2"
19+
gem "webmock", "~> 3.14.0"
20+
end
21+
22+
gemspec path: "../"

gemfiles/faraday_2.gemfile.lock

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
PATH
2+
remote: ..
3+
specs:
4+
duffel_api (0.1.0)
5+
faraday (>= 0.9.2, < 3)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
addressable (2.8.0)
11+
public_suffix (>= 2.0.2, < 5.0)
12+
appraisal (2.4.1)
13+
bundler
14+
rake
15+
thor (>= 0.14.0)
16+
ast (2.4.2)
17+
coderay (1.1.3)
18+
crack (0.4.5)
19+
rexml
20+
diff-lcs (1.5.0)
21+
docile (1.4.0)
22+
faraday (2.0.1)
23+
faraday-net_http (~> 2.0)
24+
ruby2_keywords (>= 0.0.4)
25+
faraday-net_http (2.0.1)
26+
gc_ruboconfig (2.29.0)
27+
rubocop (>= 1.19)
28+
rubocop-performance (>= 1.11)
29+
rubocop-rspec (>= 2.4.0)
30+
hashdiff (1.0.1)
31+
method_source (1.0.0)
32+
parallel (1.21.0)
33+
parser (3.1.0.0)
34+
ast (~> 2.4.1)
35+
pry (0.14.1)
36+
coderay (~> 1.1)
37+
method_source (~> 1.0)
38+
public_suffix (4.0.6)
39+
rainbow (3.0.0)
40+
rake (13.0.6)
41+
regexp_parser (2.2.0)
42+
rexml (3.2.5)
43+
rspec (3.10.0)
44+
rspec-core (~> 3.10.0)
45+
rspec-expectations (~> 3.10.0)
46+
rspec-mocks (~> 3.10.0)
47+
rspec-core (3.10.1)
48+
rspec-support (~> 3.10.0)
49+
rspec-expectations (3.10.1)
50+
diff-lcs (>= 1.2.0, < 2.0)
51+
rspec-support (~> 3.10.0)
52+
rspec-its (1.3.0)
53+
rspec-core (>= 3.0.0)
54+
rspec-expectations (>= 3.0.0)
55+
rspec-mocks (3.10.2)
56+
diff-lcs (>= 1.2.0, < 2.0)
57+
rspec-support (~> 3.10.0)
58+
rspec-support (3.10.3)
59+
rspec_junit_formatter (0.4.1)
60+
rspec-core (>= 2, < 4, != 2.12.0)
61+
rubocop (1.24.1)
62+
parallel (~> 1.10)
63+
parser (>= 3.0.0.0)
64+
rainbow (>= 2.2.2, < 4.0)
65+
regexp_parser (>= 1.8, < 3.0)
66+
rexml
67+
rubocop-ast (>= 1.15.1, < 2.0)
68+
ruby-progressbar (~> 1.7)
69+
unicode-display_width (>= 1.4.0, < 3.0)
70+
rubocop-ast (1.15.1)
71+
parser (>= 3.0.1.1)
72+
rubocop-performance (1.13.1)
73+
rubocop (>= 1.7.0, < 2.0)
74+
rubocop-ast (>= 0.4.0)
75+
rubocop-rake (0.6.0)
76+
rubocop (~> 1.0)
77+
rubocop-rspec (2.7.0)
78+
rubocop (~> 1.19)
79+
ruby-progressbar (1.11.0)
80+
ruby2_keywords (0.0.5)
81+
simplecov (0.21.2)
82+
docile (~> 1.1)
83+
simplecov-html (~> 0.11)
84+
simplecov_json_formatter (~> 0.1)
85+
simplecov-html (0.12.3)
86+
simplecov_json_formatter (0.1.3)
87+
thor (1.2.1)
88+
unicode-display_width (2.1.0)
89+
webmock (3.14.0)
90+
addressable (>= 2.8.0)
91+
crack (>= 0.3.2)
92+
hashdiff (>= 0.4.0, < 2.0.0)
93+
94+
PLATFORMS
95+
x86_64-darwin-20
96+
97+
DEPENDENCIES
98+
appraisal (~> 2.4)
99+
duffel_api!
100+
faraday (= 2.0.1)
101+
gc_ruboconfig (~> 2.29.0)
102+
pry (~> 0.14.1)
103+
rake (~> 13.0)
104+
rspec (~> 3.10.0)
105+
rspec-its (~> 1.3.0)
106+
rspec_junit_formatter (~> 0.4.1)
107+
rubocop (~> 1.24.0)
108+
rubocop-rake (~> 0.6.0)
109+
simplecov (~> 0.21.2)
110+
webmock (~> 3.14.0)
111+
112+
BUNDLED WITH
113+
2.3.3

lib/duffel_api/middlewares/raise_duffel_errors.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module DuffelAPI
66
module Middlewares
7-
class RaiseDuffelErrors < Faraday::Response::Middleware
7+
class RaiseDuffelErrors < Faraday::Middleware
88
UNEXPECTED_ERROR_STATUSES = (501..599).freeze
99
EXPECTED_ERROR_STATUSES = (400..500).freeze
1010

spec/duffel_api/middlewares/raise_duffel_errors_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
it "doesn't raise an error" do
6666
expect { connection.post("https://api.duffel.com/air/airports") }.
67-
to_not raise_error(DuffelAPI::Errors::Error)
67+
to_not raise_error
6868
end
6969
end
7070

0 commit comments

Comments
 (0)