selma 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee5c02252f9d3c815aea09d7a79070ae69a4b6c167227f01195faad8c99f52da
4
- data.tar.gz: 5e06f14ecd535c95cdda8c1869a1a255833ab3cc3c41dd4e2ca311b07ca8b4ff
3
+ metadata.gz: 69919cfb80c694b6f77e4e29e29c66d7b482d96ec83a9f47d3a3711d0b636924
4
+ data.tar.gz: 66f9f62677e3f25391180eb9e952852a351cae1d165b2427fe9c537f05884121
5
5
  SHA512:
6
- metadata.gz: 9e550b2bf33e7c57ee1f3cc07be5d5a0ab042959ffad69736ab13cd3e5ca3dca773855ac04f786b286c8917896ef5c7a50d9737f5ec4a85caf804a1d142d59be
7
- data.tar.gz: 8e98daa7579c0f25ce65426813de1989235c18b86e0ee2519b72430fad7f5274c08c38971aff40305df8664c97ef6f369912abcf36509d9b1130b3025655a8ab
6
+ metadata.gz: fb26ee26a928c9aa30c6f71e78914317213552c21729c6ffb46712859eac21b4ddc67709584e4af9ac2a0e4e5b98acce5e5fdbdfd921afdd124faac647b0db05
7
+ data.tar.gz: 9ed49314dc03d3d8f7c6a3b67da8e77536a13a8efd04a8d519796751832527339d291722ac7cb3e44dab9224c2294e70378e0c37d79c97aa3f924506567a990d
data/Cargo.lock CHANGED
@@ -4,13 +4,14 @@ version = 3
4
4
 
5
5
  [[package]]
6
6
  name = "ahash"
7
- version = "0.8.3"
7
+ version = "0.8.7"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
9
+ checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
10
10
  dependencies = [
11
11
  "cfg-if",
12
12
  "once_cell",
13
13
  "version_check",
14
+ "zerocopy",
14
15
  ]
15
16
 
16
17
  [[package]]
