]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/4388'
authorTom Hughes <tom@compton.nu>
Wed, 6 Dec 2023 17:47:14 +0000 (17:47 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 6 Dec 2023 17:47:14 +0000 (17:47 +0000)
18 files changed:
Gemfile.lock
app/models/changeset.rb
config/initializers/cors.rb
config/initializers/oauth.rb
config/locales/el.yml
config/locales/et.yml
config/locales/fr.yml
config/locales/gl.yml
config/locales/he.yml
config/locales/oc.yml
config/locales/sl.yml
config/locales/tr.yml
config/locales/uk.yml
db/migrate/20120208122334_merge_acl_address_and_mask.rb
lib/osm.rb
test/controllers/changesets_controller_test.rb
test/integration/user_creation_test.rb
test/lib/i18n_test.rb

index ec0ec403f839fbb0e6361f9309a8112ae922b250..212cdb73e7cce313501c0f239c230264e88e915a 100644 (file)
@@ -95,20 +95,20 @@ GEM
     autoprefixer-rails (10.4.16.0)
       execjs (~> 2)
     aws-eventstream (1.3.0)
-    aws-partitions (1.859.0)
-    aws-sdk-core (3.188.0)
-      aws-eventstream (~> 1, >= 1.0.2)
+    aws-partitions (1.863.0)
+    aws-sdk-core (3.190.0)
+      aws-eventstream (~> 1, >= 1.3.0)
       aws-partitions (~> 1, >= 1.651.0)
-      aws-sigv4 (~> 1.5)
+      aws-sigv4 (~> 1.8)
       jmespath (~> 1, >= 1.6.1)
-    aws-sdk-kms (1.73.0)
+    aws-sdk-kms (1.74.0)
       aws-sdk-core (~> 3, >= 3.188.0)
       aws-sigv4 (~> 1.1)
-    aws-sdk-s3 (1.140.0)
-      aws-sdk-core (~> 3, >= 3.188.0)
+    aws-sdk-s3 (1.141.0)
+      aws-sdk-core (~> 3, >= 3.189.0)
       aws-sdk-kms (~> 1)
-      aws-sigv4 (~> 1.6)
-    aws-sigv4 (1.7.0)
+      aws-sigv4 (~> 1.8)
+    aws-sigv4 (1.8.0)
       aws-eventstream (~> 1, >= 1.0.2)
     base64 (0.2.0)
     better_errors (2.10.1)
@@ -133,7 +133,7 @@ GEM
     bootstrap_form (5.4.0)
       actionpack (>= 6.1)
       activemodel (>= 6.1)
-    brakeman (6.0.1)
+    brakeman (6.1.0)
     brotli (0.4.0)
     browser (5.3.1)
     builder (3.2.4)
@@ -177,7 +177,7 @@ GEM
       activerecord (>= 3.0, < 8.0)
       delayed_job (>= 3.0, < 5)
     docile (1.4.0)
-    doorkeeper (5.6.7)
+    doorkeeper (5.6.8)
       railties (>= 5)
     doorkeeper-i18n (5.2.7)
       doorkeeper (>= 5.2)
@@ -288,7 +288,7 @@ GEM
     image_size (3.3.0)
     in_threads (1.6.0)
     io-console (0.6.0)
-    irb (1.9.1)
+    irb (1.10.1)
       rdoc
       reline (>= 0.3.8)
     jbuilder (2.11.5)
@@ -299,7 +299,7 @@ GEM
       rails-dom-testing (>= 1, < 3)
       railties (>= 4.2.0)
       thor (>= 0.14, < 2.0)
-    json (2.6.3)
+    json (2.7.1)
     jwt (2.7.1)
     kgio (2.11.4)
     kramdown (2.4.0)
@@ -334,7 +334,7 @@ GEM
     multi_json (1.15.0)
     multi_xml (0.6.0)
     mutex_m (0.2.0)
-    net-imap (0.4.6)
+    net-imap (0.4.7)
       date
       net-protocol
     net-pop (0.1.2)
@@ -343,7 +343,7 @@ GEM
       timeout
     net-smtp (0.4.0)
       net-protocol
-    nio4r (2.6.1)
+    nio4r (2.7.0)
     nokogiri (1.15.5)
       mini_portile2 (~> 2.8.2)
       racc (~> 1.4)
@@ -415,7 +415,7 @@ GEM
       ruby-openid (>= 2.1.8)
     rack-protection (3.1.0)
       rack (~> 2.2, >= 2.2.4)
-    rack-session (1.0.1)
+    rack-session (1.0.2)
       rack (< 3)
     rack-test (2.1.0)
       rack (>= 1.3)
@@ -464,9 +464,9 @@ GEM
     rb-fsevent (0.11.2)
     rb-inotify (0.10.1)
       ffi (~> 1.0)
-    rdoc (6.6.0)
+    rdoc (6.6.1)
       psych (>= 4.0.0)
-    regexp_parser (2.8.2)
+    regexp_parser (2.8.3)
     reline (0.4.1)
       io-console (~> 0.5)
     request_store (1.5.1)
@@ -477,7 +477,7 @@ GEM
     rouge (4.2.0)
     rtlcss (0.2.1)
       mini_racer (>= 0.6.3)
-    rubocop (1.57.2)
+    rubocop (1.58.0)
       json (~> 2.3)
       language_server-protocol (>= 3.17.0)
       parallel (~> 1.10)
@@ -485,7 +485,7 @@ GEM
       rainbow (>= 2.2.2, < 4.0)
       regexp_parser (>= 1.8, < 3.0)
       rexml (>= 3.2.5, < 4.0)
-      rubocop-ast (>= 1.28.1, < 2.0)
+      rubocop-ast (>= 1.30.0, < 2.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 2.4.0, < 3.0)
     rubocop-ast (1.30.0)
index 137de18fd6479640c42688df2aceff3f56f1bfbb..7f70f4a383185b91d237aabe2223a90791ad6883 100644 (file)
@@ -72,7 +72,7 @@ class Changeset < ApplicationRecord
     # note that this may not be a hard limit - due to timing changes and
     # concurrency it is possible that some changesets may be slightly
     # longer than strictly allowed or have slightly more changes in them.
-    ((closed_at > Time.now.utc) && (num_changes <= MAX_ELEMENTS))
+    (closed_at > Time.now.utc) && (num_changes <= MAX_ELEMENTS)
   end
 
   def set_closed_time_now
index 7421bd3346868dc96b580ad14e6fe1dee61b701e..fdbf11a2ce05cacaaffcdd4a90a822518be92e81 100644 (file)
@@ -6,7 +6,7 @@
 module OpenStreetMap
   class Cors < Rack::Cors
     def call(env)
-      status, headers, body = super env
+      status, headers, body = super(env)
       headers["Cache-Control"] = "no-cache" if headers["Access-Control-Allow-Origin"]
       [status, headers, body]
     end
index 57b89564ffc239bef207abf47fe0abadfe9d51b0..fbe4ad219161a6c87d58c872a98aced64b1acdfd 100644 (file)
@@ -40,12 +40,12 @@ module OpenStreetMap
     def render(options = {})
       text = options.delete(:text)
       if text
-        super options.merge(:plain => text)
+        super(options.merge(:plain => text))
       elsif options.delete(:nothing)
         status = options.delete(:status) || :ok
         head status, options
       else
-        super options
+        super(options)
       end
     end
 
@@ -61,7 +61,7 @@ module OpenStreetMap
           end
         end
 
-        super controller
+        super(controller)
       end
     end
   end
index 338084078b2332f7ad17fa9b2495391ad25dc283..ea8f011e9ebbffc12f63a38e33a716e8b8f0f6d7 100644 (file)
@@ -1127,7 +1127,7 @@ el:
           embankment: Ανάχωμα
           flagpole: Ιστός σημαίας
           gasometer: Αεριόμετρο
-          groyne: Î¦Ï\81άγμα
+          groyne: Î\9aÏ\85μαÏ\84οθÏ\81αÏ\8dÏ\83Ï\84ηÏ\82
           kiln: Καμίνι
           lighthouse: Φάρος
           manhole: Ανθρωποθυρίδα
index 38670e7f9563c544a4d5a1a07ed12bca53fe42bc..59866c7a166f0248ce3bd08dd1971e628f4ca15f 100644 (file)
@@ -1385,7 +1385,7 @@ et:
       remember: Jäta mind meelde
       lost password link: Kas unustasid parooli?
       login_button: Logi sisse
-      register now: 'Registreeru:'
+      register now: Registreeru nüüd
       with external: 'Teise võimalusena võid sisse logida kolmanda osapoole kaudu:'
       no account: Sa ei ole veel registreerinud kasutajaks?
       auth failure: Kahjuks ei õnnestu nende andmetega sisse logida.
@@ -1563,11 +1563,10 @@ et:
           Meie kaastöölised on tuhanded üksikisikud. Samuti oleme kaasanud
           vabalt litsentseeritud andmeid riiklikest kaardistusteenistustest
           ja muudest allikatest, sealhulgas:
-        contributors_at_credit_html: '%{austria}: Sisaldab andmeid %{stadt_wien_link}
-          (%{cc_by_link} tingimustel), %{land_vorarlberg_link} ja Tirooli liidumaast
-          (%{cc_by_at_with_amendments_link}).'
-        contributors_at_stadt_wien: Viini linnast
-        contributors_at_land_vorarlberg: Vorarlbergi liidumaast
+        contributors_at_credit_html: '%{austria}: Sisaldab %{stadt_wien_link} (%{cc_by_link}
+          tingimustel), %{land_vorarlberg_link} ja Tirooli liidumaa andmeid (%{cc_by_at_with_amendments_link}).'
+        contributors_at_stadt_wien: Viini linna
+        contributors_at_land_vorarlberg: Vorarlbergi liidumaa
         contributors_at_cc_by_at_with_amendments: CC BY AT tingimustel koos õiendustega
         contributors_au_credit_html: '%{australia}: Sisaldab halduspiire või on tuletatud
           halduspiiridest, mille allikas on &copy; %{geoscape_australia_link} ja mille
