Skip to content

Commit 58cf95b

Browse files
authored
Merge branch 'main' into 2344-around-render
2 parents 3dd92f0 + 119abc5 commit 58cf95b

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58
push:

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Lint
22

33
on: [pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
trailing-whitespace:
710
runs-on: ubuntu-latest

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ GEM
308308
ruby-progressbar (1.13.0)
309309
rubyzip (2.4.1)
310310
securerandom (0.4.1)
311-
selenium-webdriver (4.33.0)
311+
selenium-webdriver (4.34.0)
312312
base64 (~> 0.2)
313313
logger (~> 1.4)
314314
rexml (~> 3.2, >= 3.2.5)

test/sandbox/public/turbo.es2017-esm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,16 +499,17 @@ function interpolate(strings, values) {
499499
}
500500

501501
function uuid() {
502+
const randomValues = crypto.getRandomValues(new Uint8Array(36));
502503
return Array.from({ length: 36 })
503504
.map((_, i) => {
504505
if (i == 8 || i == 13 || i == 18 || i == 23) {
505506
return "-"
506507
} else if (i == 14) {
507508
return "4"
508509
} else if (i == 19) {
509-
return (Math.floor(Math.random() * 4) + 8).toString(16)
510+
return ((randomValues[i] % 4) + 8).toString(16)
510511
} else {
511-
return Math.floor(Math.random() * 15).toString(16)
512+
return (randomValues[i] % 16).toString(16)
512513
}
513514
})
514515
.join("")

test/sandbox/test/rendering_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,18 +372,18 @@ def test_renders_component_without_format
372372

373373
def test_renders_component_with_asset_url
374374
component = AssetComponent.new
375-
assert_match(%r{http://assets.example.com/assets/application-\w+.css}, render_inline(component).text)
375+
assert_match(%r{http://assets\.example\.com/assets/application-\w+\.css}, render_inline(component).text)
376376

377377
if Rails.version.to_f < 8.0
378378
# Propshaft doesn't allow setting custom hosts so this only works in Rails < 8
379379
component.config.asset_host = nil
380-
assert_match(%r{/assets/application-\w+.css}, render_inline(component).text)
380+
assert_match(%r{/assets/application-\w+\.css}, render_inline(component).text)
381381

382382
component.config.asset_host = "http://assets.example.com"
383-
assert_match(%r{http://assets.example.com/assets/application-\w+.css}, render_inline(component).text)
383+
assert_match(%r{http://assets\.example\.com/assets/application-\w+\.css}, render_inline(component).text)
384384

385385
component.config.asset_host = "assets.example.com"
386-
assert_match(%r{http://assets.example.com/assets/application-\w+.css}, render_inline(component).text)
386+
assert_match(%r{http://assets\.example\.com/assets/application-\w+\.css}, render_inline(component).text)
387387
end
388388
end
389389

0 commit comments

Comments
 (0)