]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/4984'
authorTom Hughes <tom@compton.nu>
Sun, 14 Jul 2024 14:40:39 +0000 (15:40 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 14 Jul 2024 14:40:39 +0000 (15:40 +0100)
app/controllers/application_controller.rb
app/controllers/geocoder_controller.rb
app/models/request_token.rb
config/locales/en.yml
test/controllers/geocoder_controller_test.rb
yarn.lock

index 05fa76658d55bedeecf412c4a5d1927cb6ce3899..c6223fb9d6228890ea86c6bc6420a14d58f2f9fe 100644 (file)
@@ -181,7 +181,7 @@ class ApplicationController < ActionController::Base
     # TODO: some sort of escaping of problem characters in the message
     response.headers["Error"] = message
 
-    if request.headers["X-Error-Format"]&.casecmp("xml")&.zero?
+    if request.headers["X-Error-Format"]&.casecmp?("xml")
       result = OSM::API.new.xml_doc
       result.root.name = "osmError"
       result.root << (XML::Node.new("status") << "#{Rack::Utils.status_code(status)} #{Rack::Utils::HTTP_STATUS_CODES[status]}")
index 02ebc8a1bccb565796a62cafb911bbd7bdd17647..43f276efa020a35cfdbb1719155c4a3f5e61c1fe 100644 (file)
@@ -229,12 +229,12 @@ class GeocoderController < ApplicationController
   end
 
   def to_decdeg(captures)
-    ns = captures.fetch("ns").casecmp("s").zero? ? -1 : 1
+    ns = captures.fetch("ns").casecmp?("s") ? -1 : 1
     nsd = BigDecimal(captures.fetch("nsd", "0"))
     nsm = BigDecimal(captures.fetch("nsm", "0"))
     nss = BigDecimal(captures.fetch("nss", "0"))
 
-    ew = captures.fetch("ew").casecmp("w").zero? ? -1 : 1
+    ew = captures.fetch("ew").casecmp?("w") ? -1 : 1
     ewd = BigDecimal(captures.fetch("ewd", "0"))
     ewm = BigDecimal(captures.fetch("ewm", "0"))
     ews = BigDecimal(captures.fetch("ews", "0"))
index adeabb18497ff4fd7e0556df56aecd16579a9be1..ec38f7421f47f70101b5bebc44a30279d11258f6 100644 (file)
@@ -73,7 +73,7 @@ class RequestToken < OauthToken
   end
 
   def oob?
-    callback_url.nil? || callback_url.casecmp("oob").zero?
+    callback_url.nil? || callback_url.casecmp?("oob")
   end
 
   def oauth10?
index 1d86de20820ca29752ac71fd226ee5f956fae2e7..0278bb8f2fc6a2a3ef0a46286ca7de337de51ddc 100644 (file)
@@ -386,7 +386,7 @@ en:
         way: "way"
         relation: "relation"
     start_rjs:
-      feature_warning: "Loading %{num_features} features, which may make your browser slow or unresponsive. Are sure you want to display this data?"
+      feature_warning: "Loading %{num_features} features, which may make your browser slow or unresponsive. Are you sure you want to display this data?"
       load_data: "Load Data"
       loading: "Loading..."
     tag_details:
index 5ea02f76d2261af73025f00ebaf1426bb630e9e7..ac9905589bd949cf7390ff9cedd140624e92c2dd 100644 (file)
@@ -429,8 +429,8 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest
     assert_template :layout => "map"
     assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources).pluck(:name)
     assert_nil @controller.params[:query]
-    assert_match(/^[+-]?\d+(?:\.\d*)?$/, @controller.params[:lat])
-    assert_match(/^[+-]?\d+(?:\.\d*)?$/, @controller.params[:lon])
+    assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lat])
+    assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lon])
     assert_in_delta lat, @controller.params[:lat].to_f
     assert_in_delta lon, @controller.params[:lon].to_f
 
@@ -440,8 +440,8 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest
     assert_template :layout => "xhr"
     assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources).pluck(:name)
     assert_nil @controller.params[:query]
