From 608260d2cd3c2aa9098e4fea096deca5f0857fac Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Fri, 12 Jul 2024 18:32:46 +0100 Subject: [PATCH 1/9] Make examples time aware Time moves on and the ages in these examples are no longer valid. These changes replace static ages with calculated equivalents so that they can be rerun at any time with confidence. --- examples/book_and_change.rb | 11 ++++++++--- examples/book_with_extra_baggage.rb | 9 +++++++-- examples/book_with_seat.rb | 9 +++++++-- examples/hold_and_pay_later.rb | 9 +++++++-- examples/search_and_book.rb | 9 +++++++-- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/examples/book_and_change.rb b/examples/book_and_change.rb index 45c5bf4..1ef401b 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}", 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}", origin: "LHR", destination: "STN", }], diff --git a/examples/book_with_extra_baggage.rb b/examples/book_with_extra_baggage.rb index 0325dbd..83c7ec3 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}", phone_number: "+441290211999", email: "tim@duffel.com", }, diff --git a/examples/book_with_seat.rb b/examples/book_with_seat.rb index f7569b4..eb2d4e9 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}", 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..ff1aab7 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}", phone_number: "+441290211999", email: "tim@duffel.com", }, diff --git a/examples/search_and_book.rb b/examples/search_and_book.rb index add28bd..1e8aaa3 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}", phone_number: "+441290211999", email: "tim@duffel.com", }, From 1152098cf848312ce3c829a15d56e27e1d426726 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Fri, 12 Jul 2024 17:39:39 +0100 Subject: [PATCH 2/9] `bundle update gc_ruboconfig rubocop` --- .rubocop.yml | 1 + Gemfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index cf6b6a8..cc9d3de 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,7 @@ require: rubocop-rake inherit_gem: gc_ruboconfig: rubocop.yml + AllCops: TargetRubyVersion: 2.6 NewCops: enable diff --git a/Gemfile b/Gemfile index de28229..51c15c0 100644 --- a/Gemfile +++ b/Gemfile @@ -6,13 +6,13 @@ source "https://rubygems.org" gemspec group :development, :test do - gem "gc_ruboconfig", "~> 3.6.0" + 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" From 74fa099cc3326215d6702d4e48760782d8ca08ab Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Fri, 12 Jul 2024 17:42:56 +0100 Subject: [PATCH 3/9] Fix RuboCop offense: Gemspec/DevelopmentDependencies Gemspec/DevelopmentDependencies: Specify development dependencies in Gemfile. --- Gemfile | 1 + duffel_api.gemspec | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 51c15c0..4761055 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ source "https://rubygems.org" gemspec group :development, :test do + gem "appraisal", "~> 2.4" gem "gc_ruboconfig", "~> 5.0.1" gem "pry", "~> 0.14.1" gem "rake", "~> 13.0" diff --git a/duffel_api.gemspec b/duffel_api.gemspec index 5e34d6b..28a8f70 100644 --- a/duffel_api.gemspec +++ b/duffel_api.gemspec @@ -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 = { From 321c9cada9c39f1969ae940b444786b701815733 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Fri, 12 Jul 2024 17:48:30 +0100 Subject: [PATCH 4/9] Fix silently broken test case Pull test case out of setup. --- .../services/offers_service_spec.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 From a1737f6609a94034cf47056e671fcbf40a90be00 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Fri, 12 Jul 2024 17:51:57 +0100 Subject: [PATCH 5/9] CI: update Ruby test matrix - Remove Ruby 2.6: rubocop >= 1.51.0 depends on Ruby >= 2.7.0 - Add modern, generally available Ruby versions: 3.2, 3.3 --- .github/workflows/ci.yaml | 3 ++- .rubocop.yml | 2 +- duffel_api.gemspec | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index afd057d..be26fa5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 cc9d3de..9224163 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ inherit_gem: gc_ruboconfig: rubocop.yml AllCops: - TargetRubyVersion: 2.6 + TargetRubyVersion: 2.7 NewCops: enable RSpec/ExampleLength: diff --git a/duffel_api.gemspec b/duffel_api.gemspec index 28a8f70..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 From 131db12d4283ef7d090b9af9cfc5a0e1e8d087f0 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Fri, 12 Jul 2024 17:57:50 +0100 Subject: [PATCH 6/9] `bundle exec appraisal update` --- gemfiles/faraday_1.gemfile | 13 +-- gemfiles/faraday_1.gemfile.lock | 163 ++++++++++++++++++++------------ gemfiles/faraday_2.gemfile | 13 +-- gemfiles/faraday_2.gemfile.lock | 163 ++++++++++++++++++++------------ 4 files changed, 220 insertions(+), 132 deletions(-) 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 From 5ad0eb5497f45c8c8cc98b688f1a6835dc638773 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Fri, 13 Sep 2024 15:31:24 +0100 Subject: [PATCH 7/9] Correct RuboCop offense: Style/SuperArguments Style/SuperArguments: Call super without arguments and parentheses when the signature is identical. --- lib/duffel_api/middlewares/rate_limiter.rb | 2 +- lib/duffel_api/resources/aircraft.rb | 2 +- lib/duffel_api/resources/airline.rb | 2 +- lib/duffel_api/resources/airport.rb | 2 +- lib/duffel_api/resources/offer.rb | 2 +- lib/duffel_api/resources/offer_passenger.rb | 2 +- lib/duffel_api/resources/offer_request.rb | 2 +- lib/duffel_api/resources/order.rb | 2 +- lib/duffel_api/resources/order_cancellation.rb | 2 +- lib/duffel_api/resources/order_change.rb | 2 +- lib/duffel_api/resources/order_change_offer.rb | 2 +- lib/duffel_api/resources/order_change_request.rb | 2 +- lib/duffel_api/resources/payment.rb | 2 +- lib/duffel_api/resources/payment_intent.rb | 2 +- lib/duffel_api/resources/refund.rb | 2 +- lib/duffel_api/resources/seat_map.rb | 2 +- lib/duffel_api/resources/webhook.rb | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) 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 From 2a13f9f717e063adcd9133291c7b6680ea95332d Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Fri, 13 Sep 2024 15:33:56 +0100 Subject: [PATCH 8/9] Correct RuboCop offense: Style/RedundantInterpolation Style/RedundantInterpolation: Prefer to_s over string interpolation. --- examples/book_and_change.rb | 4 ++-- examples/book_with_extra_baggage.rb | 2 +- examples/book_with_seat.rb | 2 +- examples/hold_and_pay_later.rb | 2 +- examples/search_and_book.rb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/book_and_change.rb b/examples/book_and_change.rb index 1ef401b..2386664 100644 --- a/examples/book_and_change.rb +++ b/examples/book_and_change.rb @@ -62,7 +62,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "#{birth_date}", + born_on: birth_date.to_s, phone_number: "+441290211999", email: "tim@duffel.com", }, @@ -76,7 +76,7 @@ slices: { add: [{ cabin_class: "economy", - departure_date: "#{current_date + 90}", + 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 83c7ec3..002d78a 100644 --- a/examples/book_with_extra_baggage.rb +++ b/examples/book_with_extra_baggage.rb @@ -80,7 +80,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "#{birth_date}", + 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 eb2d4e9..96abc05 100644 --- a/examples/book_with_seat.rb +++ b/examples/book_with_seat.rb @@ -88,7 +88,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "#{birth_date}", + 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 ff1aab7..55ce2ad 100644 --- a/examples/hold_and_pay_later.rb +++ b/examples/hold_and_pay_later.rb @@ -57,7 +57,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "#{birth_date}", + 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 1e8aaa3..b6dc1f2 100644 --- a/examples/search_and_book.rb +++ b/examples/search_and_book.rb @@ -77,7 +77,7 @@ gender: "m", given_name: "Tim", family_name: "Rogers", - born_on: "#{birth_date}", + born_on: birth_date.to_s, phone_number: "+441290211999", email: "tim@duffel.com", }, From f45af271bb0148b0e48630fefece57f48dbfbb5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 14:21:00 +0000 Subject: [PATCH 9/9] Bump actions/upload-artifact from 2 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index be26fa5..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