@@ -1599,6 +1598,11 @@ et:
         contributors_nz_credit_html: '%{new_zealand}: Sisaldab teenuse %{linz_data_service_link}
           andmeid, mis on kasutatavad litsentsi %{cc_by_link} tingimustel.'
         contributors_nz_new_zealand: Uus-Meremaa
+        contributors_rs_credit_html: |-
+          %{serbia}: Sisaldab andmeid, mis on pärit %{rgz_link} ja %{open_data_portal}
+          (Serbia avalik teave), 2018.
+        contributors_rs_rgz: Serbia geodeesiaametist
+        contributors_rs_open_data_portal: riigi avaandmete portaalist
         contributors_si_credit_html: '%{slovenia}: Sisaldab %{gu_link} ning %{mkgp_link}
           andmeid (Sloveenia avalik informatsioon).'
         contributors_si_slovenia: Sloveenia
@@ -2040,6 +2044,7 @@ et:
     revoke:
       flash: Oled tühistanud rakenduse %{application} loa.
     scopes:
+      openid: Sisse logida kasutades OpenStreetMapi
       read_prefs: Lugeda kasutajaeelistusi
       write_prefs: Muuta kasutajaeelistusi
       write_diary: Luua päeviku sissekandeid, kommenteerida ja lisada sõpru