-    assert_match(/^[+-]?\d+(?:\.\d*)?$/, @controller.params[:lat])
-    assert_match(/^[+-]?\d+(?:\.\d*)?$/, @controller.params[:lon])
+    assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lat])
+    assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lon])
     assert_in_delta lat, @controller.params[:lat].to_f
     assert_in_delta lon, @controller.params[:lon].to_f
   end
index d13b71419002d72d521738ff31a61751fe7c9bfc..a241e9c984b86d868a5dc45cbe77f79c03a4723e 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
   dependencies:
     eslint-visitor-keys "^3.3.0"
 
-"@eslint-community/regexpp@^4.6.1":
-  version "4.6.2"
-  resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8"
-  integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==
+"@eslint-community/regexpp@^4.11.0":
+  version "4.11.0"
+  resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae"
+  integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==
 
 "@eslint/config-array@^0.17.0":
   version "0.17.0"
     minimatch "^3.1.2"
     strip-json-comments "^3.1.1"
 
-"@eslint/js@9.6.0":
-  version "9.6.0"
-  resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.6.0.tgz#5b0cb058cc13d9c92d4e561d3538807fa5127c95"
-  integrity sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==
+"@eslint/js@9.7.0":
+  version "9.7.0"
+  resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.7.0.tgz#b712d802582f02b11cfdf83a85040a296afec3f0"
+  integrity sha512-ChuWDQenef8OSFnvuxv0TCVxEwmu3+hPNKvM9B34qpM0rDRbjL8t5QkQeHHeAfsKQjuH9wS82WeCi1J/owatng==
 
 "@eslint/object-schema@^2.1.4":
   version "2.1.4"
@@ -227,10 +227,10 @@ escape-string-regexp@^4.0.0:
   resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
   integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
 
-eslint-scope@^8.0.1:
-  version "8.0.1"
-  resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.1.tgz#a9601e4b81a0b9171657c343fb13111688963cfc"
-  integrity sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==
+eslint-scope@^8.0.2:
+  version "8.0.2"
+  resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.2.tgz#5cbb33d4384c9136083a71190d548158fe128f94"
+  integrity sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==
   dependencies:
     esrecurse "^4.3.0"
     estraverse "^5.2.0"
@@ -246,15 +246,15 @@ eslint-visitor-keys@^4.0.0:
   integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==
 
 eslint@^9.0.0:
-  version "9.6.0"
-  resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.6.0.tgz#9f54373afa15e1ba356656a8d96233182027fb49"
-  integrity sha512-ElQkdLMEEqQNM9Njff+2Y4q2afHk7JpkPvrd7Xh7xefwgQynqPxwf55J7di9+MEibWUGdNjFF9ITG9Pck5M84w==
+  version "9.7.0"
+  resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.7.0.tgz#bedb48e1cdc2362a0caaa106a4c6ed943e8b09e4"
+  integrity sha512-FzJ9D/0nGiCGBf8UXO/IGLTgLVzIxze1zpfA8Ton2mjLovXdAPlYDv+MQDcqj3TmrhAGYfOpz9RfR+ent0AgAw==
   dependencies:
     "@eslint-community/eslint-utils" "^4.2.0"
-    "@eslint-community/regexpp" "^4.6.1"
+    "@eslint-community/regexpp" "^4.11.0"
     "@eslint/config-array" "^0.17.0"
     "@eslint/eslintrc" "^3.1.0"
-    "@eslint/js" "9.6.0"
+    "@eslint/js" "9.7.0"
     "@humanwhocodes/module-importer" "^1.0.1"
     "@humanwhocodes/retry" "^0.3.0"
     "@nodelib/fs.walk" "^1.2.8"
@@ -263,7 +263,7 @@ eslint@^9.0.0:
     cross-spawn "^7.0.2"
     debug "^4.3.2"
     escape-string-regexp "^4.0.0"
-    eslint-scope "^8.0.1"
+    eslint-scope "^8.0.2"
     eslint-visitor-keys "^4.0.0"
     espree "^10.1.0"
     esquery "^1.5.0"