diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index afd057d..b9f5586 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: COVERAGE: true run: bundle exec rspec - name: Upload coverage results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: coverage-report path: coverage @@ -103,10 +103,11 @@ jobs: fail-fast: false matrix: ruby: - - ruby-2.6 - ruby-2.7 - ruby-3.0 - ruby-3.1 + - ruby-3.2 + - ruby-3.3 steps: - uses: actions/checkout@v3 diff --git a/.rubocop.yml b/.rubocop.yml index cf6b6a8..9224163 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,8 +2,9 @@ require: rubocop-rake inherit_gem: gc_ruboconfig: rubocop.yml + AllCops: - TargetRubyVersion: 2.6 + TargetRubyVersion: 2.7 NewCops: enable RSpec/ExampleLength: diff --git a/Gemfile b/Gemfile index de28229..4761055 100644 --- a/Gemfile +++ b/Gemfile @@ -6,13 +6,14 @@ source "https://rubygems.org" gemspec group :development, :test do - gem "gc_ruboconfig", "~> 3.6.0" + gem "appraisal", "~> 2.4" + gem "gc_ruboconfig", "~> 5.0.1" gem "pry", "~> 0.14.1" gem "rake", "~> 13.0" gem "rspec", "~> 3.12.0" gem "rspec-its", "~> 1.3.0" gem "rspec_junit_formatter", "~> 0.6.0" - gem "rubocop", "~> 1.50.0" + gem "rubocop", "~> 1.65.0" gem "rubocop-rake", "~> 0.6.0" gem "simplecov", "~> 0.22.0" gem "webmock", "~> 3.18.1" diff --git a/duffel_api.gemspec b/duffel_api.gemspec index 5e34d6b..41ee031 100644 --- a/duffel_api.gemspec +++ b/duffel_api.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.summary = "A Ruby client for interacting with the Duffel API" spec.homepage = "https://github.com/duffelhq/duffel-api-ruby" spec.license = "MIT" - spec.required_ruby_version = ">= 2.6.0" + spec.required_ruby_version = ">= 2.7.0" spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage @@ -32,8 +32,6 @@ Gem::Specification.new do |spec| spec.add_dependency "base16", "~> 0.0.2" spec.add_dependency "faraday", ">= 0.9.2", "< 3" - spec.add_development_dependency "appraisal", "~> 2.4" - # For more information and examples about making a new gem, checkout our # guide at: https://bundler.io/guides/creating_gem.html spec.metadata = { diff --git a/examples/book_and_change.rb b/examples/book_and_change.rb index 45c5bf4..2386664 100644 --- a/examples/book_and_change.rb +++ b/examples/book_and_change.rb @@ -9,10 +9,15 @@ # 365 days from now departure_date = (Time.now + (60 * 60 * 24 * 365)).strftime("%Y-%m-%d") +birth_date = Date.parse("1993-04-01") +current_date = Date.today +age = current_date.year - birth_date.year +age += 1 if current_date.yday > birth_date.yday + offer_request = client.offer_requests.create(params: { cabin_class: "economy", passengers: [{ - age: 28, + age: age, }], slices: [{ # We use a non-sensical route to make sure we get speedy, reliable Duffel Airways @@ -57,7 +62,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "1993-04-01", + born_on: birth_date.to_s, phone_number: "+441290211999", email: "tim@duffel.com", }, @@ -71,7 +76,7 @@ slices: { add: [{ cabin_class: "economy", - departure_date: "2022-12-25", + departure_date: (current_date + 90).to_s, origin: "LHR", destination: "STN", }], diff --git a/examples/book_with_extra_baggage.rb b/examples/book_with_extra_baggage.rb index 0325dbd..002d78a 100644 --- a/examples/book_with_extra_baggage.rb +++ b/examples/book_with_extra_baggage.rb @@ -10,10 +10,15 @@ # 365 days from now departure_date = (Time.now + (60 * 60 * 24 * 365)).strftime("%Y-%m-%d") +birth_date = Date.parse("1993-04-01") +current_date = Date.today +age = current_date.year - birth_date.year +age += 1 if current_date.yday > birth_date.yday + offer_request = client.offer_requests.create(params: { cabin_class: "economy", passengers: [{ - age: 28, + age: age, }], slices: [{ # We use a non-sensical route to make sure we get speedy, reliable Duffel Airways @@ -75,7 +80,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "1993-04-01", + born_on: birth_date.to_s, phone_number: "+441290211999", email: "tim@duffel.com", }, diff --git a/examples/book_with_seat.rb b/examples/book_with_seat.rb index f7569b4..96abc05 100644 --- a/examples/book_with_seat.rb +++ b/examples/book_with_seat.rb @@ -10,10 +10,15 @@ # 365 days from now departure_date = (Time.now + (60 * 60 * 24 * 365)).strftime("%Y-%m-%d") +birth_date = Date.parse("1993-04-01") +current_date = Date.today +age = current_date.year - birth_date.year +age += 1 if current_date.yday > birth_date.yday + offer_request = client.offer_requests.create(params: { cabin_class: "economy", passengers: [{ - age: 28, + age: age, }], slices: [{ # We use a non-sensical route to make sure we get speedy, reliable Duffel Airways @@ -83,7 +88,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "1993-04-01", + born_on: birth_date.to_s, phone_number: "+441290211999", email: "tim@duffel.com", }, diff --git a/examples/hold_and_pay_later.rb b/examples/hold_and_pay_later.rb index d45b624..55ce2ad 100644 --- a/examples/hold_and_pay_later.rb +++ b/examples/hold_and_pay_later.rb @@ -9,10 +9,15 @@ # 365 days from now departure_date = (Time.now + (60 * 60 * 24 * 365)).strftime("%Y-%m-%d") +birth_date = Date.parse("1993-04-01") +current_date = Date.today +age = current_date.year - birth_date.year +age += 1 if current_date.yday > birth_date.yday + offer_request = client.offer_requests.create(params: { cabin_class: "economy", passengers: [{ - age: 28, + age: age, }], slices: [{ # We use a non-sensical route to make sure we get speedy, reliable Duffel Airways @@ -52,7 +57,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "1993-04-01", + born_on: birth_date.to_s, phone_number: "+441290211999", email: "tim@duffel.com", }, diff --git a/examples/search_and_book.rb b/examples/search_and_book.rb index add28bd..b6dc1f2 100644 --- a/examples/search_and_book.rb +++ b/examples/search_and_book.rb @@ -10,10 +10,15 @@ # 365 days from now departure_date = (Time.now + (60 * 60 * 24 * 365)).strftime("%Y-%m-%d") +birth_date = Date.parse("1993-04-01") +current_date = Date.today +age = current_date.year - birth_date.year +age += 1 if current_date.yday > birth_date.yday + offer_request = client.offer_requests.create(params: { cabin_class: "economy", passengers: [{ - age: 28, + age: age, }], slices: [{ # We use a non-sensical route to make sure we get speedy, reliable Duffel Airways @@ -72,7 +77,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "1993-04-01", + born_on: birth_date.to_s, phone_number: "+441290211999", email: "tim@duffel.com", }, diff --git a/gemfiles/faraday_1.gemfile b/gemfiles/faraday_1.gemfile index 0234a18..fb103af 100644 --- a/gemfiles/faraday_1.gemfile +++ b/gemfiles/faraday_1.gemfile @@ -7,16 +7,17 @@ source "https://rubygems.org" gem "faraday", "1.8.0" group :development, :test do - gem "gc_ruboconfig", "~> 2.32.0" + gem "appraisal", "~> 2.4" + gem "gc_ruboconfig", "~> 5.0.1" gem "pry", "~> 0.14.1" gem "rake", "~> 13.0" - gem "rspec", "~> 3.11.0" + gem "rspec", "~> 3.12.0" gem "rspec-its", "~> 1.3.0" - gem "rspec_junit_formatter", "~> 0.5.0" - gem "rubocop", "~> 1.25.0" + gem "rspec_junit_formatter", "~> 0.6.0" + gem "rubocop", "~> 1.65.0" gem "rubocop-rake", "~> 0.6.0" - gem "simplecov", "~> 0.21.2" - gem "webmock", "~> 3.14.0" + gem "simplecov", "~> 0.22.0" + gem "webmock", "~> 3.18.1" gem "yard", "~> 0.9.27" end diff --git a/gemfiles/faraday_1.gemfile.lock b/gemfiles/faraday_1.gemfile.lock index f11db11..7d8dcd6 100644 --- a/gemfiles/faraday_1.gemfile.lock +++ b/gemfiles/faraday_1.gemfile.lock @@ -1,26 +1,42 @@ PATH remote: .. specs: - duffel_api (0.2.0) + duffel_api (0.4.0) base16 (~> 0.0.2) faraday (>= 0.9.2, < 3) GEM remote: https://rubygems.org/ specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - appraisal (2.4.1) + activesupport (7.1.3.4) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) ast (2.4.2) base16 (0.0.2) + base64 (0.2.0) + bigdecimal (3.1.8) coderay (1.1.3) - crack (0.4.5) + concurrent-ruby (1.3.3) + connection_pool (2.4.1) + crack (1.0.0) + bigdecimal rexml - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) + drb (2.2.1) faraday (1.8.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -40,95 +56,122 @@ GEM faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) - gc_ruboconfig (2.32.0) - rubocop (>= 1.25) - rubocop-performance (>= 1.13) - rubocop-rspec (>= 2.8.0) - hashdiff (1.0.1) - method_source (1.0.0) - multipart-post (2.1.1) - parallel (1.21.0) - parser (3.1.0.0) + gc_ruboconfig (5.0.1) + rubocop (>= 1.63) + rubocop-factory_bot (>= 2.26.1) + rubocop-performance (>= 1.21) + rubocop-rails (>= 2.25.0) + rubocop-rspec (>= 3.0.1) + rubocop-rspec_rails (>= 2.30.0) + hashdiff (1.1.0) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + json (2.7.2) + language_server-protocol (3.17.0.3) + method_source (1.1.0) + minitest (5.24.1) + multipart-post (2.4.1) + mutex_m (0.2.0) + parallel (1.25.1) + parser (3.3.4.0) ast (~> 2.4.1) - pry (0.14.1) + racc + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.6) + public_suffix (6.0.0) + racc (1.8.0) + rack (3.1.7) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.2.0) - rexml (3.2.5) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) + rake (13.2.1) + regexp_parser (2.9.2) + rexml (3.3.1) + strscan + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.3) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.4) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) + rspec-support (~> 3.12.0) rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.11.0) + rspec-mocks (3.12.7) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.0) - rspec_junit_formatter (0.5.1) + rspec-support (~> 3.12.0) + rspec-support (3.12.2) + rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.25.1) + rubocop (1.65.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.15.1, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.15.1) - parser (>= 3.0.1.1) - rubocop-performance (1.13.2) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.8.0) - rubocop (~> 1.19) - ruby-progressbar (1.11.0) + rubocop-rspec (3.0.3) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - simplecov (0.21.2) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) - simplecov_json_formatter (0.1.3) - thor (1.2.1) - unicode-display_width (2.1.0) - webmock (3.14.0) + simplecov_json_formatter (0.1.4) + strscan (3.1.0) + thor (1.3.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + webmock (3.18.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.7.0) - yard (0.9.27) - webrick (~> 1.7.0) + yard (0.9.36) PLATFORMS + arm64-darwin-23 x86_64-darwin-20 DEPENDENCIES appraisal (~> 2.4) duffel_api! faraday (= 1.8.0) - gc_ruboconfig (~> 2.32.0) + gc_ruboconfig (~> 5.0.1) pry (~> 0.14.1) rake (~> 13.0) - rspec (~> 3.11.0) + rspec (~> 3.12.0) rspec-its (~> 1.3.0) - rspec_junit_formatter (~> 0.5.0) - rubocop (~> 1.25.0) + rspec_junit_formatter (~> 0.6.0) + rubocop (~> 1.65.0) rubocop-rake (~> 0.6.0) - simplecov (~> 0.21.2) - webmock (~> 3.14.0) + simplecov (~> 0.22.0) + webmock (~> 3.18.1) yard (~> 0.9.27) BUNDLED WITH diff --git a/gemfiles/faraday_2.gemfile b/gemfiles/faraday_2.gemfile index 81fd5cd..3452c11 100644 --- a/gemfiles/faraday_2.gemfile +++ b/gemfiles/faraday_2.gemfile @@ -7,16 +7,17 @@ source "https://rubygems.org" gem "faraday", "2.0.1" group :development, :test do - gem "gc_ruboconfig", "~> 2.32.0" + gem "appraisal", "~> 2.4" + gem "gc_ruboconfig", "~> 5.0.1" gem "pry", "~> 0.14.1" gem "rake", "~> 13.0" - gem "rspec", "~> 3.11.0" + gem "rspec", "~> 3.12.0" gem "rspec-its", "~> 1.3.0" - gem "rspec_junit_formatter", "~> 0.5.0" - gem "rubocop", "~> 1.25.0" + gem "rspec_junit_formatter", "~> 0.6.0" + gem "rubocop", "~> 1.65.0" gem "rubocop-rake", "~> 0.6.0" - gem "simplecov", "~> 0.21.2" - gem "webmock", "~> 3.14.0" + gem "simplecov", "~> 0.22.0" + gem "webmock", "~> 3.18.1" gem "yard", "~> 0.9.27" end diff --git a/gemfiles/faraday_2.gemfile.lock b/gemfiles/faraday_2.gemfile.lock index 039592c..92f49b3 100644 --- a/gemfiles/faraday_2.gemfile.lock +++ b/gemfiles/faraday_2.gemfile.lock @@ -1,118 +1,161 @@ PATH remote: .. specs: - duffel_api (0.2.0) + duffel_api (0.4.0) base16 (~> 0.0.2) faraday (>= 0.9.2, < 3) GEM remote: https://rubygems.org/ specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - appraisal (2.4.1) + activesupport (7.1.3.4) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) ast (2.4.2) base16 (0.0.2) + base64 (0.2.0) + bigdecimal (3.1.8) coderay (1.1.3) - crack (0.4.5) + concurrent-ruby (1.3.3) + connection_pool (2.4.1) + crack (1.0.0) + bigdecimal rexml - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) + drb (2.2.1) faraday (2.0.1) faraday-net_http (~> 2.0) ruby2_keywords (>= 0.0.4) - faraday-net_http (2.0.1) - gc_ruboconfig (2.32.0) - rubocop (>= 1.25) - rubocop-performance (>= 1.13) - rubocop-rspec (>= 2.8.0) - hashdiff (1.0.1) - method_source (1.0.0) - parallel (1.21.0) - parser (3.1.0.0) + faraday-net_http (2.1.0) + gc_ruboconfig (5.0.1) + rubocop (>= 1.63) + rubocop-factory_bot (>= 2.26.1) + rubocop-performance (>= 1.21) + rubocop-rails (>= 2.25.0) + rubocop-rspec (>= 3.0.1) + rubocop-rspec_rails (>= 2.30.0) + hashdiff (1.1.0) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + json (2.7.2) + language_server-protocol (3.17.0.3) + method_source (1.1.0) + minitest (5.24.1) + mutex_m (0.2.0) + parallel (1.25.1) + parser (3.3.4.0) ast (~> 2.4.1) - pry (0.14.1) + racc + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.6) + public_suffix (6.0.0) + racc (1.8.0) + rack (3.1.7) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.2.0) - rexml (3.2.5) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) + rake (13.2.1) + regexp_parser (2.9.2) + rexml (3.3.1) + strscan + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.3) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.4) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) + rspec-support (~> 3.12.0) rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.11.0) + rspec-mocks (3.12.7) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.0) - rspec_junit_formatter (0.5.1) + rspec-support (~> 3.12.0) + rspec-support (3.12.2) + rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.25.1) + rubocop (1.65.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.15.1, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.15.1) - parser (>= 3.0.1.1) - rubocop-performance (1.13.2) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.8.0) - rubocop (~> 1.19) - ruby-progressbar (1.11.0) + rubocop-rspec (3.0.3) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - simplecov (0.21.2) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) - simplecov_json_formatter (0.1.3) - thor (1.2.1) - unicode-display_width (2.1.0) - webmock (3.14.0) + simplecov_json_formatter (0.1.4) + strscan (3.1.0) + thor (1.3.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + webmock (3.18.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.7.0) - yard (0.9.27) - webrick (~> 1.7.0) + yard (0.9.36) PLATFORMS + arm64-darwin-23 x86_64-darwin-20 DEPENDENCIES appraisal (~> 2.4) duffel_api! faraday (= 2.0.1) - gc_ruboconfig (~> 2.32.0) + gc_ruboconfig (~> 5.0.1) pry (~> 0.14.1) rake (~> 13.0) - rspec (~> 3.11.0) + rspec (~> 3.12.0) rspec-its (~> 1.3.0) - rspec_junit_formatter (~> 0.5.0) - rubocop (~> 1.25.0) + rspec_junit_formatter (~> 0.6.0) + rubocop (~> 1.65.0) rubocop-rake (~> 0.6.0) - simplecov (~> 0.21.2) - webmock (~> 3.14.0) + simplecov (~> 0.22.0) + webmock (~> 3.18.1) yard (~> 0.9.27) BUNDLED WITH diff --git a/lib/duffel_api/middlewares/rate_limiter.rb b/lib/duffel_api/middlewares/rate_limiter.rb index e623008..73b8281 100644 --- a/lib/duffel_api/middlewares/rate_limiter.rb +++ b/lib/duffel_api/middlewares/rate_limiter.rb @@ -15,7 +15,7 @@ def mutex end def initialize(app, options = {}) - super(app, options) + super end def call(env) diff --git a/lib/duffel_api/resources/aircraft.rb b/lib/duffel_api/resources/aircraft.rb index 8948b69..ca6824f 100644 --- a/lib/duffel_api/resources/aircraft.rb +++ b/lib/duffel_api/resources/aircraft.rb @@ -20,7 +20,7 @@ def initialize(object, response = nil) @id = object["id"] @name = object["name"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/airline.rb b/lib/duffel_api/resources/airline.rb index 36a8617..5384f61 100644 --- a/lib/duffel_api/resources/airline.rb +++ b/lib/duffel_api/resources/airline.rb @@ -28,7 +28,7 @@ def initialize(object, response = nil) @logo_lockup_url = object["logo_lockup_url"] @logo_symbol_url = object["logo_symbol_url"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/airport.rb b/lib/duffel_api/resources/airport.rb index ec6f4ca..28c6873 100644 --- a/lib/duffel_api/resources/airport.rb +++ b/lib/duffel_api/resources/airport.rb @@ -48,7 +48,7 @@ def initialize(object, response = nil) @name = object["name"] @time_zone = object["time_zone"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/offer.rb b/lib/duffel_api/resources/offer.rb index 182bb2e..801f0f7 100644 --- a/lib/duffel_api/resources/offer.rb +++ b/lib/duffel_api/resources/offer.rb @@ -51,7 +51,7 @@ def initialize(object, response = nil) @total_emissions_kg = object["total_emissions_kg"] @updated_at = object["updated_at"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/offer_passenger.rb b/lib/duffel_api/resources/offer_passenger.rb index 414dea8..9e23e83 100644 --- a/lib/duffel_api/resources/offer_passenger.rb +++ b/lib/duffel_api/resources/offer_passenger.rb @@ -32,7 +32,7 @@ def initialize(object, response = nil) @family_name = object["family_name"] @age = object["age"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/offer_request.rb b/lib/duffel_api/resources/offer_request.rb index b407117..e66a8f7 100644 --- a/lib/duffel_api/resources/offer_request.rb +++ b/lib/duffel_api/resources/offer_request.rb @@ -36,7 +36,7 @@ def initialize(object, response = nil) @passengers = object["passengers"] @slices = object["slices"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/order.rb b/lib/duffel_api/resources/order.rb index 5452d27..785a126 100644 --- a/lib/duffel_api/resources/order.rb +++ b/lib/duffel_api/resources/order.rb @@ -49,7 +49,7 @@ def initialize(object, response = nil) @total_amount = object["total_amount"] @total_currency = object["total_currency"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/order_cancellation.rb b/lib/duffel_api/resources/order_cancellation.rb index 98e21a6..87d499e 100644 --- a/lib/duffel_api/resources/order_cancellation.rb +++ b/lib/duffel_api/resources/order_cancellation.rb @@ -27,7 +27,7 @@ def initialize(object, response = nil) @refund_currency = object["refund_currency"] @refund_to = object["refund_to"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/order_change.rb b/lib/duffel_api/resources/order_change.rb index f48167b..75fe02b 100644 --- a/lib/duffel_api/resources/order_change.rb +++ b/lib/duffel_api/resources/order_change.rb @@ -37,7 +37,7 @@ def initialize(object, response = nil) @refund_to = object["refund_to"] @slices = object["slices"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/order_change_offer.rb b/lib/duffel_api/resources/order_change_offer.rb index 3a898a3..f5693b2 100644 --- a/lib/duffel_api/resources/order_change_offer.rb +++ b/lib/duffel_api/resources/order_change_offer.rb @@ -37,7 +37,7 @@ def initialize(object, response = nil) @slices = object["slices"] @updated_at = object["updated_at"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/order_change_request.rb b/lib/duffel_api/resources/order_change_request.rb index 27a1ab8..b0f2e1b 100644 --- a/lib/duffel_api/resources/order_change_request.rb +++ b/lib/duffel_api/resources/order_change_request.rb @@ -23,7 +23,7 @@ def initialize(object, response = nil) @slices = object["slices"] @updated_at = object["updated_at"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/payment.rb b/lib/duffel_api/resources/payment.rb index 5601620..61bfbdb 100644 --- a/lib/duffel_api/resources/payment.rb +++ b/lib/duffel_api/resources/payment.rb @@ -19,7 +19,7 @@ def initialize(object, response = nil) @id = object["id"] @type = object["type"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/payment_intent.rb b/lib/duffel_api/resources/payment_intent.rb index d0d9d9a..3399b4d 100644 --- a/lib/duffel_api/resources/payment_intent.rb +++ b/lib/duffel_api/resources/payment_intent.rb @@ -43,7 +43,7 @@ def initialize(object, response = nil) @status = object["status"] @updated_at = object["updated_at"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/refund.rb b/lib/duffel_api/resources/refund.rb index 4804616..f3d0ff8 100644 --- a/lib/duffel_api/resources/refund.rb +++ b/lib/duffel_api/resources/refund.rb @@ -33,7 +33,7 @@ def initialize(object, response = nil) @status = object["status"] @updated_at = object["updated_at"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/seat_map.rb b/lib/duffel_api/resources/seat_map.rb index ed948e4..6d4e030 100644 --- a/lib/duffel_api/resources/seat_map.rb +++ b/lib/duffel_api/resources/seat_map.rb @@ -17,7 +17,7 @@ def initialize(object, response = nil) @segment_id = object["segment_id"] @slice_id = object["slice_id"] - super(object, response) + super end end end diff --git a/lib/duffel_api/resources/webhook.rb b/lib/duffel_api/resources/webhook.rb index 820ac8d..6913b0e 100644 --- a/lib/duffel_api/resources/webhook.rb +++ b/lib/duffel_api/resources/webhook.rb @@ -25,7 +25,7 @@ def initialize(object, response = nil) @updated_at = object["updated_at"] @url = object["url"] - super(object, response) + super end end end diff --git a/spec/duffel_api/services/offers_service_spec.rb b/spec/duffel_api/services/offers_service_spec.rb index 8152e19..7aad0c3 100644 --- a/spec/duffel_api/services/offers_service_spec.rb +++ b/spec/duffel_api/services/offers_service_spec.rb @@ -297,15 +297,16 @@ context "with parameters" do let!(:stub) do stub_request(:get, "https://api.duffel.com/air/offers/off_0000AEdGRhtp5AUUdJqMxo"). - with(query: { "return_available_services" => true }) - to_return( - body: response_body, - headers: response_headers, - ) - it "makes the expected request to the Duffel API" do - client.offers.get(id, params: { return_available_services: true }) - expect(stub).to have_been_requested - end + with(query: { "return_available_services" => true }). + to_return( + body: response_body, + headers: response_headers, + ) + end + + it "makes the expected request to the Duffel API" do + client.offers.get(id, params: { return_available_services: true }) + expect(stub).to have_been_requested end end end