index 9455837ae284ddb615be1a28f12198ca1b36b7b4..8e8ac8620d24c9fe1c26f12a3975ed7b8c91439b 100644 (file)
@@ -2575,6 +2575,7 @@ fr:
         automated_edits: Modifications automatisées
         automated_edits_url: https://wiki.openstreetmap.org/wiki/FR:Code_de_conduite_des_modifications_automatis%C3%A9es
       start_mapping: Commencer à cartographier
+      continue_authorization: Continuer l'autorisation
       add_a_note:
         title: Pas le temps d’effectuer les modifications ? Ajoutez une note !
         para_1: Si vous voulez juste une petite correction et n’avez pas le temps
index 14a79a9796512f9ac7accc8c2c727ac925ae7e40..dd0a9b2f5fe4766de74c33d40d60286ef404a59a 100644 (file)
@@ -2452,6 +2452,7 @@ gl:
         imports: importacións
         automated_edits: edicións automáticas
       start_mapping: Comezar a cartografar
+      continue_authorization: Continuar coa autorización
       add_a_note:
         title: Non tes tempo para editar? Engade unha nota!
         para_1: Se soamente queres corrixir unha pequena cousa e non tes tempo de
index f7880dd959b464a8e8d2324e1acb7658c994a1ec..e5a7c2e03574ec61278d829a37d93e5372d8a646 100644 (file)
@@ -2439,6 +2439,7 @@ he:
         imports: מחזורי יבוא
         automated_edits: עריכות אוטומטית
       start_mapping: להתחיל למפות
+      continue_authorization: המשך האישור
       add_a_note:
         title: אין לך זמן לערוך? אפשר להוסיף הערה!
         para_1: אם רק רצית לתקן משהו קטן ואין לך זמן להירשם וללמוד איך לערוך, קל להוסיף
@@ -3116,6 +3117,7 @@ he:
       map_data_zoom_in_tooltip: יש לקרב את המפה כדי לראות נתוני מפה
       queryfeature_tooltip: שאילתת ישויות
       queryfeature_disabled_tooltip: תקריב כדי להריץ שאילתת ישויות
+      embed_html_disabled: הטבעת HTML אינה זמינה בשכבת המפה הזאת
     changesets:
       show:
         comment: להגיב
index ed0267bdfefb71160127df3c48935a3e9d44dc88..4e5604c500fd9ef859dff3c40b3c30e97325ab3a 100644 (file)
@@ -21,7 +21,7 @@ oc:
       prompt: Seleccionatz un fichier
     submit:
       diary_comment:
-        create: Sauvar
+        create: Comentari
       diary_entry:
         create: Publicar
         update: Actualizar
@@ -103,6 +103,7 @@ oc:
       diary_entry:
         user: Utilizaire
         title: Subjècte
+        body: Còrs
         latitude: Latitud
         longitude: Longitud
         language_code: Lenga
@@ -222,6 +223,7 @@ oc:
       openid: OpenID
       google: Google
       facebook: Facebook
+      microsoft: Microsoft
       github: GitHub
       wikipedia: Wikipèdia
   api:
@@ -237,6 +239,7 @@ oc:
         reopened_at_by_html: Reactivat fa %{when} per %{user}
       rss:
         title: Nòtas d'OpenStreetMap
+        description_all: Una lista de nòtas denonciadas, comentadas o barradas
         description_area: Una lista de nòtas, reportadas, comentadas o serradas dins
           vòstra zòna [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})]
         description_item: Un fiu rss per la nòta %{id}
@@ -271,6 +274,8 @@ oc:
         retain_changeset_discussions: Lei discussions sus lei cambiaments, se n'i
           a, se conservaràn.
         retain_email: L'adreiça e-mail sarà conservada.
+        recent_editing_html: Coma avètz recentament modificat vòstre compte se pòt
+          pas suprimir per ara. La supression serà possibla en %{time}.
         confirm_delete: Siatz segur ?
         cancel: Anullar
   accounts:
@@ -1247,7 +1252,7 @@ oc:
           hardware: Quicalhariá
           health_food: Botiga d'alimentacion naturala
           hearing_aids: Aparelhs auditius
-          herbalist: Erboristeria
+          herbalist: Erbolariá
           hifi: Botiga Hi-Fi
           houseware: Venda d’articles per l'ostau
           ice_cream: Glacier
index 915bd5e3f4f42b151f3bae2d49b4d6172e59e669..0708a3722feddb131bd40154fb99d432911dd039 100644 (file)
@@ -256,6 +256,7 @@ sl:
       openid: OpenID
       google: Google
       facebook: Facebook
+      microsoft: Microsoft
       github: GitHub
       wikipedia: Wikipedija
   api:
@@ -264,7 +265,7 @@ sl:
         opened_at_html: Ustvarjeno %{when}
         opened_at_by_html: Ustvaril_a %{user} %{when}
         commented_at_html: Posodobljeno %{when}
-        commented_at_by_html: Posodobil_a %{user} %{when}
+        commented_at_by_html: Posodobil/a %{user} %{when}
         closed_at_html: Razrešeno %{when}
         closed_at_by_html: Razrešil_a %{user} %{when}
         reopened_at_html: Znova aktivirano %{when}
@@ -306,6 +307,8 @@ sl:
         retain_changeset_discussions: Ohranjeni bodo vaši pogovori o naborih sprememb,
           če obstajajo.
         retain_email: Ohranjen bo vaš e-poštni naslov.
+        recent_editing_html: Pred kratkim ste urejali, zato vašega računa trenutno
+          ni mogoče izbrisati. Brisanje bo mogoče čez %{time}.
         confirm_delete: Ali ste prepričani?
         cancel: Prekliči
   accounts:
@@ -500,7 +503,7 @@ sl:
     index:
       title: Sklopi sprememb
       title_user: Sklopi sprememb od %{user}
-      title_user_link_html: Sklopi sprememb uporabnika_ce %{user_link}
+      title_user_link_html: Sklopi sprememb uporabnika/ce %{user_link}
       title_friend: Množice sprememb mojih prijateljev
       title_nearby: Sklopi sprememb bližnjih uporabnikov
       empty: Ni najdenih množic sprememb.
@@ -515,7 +518,7 @@ sl:
   changeset_comments:
     comment:
       comment: 'Nov komentar o naboru sprememb #%{changeset_id} uporabnika %{author}'
-      commented_at_by_html: Posodobil_a %{user} %{when}
+      commented_at_by_html: Posodobil/a %{user} %{when}
     comments:
       comment: 'Nov komentar o naboru sprememb #%{changeset_id} uporabnika %{author}'
     index:
@@ -1511,7 +1514,7 @@ sl:
       no_reports: Ni prijav
       report_created_at: Prvič prijavljeno %{datetime}
       last_resolved_at: Zadnjič razrešeno %{datetime}
-      last_updated_at: Zadnjič %{datetime} posodobil_a %{displayname}
+      last_updated_at: Zadnjič %{datetime} posodobil/a %{displayname}
       resolve: Razreši
       ignore: Prezri
       reopen: Znova odpri
@@ -2484,6 +2487,7 @@ sl:
         imports_url: https://wiki.openstreetmap.org/wiki/SL:Import/Guidelines
         automated_edits: Avtomatizirana urejanja
       start_mapping: Začnite kartirati
+      continue_authorization: Nadaljuj avtorizacijo
       add_a_note:
         title: Nimate časa za urejanje? Dodajte opombo!
         para_1: Če si želite popraviti kakšno majhno napako in nimate časa za prijavo
