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

API: Cities #96

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ require: rubocop-rake

inherit_gem:
gc_ruboconfig: rubocop.yml

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
NewCops: enable

RSpec/ExampleLength:
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions duffel_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {
Expand Down
11 changes: 8 additions & 3 deletions examples/book_and_change.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: "[email protected]",
},
Expand All @@ -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",
}],
Expand Down
9 changes: 7 additions & 2 deletions examples/book_with_extra_baggage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: "[email protected]",
},
Expand Down
9 changes: 7 additions & 2 deletions examples/book_with_seat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: "[email protected]",
},
Expand Down
9 changes: 7 additions & 2 deletions examples/hold_and_pay_later.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: "[email protected]",
},
Expand Down
9 changes: 7 additions & 2 deletions examples/search_and_book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: "[email protected]",
},
Expand Down
13 changes: 7 additions & 6 deletions gemfiles/faraday_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading