From bfa67fa74d8e152fc23bb97d8949fd45e06d3fc2 Mon Sep 17 00:00:00 2001 From: Matt Lindsey Date: Thu, 14 Mar 2024 08:36:12 -0400 Subject: [PATCH 1/6] Expand examples --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d098bae..93cd253 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,13 @@ data.main.temp # => 12 Returns weather by city, optional state (in the US) and optional ISO 3166 country code. ```ruby -client.current_city('New York', 'NY', 'US') -client.current_weather(city: 'New York', state: 'NY', country: 'US') +client.current_city('Sydney') # Good +client.current_city('Albany') # Good +client.current_city('Albany, New York', 'US') # Good +client.current_city('Albany, NY', 'US') # Good +client.current_city('Albany', 'NY', 'US') # Good +client.current_city('Albany', 'NY') # Bad: 2 letter state abbreviation without country will give Faraday::Resource not found +client.current_weather(city: 'New York', state: 'NY', country: 'US') # Good ``` Returns weather by city ID. From e247604c492e00df9825abc960d5bfc7b8275c1f Mon Sep 17 00:00:00 2001 From: Matt Lindsey Date: Thu, 14 Mar 2024 15:55:51 -0400 Subject: [PATCH 2/6] Fix examples --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 93cd253..88d8011 100644 --- a/README.md +++ b/README.md @@ -89,13 +89,18 @@ data.main.temp # => 12 Returns weather by city, optional state (in the US) and optional ISO 3166 country code. ```ruby -client.current_city('Sydney') # Good -client.current_city('Albany') # Good -client.current_city('Albany, New York', 'US') # Good -client.current_city('Albany, NY', 'US') # Good -client.current_city('Albany', 'NY', 'US') # Good +client.current_city('Sydney') +client.current_city('London, UK') +client.current_city('London', 'UK') +client.current_city('Albany') +client.current_city('Albany, New York') +client.current_city('Albany, New York', 'US') +client.current_city('Albany, NY', 'US') +client.current_city('Albany', 'New York', 'US') +client.current_city('Albany', 'NY', 'US') client.current_city('Albany', 'NY') # Bad: 2 letter state abbreviation without country will give Faraday::Resource not found -client.current_weather(city: 'New York', state: 'NY', country: 'US') # Good + +client.current_weather(city: 'Albany', state: 'NY', country: 'US') # Good ``` Returns weather by city ID. From af87562dae02093b203530f2a2f75b87d2803ed5 Mon Sep 17 00:00:00 2001 From: Matt Lindsey Date: Thu, 14 Mar 2024 16:05:28 -0400 Subject: [PATCH 3/6] Add faraday error comment --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 88d8011..e60a6e3 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ data.main.temp # => 12 ``` Returns weather by city, optional state (in the US) and optional ISO 3166 country code. +Names that cannot be resolved will cause the API call to fail with Faraday::ResourceNotFound error. ```ruby client.current_city('Sydney') From c7c9eec50e5fa701cd717320176c33d552e92d52 Mon Sep 17 00:00:00 2001 From: Matt Lindsey Date: Thu, 14 Mar 2024 16:08:01 -0400 Subject: [PATCH 4/6] Fix faraday error comment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e60a6e3..484c385 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ client.current_city('Albany, New York', 'US') client.current_city('Albany, NY', 'US') client.current_city('Albany', 'New York', 'US') client.current_city('Albany', 'NY', 'US') -client.current_city('Albany', 'NY') # Bad: 2 letter state abbreviation without country will give Faraday::Resource not found +client.current_city('Albany', 'NY') # 2-letter state abbreviation w/o country will raise Faraday::ResourceNotFound" client.current_weather(city: 'Albany', state: 'NY', country: 'US') # Good ``` From 2de47bbc578f1c10fd95a109b61a453d26773c6b Mon Sep 17 00:00:00 2001 From: Matt Lindsey Date: Thu, 14 Mar 2024 16:34:44 -0400 Subject: [PATCH 5/6] Fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 484c385..3858086 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ client.current_city('Albany', 'New York', 'US') client.current_city('Albany', 'NY', 'US') client.current_city('Albany', 'NY') # 2-letter state abbreviation w/o country will raise Faraday::ResourceNotFound" -client.current_weather(city: 'Albany', state: 'NY', country: 'US') # Good +client.current_weather(city: 'Albany', state: 'NY', country: 'US') ``` Returns weather by city ID. From 0630d0eefba73dbb59a4b3f0e867176f8e4395b1 Mon Sep 17 00:00:00 2001 From: Matt Lindsey Date: Fri, 15 Mar 2024 09:35:45 -0400 Subject: [PATCH 6/6] Fix quotes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3858086..841d16c 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ data.main.temp # => 12 ``` Returns weather by city, optional state (in the US) and optional ISO 3166 country code. -Names that cannot be resolved will cause the API call to fail with Faraday::ResourceNotFound error. +Names that cannot be resolved will cause the API call to fail with "Faraday::ResourceNotFound" error. ```ruby client.current_city('Sydney') @@ -99,7 +99,7 @@ client.current_city('Albany, New York', 'US') client.current_city('Albany, NY', 'US') client.current_city('Albany', 'New York', 'US') client.current_city('Albany', 'NY', 'US') -client.current_city('Albany', 'NY') # 2-letter state abbreviation w/o country will raise Faraday::ResourceNotFound" +client.current_city('Albany', 'NY') # 2-letter state abbreviation w/o country will raise Faraday::ResourceNotFound client.current_weather(city: 'Albany', state: 'NY', country: 'US') ```