@@ -2872,12 +2876,15 @@ sl:
       role:
         administrator: Ta uporabnik je administrator
         moderator: Ta uporabnik je moderator
+        importer: Ta uporabnik je uvoznik
         grant:
           administrator: Podeli administratorski dostop
           moderator: Podeli moderatorski dostop
+          importer: Podeli dostop uvoznika
         revoke:
           administrator: Odvzemi administratorski dostop
           moderator: Odvzemi moderatorski dostop
+          importer: Odvzemi dostop uvoznika
       block_history: Aktivna blokiranja
       moderator_history: Izvedena blokiranja
       comments: Komentarji
@@ -3018,11 +3025,11 @@ sl:
     blocks_on:
       title: Blokiranja uporabnika %{name}
       heading_html: Seznam blokiranj uporabnika %{name}
-      empty: Uporabnik_ca %{name} še ni bil_a blokiran_a.
+      empty: Uporabnik/ca %{name} še ni bil/a blokiran/a.
     blocks_by:
-      title: Dana blokiranja uporabnika_ce %{name}
+      title: Dana blokiranja uporabnika/ce %{name}
       heading_html: Seznam izvedenih blokiranj uporabnika %{name}
-      empty: Uporabnik_ca %{name} ni blokiral_a še nikogar.
+      empty: Uporabnik/ca %{name} ni blokiral/a še nikogar.
     show:
       title: '%{block_by} je blokiral uporabnika %{block_on}'
       heading_html: '%{block_by} je blokiral uporabnika %{block_on}'
@@ -3182,6 +3189,7 @@ sl:
       map_data_zoom_in_tooltip: Približajte za ogled podatkov zemljevida
       queryfeature_tooltip: Preveri značilnosti
       queryfeature_disabled_tooltip: Približajte za preverjanje značilnosti
+      embed_html_disabled: Za ta sloj zemljevida vdelava HTML ni na voljo
     changesets:
       show:
         comment: Komentiraj
index 3cc9a4fc39a40ff50e37ab73529fb2725942fed4..27d2c67c712fc53c9231b47f577e9e5436fbac85 100644 (file)
@@ -2464,6 +2464,7 @@ tr:
         imports: Aktarımlar
         automated_edits: Otomatik Düzenlemeler
       start_mapping: Haritacılığa Başla
+      continue_authorization: Yetkilendirmeye Devam Et
       add_a_note:
         title: Düzenlemek için vaktin yok mu? O zaman bir not ekle!
         para_1: |-
@@ -2857,12 +2858,15 @@ tr:
       role:
         administrator: Bu kullanıcı, bir yöneticidir.
         moderator: Bu kullanıcı, bir moderatördür.
+        importer: Bu kullanıcı bir ithalatçıdır
         grant:
           administrator: Yönetici erişim hakkı
           moderator: Moderatör erişim izni
+          importer: İthalatçıya erişim izni ver
         revoke:
           administrator: Yönetici erişimini iptal etme
           moderator: Moderatör erişimini iptal etme
+          importer: İthalatçı erişimini iptal et
       block_history: Etkin Engellemeler
       moderator_history: Verilen Engellemeler
       comments: Yorumlar
index bbbed993e143000d1f10c30f8c11c5827b62b42b..e819260b41a818d22e1d740ddfc346c639580864 100644 (file)
@@ -2496,6 +2496,7 @@ uk:
         imports: імпортів
         automated_edits: автоматизованих змін
       start_mapping: Розпочати мапити
+      continue_authorization: Продовжити авторизацію
       add_a_note:
         title: Немаєте часу, щоб виправити мапу? Додайте нотатку!
         para_1: Якщо потрібно внести дрібне уточнення, заради якого немає потреби
@@ -2888,7 +2889,7 @@ uk:
       notes: Нотатки
       remove as friend: Вилучити зі списку друзів
       add as friend: Додати до списку друзів
-      mapper since: 'Ð\97аÑ\80еÑ\94Ñ\81Ñ\82Ñ\80ований:'
+      mapper since: 'Ð\9eблÑ\96ковий Ð·Ð°Ð¿Ð¸Ñ\81 Ñ\81Ñ\82воÑ\80ено:'
       uid: 'id учасника:'
       ct status: 'Умови співпраці:'
       ct undecided: Не визначились
@@ -2931,8 +2932,8 @@ uk:
       showing:
         one: Сторінка %{page} (%{first_item} з %{items})
         other: Сторінка %{page} (%{first_item}-%{last_item} з %{items})