@@ -24,11 +25,11 @@ dependencies = [
24
25
 
25
26
  [[package]]
26
27
  name = "bindgen"
27
- version = "0.66.1"
28
+ version = "0.69.1"
28
29
  source = "registry+https://github.com/rust-lang/crates.io-index"
29
- checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
30
+ checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2"
30
31
  dependencies = [
31
- "bitflags 2.4.0",
32
+ "bitflags 2.4.1",
32
33
  "cexpr",
33
34
  "clang-sys",
34
35
  "lazy_static",
@@ -39,7 +40,7 @@ dependencies = [
39
40
  "regex",
40
41
  "rustc-hash",
41
42
  "shlex",
42
- "syn 2.0.38",
43
+ "syn 2.0.46",
43
44
  ]
44
45
 
45
46
  [[package]]
@@ -50,9 +51,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
50
51
 
51
52
  [[package]]
52
53
  name = "bitflags"
53
- version = "2.4.0"
54
+ version = "2.4.1"
54
55
  source = "registry+https://github.com/rust-lang/crates.io-index"
55
- checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
56
+ checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
56
57
 
57
58
  [[package]]
58
59
  name = "byteorder"
@@ -77,9 +78,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
77
78
 
78
79
  [[package]]
79
80
  name = "clang-sys"
80
- version = "1.6.1"
81
+ version = "1.7.0"
81
82
  source = "registry+https://github.com/rust-lang/crates.io-index"
82
- checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
83
+ checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1"
83
84
  dependencies = [
84
85
  "glob",
85
86
  "libc",
@@ -116,7 +117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
116
117
  checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
117
118
  dependencies = [
118
119
  "quote",
119
- "syn 2.0.38",
120
+ "syn 2.0.46",
120
121
  ]
121
122
 
122
123
  [[package]]
@@ -164,22 +165,22 @@ checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca"
164
165
 
165
166
  [[package]]
166
167
  name = "enum-iterator"
167
- version = "1.4.1"
168
+ version = "2.1.0"
168
169
  source = "registry+https://github.com/rust-lang/crates.io-index"
169
- checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689"
170
+ checksum = "c280b9e6b3ae19e152d8e31cf47f18389781e119d4013a2a2bb0180e5facc635"
170
171
  dependencies = [
171
172
  "enum-iterator-derive",
172
173
  ]
173
174
 
174
175
  [[package]]
175
176
  name = "enum-iterator-derive"
176
- version = "1.2.1"
177
+ version = "1.4.0"
177
178
  source = "registry+https://github.com/rust-lang/crates.io-index"
178
- checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb"
179
+ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b"
179
180
  dependencies = [
180
181
  "proc-macro2",
181
182
  "quote",
182
- "syn 2.0.38",
183
+ "syn 2.0.46",
183
184
  ]
184
185
 
185
186
  [[package]]
@@ -246,18 +247,18 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
246
247
 
247
248
  [[package]]
248
249
  name = "libc"
249
- version = "0.2.149"
250
+ version = "0.2.151"
250
251
  source = "registry+https://github.com/rust-lang/crates.io-index"
251
- checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
252
+ checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
252
253
 
253
254
  [[package]]
254
255
  name = "libloading"
255
- version = "0.7.4"
256
+ version = "0.8.1"
256
257
  source = "registry+https://github.com/rust-lang/crates.io-index"
257
- checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
258
+ checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"
258
259
  dependencies = [
259
260
  "cfg-if",
260
- "winapi",
261
+ "windows-sys",
261
262
  ]
262
263
 
263
264
  [[package]]
@@ -268,11 +269,11 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
268
269
 
269
270
  [[package]]
270
271
  name = "lol_html"
271
- version = "1.2.0"
272
+ version = "1.2.1"
272
273
  source = "registry+https://github.com/rust-lang/crates.io-index"
273
- checksum = "10662f7aad081ec900fd735be33076da75e0389400277dc3734e2b0aa02bb115"
274
+ checksum = "a4629ff9c2deeb7aad9b2d0f379fc41937a02f3b739f007732c46af40339dee5"
274
275
  dependencies = [
275
- "bitflags 2.4.0",
276
+ "bitflags 2.4.1",
276
277
  "cfg-if",
277
278
  "cssparser",
278
279
  "encoding_rs",
@@ -281,16 +282,15 @@ dependencies = [
281
282
  "lazycell",
282
283
  "memchr",
283
284
  "mime",
284
- "safemem",
285
285
  "selectors",
286
286
  "thiserror",
287
287
  ]
288
288
 
289
289
  [[package]]
290
290
  name = "magnus"
291
- version = "0.6.2"
291
+ version = "0.6.4"
292
292
  source = "registry+https://github.com/rust-lang/crates.io-index"
293
- checksum = "4778544796676e8428e9c622460ebf284bea52d8b10db3aeb449d8b5e61b3a13"
293
+ checksum = "b1597ef40aa8c36be098249e82c9a20cf7199278ac1c1a1a995eeead6a184479"
294
294
  dependencies = [
295
295
  "magnus-macros",
296
296
  "rb-sys",
@@ -306,7 +306,7 @@ checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
306
306
  dependencies = [
307
307
  "proc-macro2",
308
308
  "quote",
309
- "syn 2.0.38",
309
+ "syn 2.0.46",
310
310
  ]
311
311
 
312
312
  [[package]]
@@ -317,9 +317,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
317
317
 
318
318
  [[package]]
319
319
  name = "memchr"
320
- version = "2.6.4"
320
+ version = "2.7.1"
321
321
  source = "registry+https://github.com/rust-lang/crates.io-index"
322
- checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
322
+ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
323
323
 
324
324
  [[package]]
325
325
  name = "mime"
@@ -351,9 +351,9 @@ dependencies = [
351
351
 
352
352
  [[package]]
353
353
  name = "once_cell"
354
- version = "1.18.0"
354
+ version = "1.19.0"
355
355
  source = "registry+https://github.com/rust-lang/crates.io-index"
356
- checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
356
+ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
357
357
 
358
358
  [[package]]
359
359
  name = "peeking_take_while"
@@ -435,18 +435,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
435
435
 
436
436
  [[package]]
437
437
  name = "proc-macro2"
438
- version = "1.0.69"
438
+ version = "1.0.74"
439
439
  source = "registry+https://github.com/rust-lang/crates.io-index"
440
- checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
440
+ checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db"
441
441
  dependencies = [
442
442
  "unicode-ident",
443
443
  ]
444
444
 
445
445
  [[package]]
446
446
  name = "quote"
447
- version = "1.0.33"
447
+ version = "1.0.35"
448
448
  source = "registry+https://github.com/rust-lang/crates.io-index"
449
- checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
449
+ checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
450
450
  dependencies = [
451
451
  "proc-macro2",
452
452
  ]
@@ -504,18 +504,18 @@ dependencies = [
504
504
 
505
505
  [[package]]
506
506
  name = "rb-sys"
507
- version = "0.9.82"
507
+ version = "0.9.85"
508
508
  source = "registry+https://github.com/rust-lang/crates.io-index"
509
- checksum = "a3e6bf79bf4c711917cacfaf46dfab4314dbfdd89a8ee3ec4b98336cd23f1ebf"
509
+ checksum = "05b780e6858b0b0eced1d55d0f097c024b77a37b41f83bd35341130f78e37c51"
510
510
  dependencies = [
511
511
  "rb-sys-build",
512
512
  ]
513
513
 
514
514
  [[package]]
515
515
  name = "rb-sys-build"
516
- version = "0.9.82"
516
+ version = "0.9.85"
517
517
  source = "registry+https://github.com/rust-lang/crates.io-index"
518
- checksum = "5482a1ed4cde58dddaf162b6aebcb5c25645822547832b8be101f2acd40bcdd6"
518
+ checksum = "44957a3bc513dad1b0f20bdd0ee3b82e729a59da44086a6b40d8bc71958a6db8"
519
519
  dependencies = [
520
520
  "bindgen",
521
521
  "lazy_static",
@@ -523,7 +523,7 @@ dependencies = [
523
523
  "quote",
524
524
  "regex",
525
525
  "shell-words",
526
- "syn 2.0.38",
526
+ "syn 2.0.46",
527
527
  ]
528
528
 
529
529
  [[package]]
@@ -534,9 +534,9 @@ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
534
534
 
535
535
  [[package]]
536
536
  name = "regex"
537
- version = "1.10.0"
537
+ version = "1.10.2"
538
538
  source = "registry+https://github.com/rust-lang/crates.io-index"
539
- checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87"
539
+ checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
540
540
  dependencies = [
541
541
  "aho-corasick",
542
542
  "memchr",
@@ -546,9 +546,9 @@ dependencies = [
546
546
 
547
547
  [[package]]
548
548
  name = "regex-automata"
549
- version = "0.4.1"
549
+ version = "0.4.3"
550
550
  source = "registry+https://github.com/rust-lang/crates.io-index"
551
- checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b"
551
+ checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
552
552
  dependencies = [
553
553
  "aho-corasick",
554
554
  "memchr",
@@ -557,9 +557,9 @@ dependencies = [
557
557
 
558
558
  [[package]]
559
559
  name = "regex-syntax"
560
- version = "0.8.1"
560
+ version = "0.8.2"
561
561
  source = "registry+https://github.com/rust-lang/crates.io-index"
562
- checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33"
562
+ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
563
563
 
564
564
  [[package]]
565
565
  name = "rustc-hash"
@@ -576,12 +576,6 @@ dependencies = [
576
576
  "semver",
577
577
  ]
578
578
 
579
- [[package]]
580
- name = "safemem"
581
- version = "0.3.3"
582
- source = "registry+https://github.com/rust-lang/crates.io-index"
583
- checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
584
-
585
579
  [[package]]
586
580
  name = "selectors"
587
581
  version = "0.22.0"
@@ -614,9 +608,9 @@ dependencies = [
614
608
 
615
609
  [[package]]
616
610
  name = "semver"
617
- version = "1.0.20"
611
+ version = "1.0.21"
618
612
  source = "registry+https://github.com/rust-lang/crates.io-index"
619
- checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
613
+ checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
620
614
 
621
615
  [[package]]
622
616
  name = "seq-macro"
@@ -654,9 +648,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
654
648
 
655
649
  [[package]]
656
650
  name = "smallvec"
657
- version = "1.11.1"
651
+ version = "1.11.2"
658
652
  source = "registry+https://github.com/rust-lang/crates.io-index"
659
- checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a"
653
+ checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
660
654
 
661
655
  [[package]]
662
656
  name = "stable_deref_trait"
@@ -677,9 +671,9 @@ dependencies = [
677
671
 
678
672
  [[package]]
679
673
  name = "syn"
680
- version = "2.0.38"
674
+ version = "2.0.46"
681
675
  source = "registry+https://github.com/rust-lang/crates.io-index"
682
- checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
676
+ checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e"
683
677
  dependencies = [
684
678
  "proc-macro2",
685
679
  "quote",
@@ -694,22 +688,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
694
688
 
695
689
  [[package]]
696
690
  name = "thiserror"
697
- version = "1.0.49"
691
+ version = "1.0.56"
698
692
  source = "registry+https://github.com/rust-lang/crates.io-index"
699
- checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4"
693
+ checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
700
694
  dependencies = [
701
695
  "thiserror-impl",
702
696
  ]
703
697
 
704
698
  [[package]]
705
699
  name = "thiserror-impl"
706
- version = "1.0.49"
700
+ version = "1.0.56"
707
701
  source = "registry+https://github.com/rust-lang/crates.io-index"
708
- checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc"
702
+ checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
709
703
  dependencies = [
710
704
  "proc-macro2",
711
705
  "quote",
712
- "syn 2.0.38",
706
+ "syn 2.0.46",
713
707
  ]
714
708
 
715
709
  [[package]]
@@ -731,23 +725,87 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
731
725
  checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
732
726
 
733
727
  [[package]]
734
- name = "winapi"
735
- version = "0.3.9"
728
+ name = "windows-sys"
729
+ version = "0.48.0"
736
730
  source = "registry+https://github.com/rust-lang/crates.io-index"
737
- checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
731
+ checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
738
732
  dependencies = [
739
- "winapi-i686-pc-windows-gnu",
740
- "winapi-x86_64-pc-windows-gnu",
733
+ "windows-targets",
741
734
  ]
742
735
 
743
736
  [[package]]
744
- name = "winapi-i686-pc-windows-gnu"
745
- version = "0.4.0"
737
+ name = "windows-targets"
738
+ version = "0.48.5"
739
+ source = "registry+https://github.com/rust-lang/crates.io-index"
740
+ checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
741
+ dependencies = [
742
+ "windows_aarch64_gnullvm",
743
+ "windows_aarch64_msvc",
744
+ "windows_i686_gnu",
745
+ "windows_i686_msvc",
746
+ "windows_x86_64_gnu",
747
+ "windows_x86_64_gnullvm",
748
+ "windows_x86_64_msvc",
749
+ ]
750
+
751
+ [[package]]
752
+ name = "windows_aarch64_gnullvm"
753
+ version = "0.48.5"
746
754
  source = "registry+https://github.com/rust-lang/crates.io-index"
747
- checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
755
+ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
748
756
 
749
757
  [[package]]
750
- name = "winapi-x86_64-pc-windows-gnu"
751
- version = "0.4.0"
758
+ name = "windows_aarch64_msvc"
759
+ version = "0.48.5"
760
+ source = "registry+https://github.com/rust-lang/crates.io-index"
761
+ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
762
+
763
+ [[package]]
764
+ name = "windows_i686_gnu"
765
+ version = "0.48.5"
766
+ source = "registry+https://github.com/rust-lang/crates.io-index"
767
+ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
768
+
769
+ [[package]]
770
+ name = "windows_i686_msvc"
771
+ version = "0.48.5"
752
772
  source = "registry+https://github.com/rust-lang/crates.io-index"
753
- checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
773
+ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
774
+
775
+ [[package]]
776
+ name = "windows_x86_64_gnu"
777
+ version = "0.48.5"
778
+ source = "registry+https://github.com/rust-lang/crates.io-index"
779
+ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
780
+
781
+ [[package]]
782
+ name = "windows_x86_64_gnullvm"
783
+ version = "0.48.5"
784
+ source = "registry+https://github.com/rust-lang/crates.io-index"
785
+ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
786
+
787
+ [[package]]
788
+ name = "windows_x86_64_msvc"
789
+ version = "0.48.5"
790
+ source = "registry+https://github.com/rust-lang/crates.io-index"
791
+ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
792
+
793
+ [[package]]
794
+ name = "zerocopy"
795
+ version = "0.7.32"
796
+ source = "registry+https://github.com/rust-lang/crates.io-index"
797
+ checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
798
+ dependencies = [
799
+ "zerocopy-derive",
800
+ ]
801
+
802
+ [[package]]
803
+ name = "zerocopy-derive"
804
+ version = "0.7.32"
805
+ source = "registry+https://github.com/rust-lang/crates.io-index"
806
+ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
807
+ dependencies = [
808
+ "proc-macro2",
809
+ "quote",
810
+ "syn 2.0.46",
811
+ ]
data/Cargo.toml CHANGED
@@ -4,3 +4,5 @@
4
4
 
5
5
  [workspace]
6
6
  members = ["ext/selma"]
7
+ resolver = "2"
8
+
data/README.md CHANGED
@@ -76,7 +76,7 @@ attributes: {
76
76
 
77
77
  # URL handling protocols to allow in specific attributes. By default, no
78
78
  # protocols are allowed. Use :relative in place of a protocol if you want
79
- # to allow relative URLs sans protocol.
79
+ # to allow relative URLs sans protocol. Set to `:all` to allow any protocol.
80
80
  protocols: {
81
81
  "a" => { "href" => ["http", "https", "mailto", :relative] },
82
82
  "img" => { "href" => ["http", "https"] },
@@ -103,7 +103,11 @@ Here's an example which rewrites the `href` attribute on `a` and the `src` attri
103
103
 
104
104
  ```ruby
105
105
  class MatchAttribute
106
- SELECTOR = Selma::Selector(match_element: %(a[href^="http:"], img[src^="http:"]"))
106
+ SELECTOR = Selma::Selector.new(match_element: %(a[href^="http:"], img[src^="http:"]"))
107
+
108
+ def selector
109
+ SELECTOR
110
+ end
107
111
 
108
112
  def handle_element(element)
109
113
  if element.tag_name == "a"
@@ -178,38 +182,118 @@ The `element` argument in `handle_element` has the following methods:
178
182
 
179
183
  ## Benchmarks
180
184
 
185
+ When `bundle exec rake benchmark`, two different benchmarks are calculated. Here are those results on my machine.
186
+
187
+ ### Benchmarks for just the sanitization process
188
+
189
+ Comparing Selma against popular Ruby sanitization gems:
190
+
191
+ <!-- prettier-ignore-start -->
181
192
  <details>
182
193
  <pre>
183
- ruby test/benchmark.rb
184
- ruby test/benchmark.rb
185
194
  Warming up --------------------------------------
186
- sanitize-document-huge
187
- 1.000 i/100ms
188
- selma-document-huge 1.000 i/100ms
195
+ sanitize-sm 15.000 i/100ms
196
+ selma-sm 126.000 i/100ms
197
+ Calculating -------------------------------------
198
+ sanitize-sm 155.074 (± 1.9%) i/s - 4.665k in 30.092214s
199
+ selma-sm 1.290k (± 1.3%) i/s - 38.808k in 30.085333s
200
+
201
+ Comparison:
202
+ selma-sm: 1290.1 i/s
203
+ sanitize-sm: 155.1 i/s - 8.32x slower
204
+
205
+ input size = 86686 bytes, 0.09 MB
206
+
207
+ ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
208
+ Warming up --------------------------------------
209
+ sanitize-md 3.000 i/100ms
210
+ selma-md 33.000 i/100ms
189
211
  Calculating -------------------------------------
190
- sanitize-document-huge
191
- 0.257 0.0%) i/s - 2.000 in 7.783398s
192
- selma-document-huge 4.602 (± 0.0%) i/s - 23.000 in 5.002870s
212
+ sanitize-md 40.321 (± 5.0%) i/s - 1.206k in 30.004711s
213
+ selma-md 337.417 1.5%) i/s - 10.131k in 30.032772s
214
+
215
+ Comparison:
216
+ selma-md: 337.4 i/s
217
+ sanitize-md: 40.3 i/s - 8.37x slower
218
+
219
+ input size = 7172510 bytes, 7.17 MB
220
+
221
+ ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
193
222
  Warming up --------------------------------------
194
- sanitize-document-medium
195
- 2.000 i/100ms
196
- selma-document-medium
197
- 22.000 i/100ms
223
+ sanitize-lg 1.000 i/100ms
224
+ selma-lg 1.000 i/100ms
198
225
  Calculating -------------------------------------
199
- sanitize-document-medium
200
- 28.676 3.5%) i/s - 144.000 in 5.024669s
201
- selma-document-medium
202
- 121.500 (±22.2%) i/s - 594.000 in 5.135410s
226
+ sanitize-lg 0.144 (± 0.0%) i/s - 5.000 in 34.772526s
227
+ selma-lg 4.026 0.0%) i/s - 121.000 in 30.067415s
228
+
229
+ Comparison:
230
+ selma-lg: 4.0 i/s
231
+ sanitize-lg: 0.1 i/s - 27.99x slower
232
+ </pre>
233
+ </details>
234
+ <!-- prettier-ignore-end -->
235
+
236
+ ### Benchmarks for just the rewriting process
237
+
238
+ Comparing Selma against popular Ruby HTML parsing gems:
239
+
240
+ <!-- prettier-ignore-start -->
241
+ <details>
242
+ <pre>
243
+
244
+ input size = 25309 bytes, 0.03 MB
245
+
246
+ ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
247
+ Warming up --------------------------------------
248
+ nokogiri-sm 79.000 i/100ms
249
+ nokolexbor-sm 285.000 i/100ms
250
+ selma-sm 244.000 i/100ms
251
+ Calculating -------------------------------------
252
+ nokogiri-sm 807.790 (± 3.1%) i/s - 24.253k in 30.056301s
253
+ nokolexbor-sm 2.880k (± 6.4%) i/s - 86.070k in 30.044766s
254
+ selma-sm 2.508k (± 1.2%) i/s - 75.396k in 30.068792s
255
+
256
+ Comparison:
257
+ nokolexbor-sm: 2880.3 i/s
258
+ selma-sm: 2507.8 i/s - 1.15x slower
259
+ nokogiri-sm: 807.8 i/s - 3.57x slower
260
+
261
+ input size = 86686 bytes, 0.09 MB
262
+
263
+ ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
264
+ Warming up --------------------------------------
265
+ nokogiri-md 8.000 i/100ms
266
+ nokolexbor-md 43.000 i/100ms
267
+ selma-md 39.000 i/100ms
268
+ Calculating -------------------------------------
269
+ nokogiri-md 87.367 (± 3.4%) i/s - 2.624k in 30.061642s
270
+ nokolexbor-md 438.782 (± 3.9%) i/s - 13.158k in 30.031163s
271
+ selma-md 392.591 (± 3.1%) i/s - 11.778k in 30.031391s
272
+
273
+ Comparison:
274
+ nokolexbor-md: 438.8 i/s
275
+ selma-md: 392.6 i/s - 1.12x slower
276
+ nokogiri-md: 87.4 i/s - 5.02x slower
277
+
278
+ input size = 7172510 bytes, 7.17 MB
279
+
280
+ ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
203
281
  Warming up --------------------------------------
204
- sanitize-document-small
205
- 10.000 i/100ms
206
- selma-document-small 20.000 i/100ms
282
+ nokogiri-lg 1.000 i/100ms
283
+ nokolexbor-lg 1.000 i/100ms
284
+ selma-lg 1.000 i/100ms
207
285
  Calculating -------------------------------------
208
- sanitize-document-small
209
- 107.280 (± 0.9%) i/s - 540.000 in 5.033850s
210
- selma-document-small 118.867 31.1%) i/s - 540.000 in 5.080726s
286
+ nokogiri-lg 0.895 (± 0.0%) i/s - 27.000 in 30.300832s
287
+ nokolexbor-lg 2.163 (± 0.0%) i/s - 65.000 in 30.085656s
288
+ selma-lg 5.867 0.0%) i/s - 176.000 in 30.006240s
289
+
290
+ Comparison:
291
+ selma-lg: 5.9 i/s
292
+ nokolexbor-lg: 2.2 i/s - 2.71x slower
293
+ nokogiri-lg: 0.9 i/s - 6.55x slower
211
294
  </pre>
212
295
  </details>
296
+ <!-- prettier-ignore-end -->
213
297
 
214
298
  ## Contributing
215
299
 
data/ext/selma/Cargo.toml CHANGED
@@ -2,9 +2,11 @@
2
2
  name = "selma"
3
3
  version = "1.0.0"
4
4
  edition = "2021"
5
+ rust-version = "1.75.0"
6
+ publish = false
5
7
 
6
8
  [dependencies]
7
- enum-iterator = "1.4"
9
+ enum-iterator = "2.1"
8
10
  escapist = "0.0.2"
9
11
  magnus = "0.6"
10
12
  lol_html = "1.2"
@@ -42,9 +42,9 @@ pub struct SelmaRewriter(std::cell::RefCell<Rewriter>);
42
42
  type RewriterValues = (Option<Option<Obj<SelmaSanitizer>>>, Option<RArray>);
43
43
 
44
44
  impl SelmaRewriter {
45
- const SELMA_ON_END_TAG: &str = "on_end_tag";
46
- const SELMA_HANDLE_ELEMENT: &str = "handle_element";
47
- const SELMA_HANDLE_TEXT_CHUNK: &str = "handle_text_chunk";
45
+ const SELMA_ON_END_TAG: &'static str = "on_end_tag";
46
+ const SELMA_HANDLE_ELEMENT: &'static str = "handle_element";
47
+ const SELMA_HANDLE_TEXT_CHUNK: &'static str = "handle_text_chunk";
48
48
 
49
49
  /// @yard
50
50
  /// @def new(sanitizer: Selma::Sanitizer.new(Selma::Sanitizer::Config::DEFAULT), handlers: [])
@@ -56,13 +56,14 @@ impl SelmaRewriter {
56
56
 
57
57
  let sanitizer = match rb_sanitizer {
58
58
  None => {
59
+ // no `sanitizer:` provided, use default
59
60
  let default_sanitizer = SelmaSanitizer::new(&[])?;
60
61
  let wrapped_sanitizer = Obj::wrap(default_sanitizer);
61
62
  wrapped_sanitizer.funcall::<&str, (), Value>("setup", ())?;
62
63
  Some(wrapped_sanitizer.get().to_owned())
63
64
  }
64
65
  Some(sanitizer_value) => match sanitizer_value {
65
- None => None,
66
+ None => None, // no `sanitizer:` provided, use default
66
67
  Some(sanitizer) => {
67
68
  sanitizer.funcall::<&str, (), Value>("setup", ())?;
68
69
  Some(sanitizer.get().to_owned())
@@ -211,20 +211,23 @@ impl SelmaSanitizer {
211
211
  }
212
212
  Some(protocol_list) => protocol_list.push(allowed_protocol.to_string()),
213
213
  }
214
- } else if allowed_protocol.is_kind_of(class::symbol())
215
- && allowed_protocol.inspect() == ":relative"
216
- {
217
- match protocol_list {
218
- None => {
219
- protocol_sanitizers.insert(
220
- attr_name.to_string(),
221
- vec!["#".to_string(), "/".to_string()],
222
- );
223
- }
224
- Some(protocol_list) => {
225
- protocol_list.push("#".to_string());
226
- protocol_list.push("/".to_string());
214
+ } else if allowed_protocol.is_kind_of(class::symbol()) {
215
+ let protocol_config = allowed_protocol.inspect();
216
+ if protocol_config == ":relative" {
217
+ match protocol_list {
218
+ None => {
219
+ protocol_sanitizers.insert(
220
+ attr_name.to_string(),
221
+ vec!["#".to_string(), "/".to_string()],
222
+ );
223
+ }
224
+ Some(protocol_list) => {
225
+ protocol_list.push("#".to_string());
226
+ protocol_list.push("/".to_string());
227
+ }
227
228
  }
229
+ } else if protocol_config == ":all" {
230
+ protocol_sanitizers.insert(attr_name.to_string(), vec!["all".to_string()]);
228
231
  }
229
232
  }
230
233
  }
@@ -388,6 +391,10 @@ impl SelmaSanitizer {
388
391
  }
389
392
 
390
393
  fn has_allowed_protocol(protocols_allowed: &[String], attr_val: &String) -> bool {
394
+ if protocols_allowed.contains(&"all".to_string()) {
395
+ return true;
396
+ }
397
+
391
398
  // FIXME: is there a more idiomatic way to do this?
392
399
  let mut pos: usize = 0;
393
400
  let mut chars = attr_val.chars();
@@ -205,7 +205,7 @@ impl Tag {
205
205
  || tag.index == HTMLTag::XMP as usize
206
206
  }
207
207
 
208
- pub const ESCAPEWORTHY_TAGS_CSS: &str =
208
+ pub const ESCAPEWORTHY_TAGS_CSS: &'static str =
209
209
  "title, textarea, style, xmp, iframe, noembed, noframes, script, plaintext";
210
210
 
211
211
  pub fn html_tags() -> Vec<HTMLTag> {
@@ -28,7 +28,7 @@ module Selma
28
28
 
29
29
  # URL handling protocols to allow in specific attributes. By default, no
30
30
  # protocols are allowed. Use :relative in place of a protocol if you want
31
- # to allow relative URLs sans protocol.
31
+ # to allow relative URLs sans protocol. Set to `:all` to allow any protocol.
32
32
  protocols: {},
33
33
 
34
34
  # An Array of element names whose contents will be removed. The contents
@@ -16,6 +16,7 @@ module Selma
16
16
  "colgroup",
17
17
  "data",
18
18
  "del",
19
+ "details",
19
20
  "div",
20
21
  "figcaption",
21
22
  "figure",
@@ -66,7 +66,12 @@ module Selma
66
66
  end
67
67
 
68
68
  def allow_protocol(element, attr, protos)
69
- protos = [protos] unless protos.is_a?(Array)
69
+ if protos.is_a?(Array)
70
+ raise ArgumentError, "`:all` must be passed outside of an array" if protos.include?(:all)
71
+ else
72
+ protos = [protos]
73
+ end
74
+
70
75
  set_allowed_protocols(element, attr, protos)
71
76
  end
72
77
 
data/lib/selma/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Selma
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-12 00:00:00.000000000 Z
11
+ date: 2024-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: 3.3.22
113
113
  requirements: []
114
- rubygems_version: 3.4.20
114
+ rubygems_version: 3.5.3
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Selma selects and matches HTML nodes using CSS rules. Backed by Rust's lol_html