-      summary_html: '%{name} Ð·Ð°Ñ\80еÑ\94Ñ\81Ñ\82Ñ\80ований Ð· %{ip_address},  %{date}'
-      summary_no_ip_html: '%{name} Ð·Ð°Ñ\80еÑ\94Ñ\81Ñ\82Ñ\80ований %{date}'
+      summary_html: '%{name} Ð·Ð°Ñ\80еÑ\94Ñ\81Ñ\82Ñ\80овано Ð· %{ip_address}, %{date}'
+      summary_no_ip_html: '%{name} Ð·Ð°Ñ\80еÑ\94Ñ\81Ñ\82Ñ\80овано %{date}'
       confirm: Підтвердити вибір учасників
       hide: Сховати вибраних учасників
       empty: Не знайдено учасників відповідно до критеріїв пошуку
index 09b0ae3b07c90f9869e04a418fb66897575ffbbb..5cac1074051770992b7ede7a6c9f35f6e92f65ac 100644 (file)
@@ -21,7 +21,7 @@ class MergeAclAddressAndMask < ActiveRecord::Migration[4.2]
       prefix = 0
 
       while netmask != "0.0.0.0"
-        netmask = netmask << 1
+        netmask <<= 1
         prefix += 1
       end
 
index 905f3ac97459e4890d5270d59f1d76ef110c5746..65eab6907a00ff6008299f28d7d2beb8b674d78c 100644 (file)
@@ -8,7 +8,7 @@ module OSM
   # The base class for API Errors.
   class APIError < RuntimeError
     def initialize(message = "Generic API Error")
-      super message
+      super(message)
     end
 
     def status
@@ -19,7 +19,7 @@ module OSM
   # Raised when access is denied.
   class APIAccessDenied < APIError
     def initialize
-      super "Access denied"
+      super("Access denied")
     end
 
     def status
@@ -30,7 +30,7 @@ module OSM
   # Raised when an API object is not found.
   class APINotFoundError < APIError
     def initialize
-      super "Object not found"
+      super("Object not found")
     end
 
     def status
@@ -41,7 +41,7 @@ module OSM
   # Raised when a precondition to an API action fails sanity check.
   class APIPreconditionFailedError < APIError
     def initialize(message = "")
-      super "Precondition failed: #{message}"
+      super("Precondition failed: #{message}")
     end
 
     def status
@@ -55,7 +55,7 @@ module OSM
       @object = object
       @object_id = object_id
 
-      super "The #{object} with the id #{object_id} has already been deleted"
+      super("The #{object} with the id #{object_id} has already been deleted")
     end
 
     attr_reader :object, :object_id
@@ -68,7 +68,7 @@ module OSM
   # Raised when the user logged in isn't the same as the changeset
   class APIUserChangesetMismatchError < APIError
     def initialize
-      super "The user doesn't own that changeset"
+      super("The user doesn't own that changeset")
     end
 
     def status
@@ -81,7 +81,7 @@ module OSM
     def initialize(changeset)
       @changeset = changeset
 
-      super "The changeset #{changeset.id} was closed at #{changeset.closed_at}"
+      super("The changeset #{changeset.id} was closed at #{changeset.closed_at}")
     end
 
     attr_reader :changeset
@@ -96,7 +96,7 @@ module OSM
     def initialize(changeset)
       @changeset = changeset
 
-      super "The changeset #{changeset.id} is not yet closed."
+      super("The changeset #{changeset.id} is not yet closed.")
     end
 
     attr_reader :changeset
@@ -111,7 +111,7 @@ module OSM
     def initialize(changeset)
       @changeset = changeset
 
-      super "You are already subscribed to changeset #{changeset.id}."
+      super("You are already subscribed to changeset #{changeset.id}.")
     end
 
     attr_reader :changeset
@@ -126,7 +126,7 @@ module OSM
     def initialize(changeset)
       @changeset = changeset
 
-      super "You are not subscribed to changeset #{changeset.id}."
+      super("You are not subscribed to changeset #{changeset.id}.")
     end
 
     attr_reader :changeset
@@ -139,7 +139,7 @@ module OSM
   # Raised when a change is expecting a changeset, but the changeset doesn't exist
   class APIChangesetMissingError < APIError
     def initialize
-      super "You need to supply a changeset to be able to make a change"
+      super("You need to supply a changeset to be able to make a change")
     end
 
     def status
@@ -151,7 +151,7 @@ module OSM
   # the changeset ID that the diff was uploaded to.
   class APIChangesetMismatchError < APIError
     def initialize(provided, allowed)
-      super "Changeset mismatch: Provided #{provided} but only #{allowed} is allowed"
+      super("Changeset mismatch: Provided #{provided} but only #{allowed} is allowed")
     end
 
     def status
@@ -163,7 +163,7 @@ module OSM
   # modify, or delete
   class APIChangesetActionInvalid < APIError
     def initialize(provided)
-      super "Unknown action #{provided}, choices are create, modify, delete"
+      super("Unknown action #{provided}, choices are create, modify, delete")
     end
 
     def status
@@ -175,7 +175,7 @@ module OSM
   # they should.
   class APIBadXMLError < APIError
     def initialize(model, xml, message = "")
-      super "Cannot parse valid #{model} from xml string #{xml}. #{message}"
+      super("Cannot parse valid #{model} from xml string #{xml}. #{message}")
     end
 
     def status
@@ -191,7 +191,7 @@ module OSM
       @provided = provided
       @latest = latest
 
-      super "Version mismatch: Provided #{provided}, server had: #{latest} of #{type} #{id}"
+      super("Version mismatch: Provided #{provided}, server had: #{latest} of #{type} #{id}")
     end
 
     attr_reader :provided, :latest, :id, :type
@@ -209,7 +209,7 @@ module OSM
       @id = id
       @tag_key = tag_key
 
-      super "Element #{type}/#{id} has duplicate tags with key #{tag_key}"
+      super("Element #{type}/#{id} has duplicate tags with key #{tag_key}")
     end
 
     attr_reader :type, :id, :tag_key
@@ -223,7 +223,7 @@ module OSM
   # This prevents ways from being to long and difficult to work with
   class APITooManyWayNodesError < APIError
     def initialize(id, provided, max)
-      super "You tried to add #{provided} nodes to way #{id}, however only #{max} are allowed"
+      super("You tried to add #{provided} nodes to way #{id}, however only #{max} are allowed")
 
       @id = id
       @provided = provided
@@ -241,7 +241,7 @@ module OSM
   # This prevents relations from being too complex and difficult to work with
   class APITooManyRelationMembersError < APIError
     def initialize(id, provided, max)
-      super "You tried to add #{provided} members to relation #{id}, however only #{max} are allowed"
+      super("You tried to add #{provided} members to relation #{id}, however only #{max} are allowed")
 
       @id = id
       @provided = provided
@@ -275,7 +275,7 @@ module OSM
   # raised when an API call is made using a method not supported on that URI
   class APIBadMethodError < APIError
     def initialize(supported_method)
-      super "Only method #{supported_method} is supported on this URI"
+      super("Only method #{supported_method} is supported on this URI")
     end
 
     def status
@@ -287,7 +287,7 @@ module OSM
   # raised when an API call takes too long
   class APITimeoutError < APIError
     def initialize
-      super "Request timed out"
+      super("Request timed out")
     end
 
     def status
@@ -300,7 +300,7 @@ module OSM
   # an element - only historical versions can be redacted.
   class APICannotRedactError < APIError
     def initialize
-      super "Cannot redact current version of element, only historical versions may be redacted."
+      super("Cannot redact current version of element, only historical versions may be redacted.")
     end
 
     def status
@@ -313,7 +313,7 @@ module OSM
     def initialize(note)
       @note = note
 
-      super "The note #{note.id} was closed at #{note.closed_at}"
+      super("The note #{note.id} was closed at #{note.closed_at}")
     end
 
     attr_reader :note
@@ -328,7 +328,7 @@ module OSM
     def initialize(note)
       @note = note
 
-      super "The note #{note.id} is already open"
+      super("The note #{note.id} is already open")
     end
 
     attr_reader :note
@@ -343,7 +343,7 @@ module OSM
     def initialize(key)
       @key = key
 
-      super "Duplicate preferences with key #{key}"
+      super("Duplicate preferences with key #{key}")
     end
 
     attr_reader :key
@@ -356,7 +356,7 @@ module OSM
   # Raised when a rate limit is exceeded
   class APIRateLimitExceeded < APIError
     def initialize
-      super "Rate limit exceeded"
+      super("Rate limit exceeded")
     end
 
     def status
@@ -502,15 +502,8 @@ module OSM
   end
 
   # Construct a random token of a given length
-  def self.make_token(length = 30)
-    chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-    token = ""
-
-    length.times do
-      token += chars[(rand * chars.length).to_i].chr
-    end
-
-    token
+  def self.make_token(length = 24)
+    SecureRandom.urlsafe_base64(length)
   end
 
   # Return an SQL fragment to select a given area of the globe
index 79fd7a571e5f7b919d85b796d5baa879588c2663..d9a4b256bda2313e1cb0d011c051e99c41995983 100644 (file)
@@ -332,7 +332,7 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest
 
         assert_select "> entry > content > xhtml|div > xhtml|table" do
           assert_select "> xhtml|tr > xhtml|td > xhtml|table" do
-            changeset.tags.each do |key, _|
+            changeset.tags.each_key do |key|
               assert_select "> xhtml|tr > xhtml|td", :text => /^#{key} = /
             end
           end
index 2baa6f776eebee21113fde8d9e4acb0c641e4c02..21e751bcaf6eeb7ebd8ec9cea54882253fe24e36 100644 (file)
@@ -206,7 +206,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
 
     assert_equal register_email.to.first, new_email
     # Check that the confirm account url is correct
-    confirm_regex = Regexp.new("/user/redirect_tester/confirm\\?confirm_string=([a-zA-Z0-9]*)")
+    confirm_regex = Regexp.new("/user/redirect_tester/confirm\\?confirm_string=([a-zA-Z0-9_-]*)")
     email_text_parts(register_email).each do |part|
       assert_match confirm_regex, part.body.to_s
     end
@@ -359,7 +359,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
 
     assert_equal register_email.to.first, new_email
     # Check that the confirm account url is correct
-    confirm_regex = Regexp.new("/user/redirect_tester_openid/confirm\\?confirm_string=([a-zA-Z0-9]*)")
+    confirm_regex = Regexp.new("/user/redirect_tester_openid/confirm\\?confirm_string=([a-zA-Z0-9_-]*)")
     email_text_parts(register_email).each do |part|
       assert_match confirm_regex, part.body.to_s
     end
@@ -513,7 +513,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
 
     assert_equal register_email.to.first, new_email
     # Check that the confirm account url is correct
-    confirm_regex = Regexp.new("/user/redirect_tester_google/confirm\\?confirm_string=([a-zA-Z0-9]*)")
+    confirm_regex = Regexp.new("/user/redirect_tester_google/confirm\\?confirm_string=([a-zA-Z0-9_-]*)")
     email_text_parts(register_email).each do |part|
       assert_match confirm_regex, part.body.to_s
     end
@@ -665,7 +665,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
 
     assert_equal register_email.to.first, new_email
     # Check that the confirm account url is correct
-    confirm_regex = Regexp.new("/user/redirect_tester_facebook/confirm\\?confirm_string=([a-zA-Z0-9]*)")
+    confirm_regex = Regexp.new("/user/redirect_tester_facebook/confirm\\?confirm_string=([a-zA-Z0-9_-]*)")
     email_text_parts(register_email).each do |part|
       assert_match confirm_regex, part.body.to_s
     end
@@ -817,7 +817,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
 
     assert_equal register_email.to.first, new_email
     # Check that the confirm account url is correct
-    confirm_regex = Regexp.new("/user/redirect_tester_microsoft/confirm\\?confirm_string=([a-zA-Z0-9]*)")
+    confirm_regex = Regexp.new("/user/redirect_tester_microsoft/confirm\\?confirm_string=([a-zA-Z0-9_-]*)")
     email_text_parts(register_email).each do |part|
       assert_match confirm_regex, part.body.to_s
     end
@@ -971,7 +971,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
 
     assert_equal register_email.to.first, new_email
     # Check that the confirm account url is correct
-    confirm_regex = Regexp.new("/user/redirect_tester_github/confirm\\?confirm_string=([a-zA-Z0-9]*)")
+    confirm_regex = Regexp.new("/user/redirect_tester_github/confirm\\?confirm_string=([a-zA-Z0-9_-]*)")
     email_text_parts(register_email).each do |part|
       assert_match confirm_regex, part.body.to_s
     end
@@ -1125,7 +1125,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
 
     assert_equal register_email.to.first, new_email
     # Check that the confirm account url is correct
-    confirm_regex = Regexp.new("/user/redirect_tester_wikipedia/confirm\\?confirm_string=([a-zA-Z0-9]*)")
+    confirm_regex = Regexp.new("/user/redirect_tester_wikipedia/confirm\\?confirm_string=([a-zA-Z0-9_-]*)")
     email_text_parts(register_email).each do |part|
       assert_match confirm_regex, part.body.to_s
     end
index a25e4887c9bd00a11f51d178d7a8f859b35baee1..8d597fc6592ecb373e8179c4c302bbe7a839c405 100644 (file)
@@ -2,7 +2,7 @@ require "test_helper"
 
 class I18nTest < ActiveSupport::TestCase
   I18n.available_locales.each do |locale|
-    define_method("test_#{locale.to_s.underscore}".to_sym) do
+    define_method(:"test_#{locale.to_s.underscore}") do
       without_i18n_exceptions do
         # plural_keys = plural_keys(locale)
 
@@ -57,7 +57,7 @@ class I18nTest < ActiveSupport::TestCase
 
   Rails.root.glob("config/locales/*.yml").each do |filename|
     lang = File.basename(filename, ".yml")
-    define_method("test_#{lang}_for_raw_html".to_sym) do
+    define_method(:"test_#{lang}_for_raw_html") do
       yml = YAML.load_file(filename)
       assert_nothing_raised do
         check_values_for_raw_html(yml)