htmlsnob_ruby 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6edb4f157887baf073a8719eb2e0910c2d278e73f977ed6dae1178f17e3c3d00
4
+ data.tar.gz: 13615ea1f66a208925568a2a18dc77dfdf739940e3f4c1e7327499eac1017985
5
+ SHA512:
6
+ metadata.gz: 3b0ed9e5c9320e1f5e81dc98461a06ccf95411bef68ec40197adcd37e06ea6f2b6b1bbd7ec326077e0593a0172b1b38f3b0aa47d2104482a9430c3310365b8e0
7
+ data.tar.gz: 0ef0a91db24bae3a5e49dff727a13e88c77633186adfb8000e42a6f62ab0df16aae6b105863034f7fe0f2d8b4e28bc18c854be916d48212f667c986976e178dc
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.0
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: double_quotes
6
+
7
+ Style/StringLiteralsInInterpolation:
8
+ EnforcedStyle: double_quotes
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/Cargo.lock ADDED
@@ -0,0 +1,565 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "1.1.4"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "anstream"
16
+ version = "0.6.21"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a"
19
+ dependencies = [
20
+ "anstyle",
21
+ "anstyle-parse",
22
+ "anstyle-query",
23
+ "anstyle-wincon",
24
+ "colorchoice",
25
+ "is_terminal_polyfill",
26
+ "utf8parse",
27
+ ]
28
+
29
+ [[package]]
30
+ name = "anstyle"
31
+ version = "1.0.13"
32
+ source = "registry+https://github.com/rust-lang/crates.io-index"
33
+ checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"
34
+
35
+ [[package]]
36
+ name = "anstyle-parse"
37
+ version = "0.2.7"
38
+ source = "registry+https://github.com/rust-lang/crates.io-index"
39
+ checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2"
40
+ dependencies = [
41
+ "utf8parse",
42
+ ]
43
+
44
+ [[package]]
45
+ name = "anstyle-query"
46
+ version = "1.1.5"
47
+ source = "registry+https://github.com/rust-lang/crates.io-index"
48
+ checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
49
+ dependencies = [
50
+ "windows-sys",
51
+ ]
52
+
53
+ [[package]]
54
+ name = "anstyle-wincon"
55
+ version = "3.0.11"
56
+ source = "registry+https://github.com/rust-lang/crates.io-index"
57
+ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
58
+ dependencies = [
59
+ "anstyle",
60
+ "once_cell_polyfill",
61
+ "windows-sys",
62
+ ]
63
+
64
+ [[package]]
65
+ name = "bindgen"
66
+ version = "0.69.5"
67
+ source = "registry+https://github.com/rust-lang/crates.io-index"
68
+ checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
69
+ dependencies = [
70
+ "bitflags",
71
+ "cexpr",
72
+ "clang-sys",
73
+ "itertools",
74
+ "lazy_static",
75
+ "lazycell",
76
+ "proc-macro2",
77
+ "quote",
78
+ "regex",
79
+ "rustc-hash",
80
+ "shlex",
81
+ "syn",
82
+ ]
83
+
84
+ [[package]]
85
+ name = "bitflags"
86
+ version = "2.10.0"
87
+ source = "registry+https://github.com/rust-lang/crates.io-index"
88
+ checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
89
+
90
+ [[package]]
91
+ name = "cexpr"
92
+ version = "0.6.0"
93
+ source = "registry+https://github.com/rust-lang/crates.io-index"
94
+ checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
95
+ dependencies = [
96
+ "nom",
97
+ ]
98
+
99
+ [[package]]
100
+ name = "cfg-if"
101
+ version = "1.0.4"
102
+ source = "registry+https://github.com/rust-lang/crates.io-index"
103
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
104
+
105
+ [[package]]
106
+ name = "clang-sys"
107
+ version = "1.8.1"
108
+ source = "registry+https://github.com/rust-lang/crates.io-index"
109
+ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
110
+ dependencies = [
111
+ "glob",
112
+ "libc",
113
+ "libloading",
114
+ ]
115
+
116
+ [[package]]
117
+ name = "clap"
118
+ version = "4.5.54"
119
+ source = "registry+https://github.com/rust-lang/crates.io-index"
120
+ checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394"
121
+ dependencies = [
122
+ "clap_builder",
123
+ "clap_derive",
124
+ ]
125
+
126
+ [[package]]
127
+ name = "clap_builder"
128
+ version = "4.5.54"
129
+ source = "registry+https://github.com/rust-lang/crates.io-index"
130
+ checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00"
131
+ dependencies = [
132
+ "anstream",
133
+ "anstyle",
134
+ "clap_lex",
135
+ "strsim",
136
+ ]
137
+
138
+ [[package]]
139
+ name = "clap_derive"
140
+ version = "4.5.49"
141
+ source = "registry+https://github.com/rust-lang/crates.io-index"
142
+ checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671"
143
+ dependencies = [
144
+ "heck",
145
+ "proc-macro2",
146
+ "quote",
147
+ "syn",
148
+ ]
149
+
150
+ [[package]]
151
+ name = "clap_lex"
152
+ version = "0.7.6"
153
+ source = "registry+https://github.com/rust-lang/crates.io-index"
154
+ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
155
+
156
+ [[package]]
157
+ name = "colorchoice"
158
+ version = "1.0.4"
159
+ source = "registry+https://github.com/rust-lang/crates.io-index"
160
+ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
161
+
162
+ [[package]]
163
+ name = "either"
164
+ version = "1.15.0"
165
+ source = "registry+https://github.com/rust-lang/crates.io-index"
166
+ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
167
+
168
+ [[package]]
169
+ name = "equivalent"
170
+ version = "1.0.2"
171
+ source = "registry+https://github.com/rust-lang/crates.io-index"
172
+ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
173
+
174
+ [[package]]
175
+ name = "glob"
176
+ version = "0.3.3"
177
+ source = "registry+https://github.com/rust-lang/crates.io-index"
178
+ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
179
+
180
+ [[package]]
181
+ name = "hashbrown"
182
+ version = "0.16.1"
183
+ source = "registry+https://github.com/rust-lang/crates.io-index"
184
+ checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
185
+
186
+ [[package]]
187
+ name = "heck"
188
+ version = "0.5.0"
189
+ source = "registry+https://github.com/rust-lang/crates.io-index"
190
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
191
+
192
+ [[package]]
193
+ name = "htmlsnob"
194
+ version = "0.1.0"
195
+ dependencies = [
196
+ "regex",
197
+ "serde",
198
+ "toml",
199
+ ]
200
+
201
+ [[package]]
202
+ name = "htmlsnob_cli"
203
+ version = "0.1.0"
204
+ dependencies = [
205
+ "clap",
206
+ "glob",
207
+ "htmlsnob",
208
+ "htmlsnob_rules",
209
+ ]
210
+
211
+ [[package]]
212
+ name = "htmlsnob_ruby"
213
+ version = "0.1.0"
214
+ dependencies = [
215
+ "htmlsnob_cli",
216
+ "htmlsnob_rules",
217
+ "magnus",
218
+ ]
219
+
220
+ [[package]]
221
+ name = "htmlsnob_rules"
222
+ version = "0.1.0"
223
+ dependencies = [
224
+ "htmlsnob",
225
+ "regex",
226
+ "serde",
227
+ ]
228
+
229
+ [[package]]
230
+ name = "indexmap"
231
+ version = "2.12.1"
232
+ source = "registry+https://github.com/rust-lang/crates.io-index"
233
+ checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2"
234
+ dependencies = [
235
+ "equivalent",
236
+ "hashbrown",
237
+ ]
238
+
239
+ [[package]]
240
+ name = "is_terminal_polyfill"
241
+ version = "1.70.2"
242
+ source = "registry+https://github.com/rust-lang/crates.io-index"
243
+ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
244
+
245
+ [[package]]
246
+ name = "itertools"
247
+ version = "0.12.1"
248
+ source = "registry+https://github.com/rust-lang/crates.io-index"
249
+ checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
250
+ dependencies = [
251
+ "either",
252
+ ]
253
+
254
+ [[package]]
255
+ name = "lazy_static"
256
+ version = "1.5.0"
257
+ source = "registry+https://github.com/rust-lang/crates.io-index"
258
+ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
259
+
260
+ [[package]]
261
+ name = "lazycell"
262
+ version = "1.3.0"
263
+ source = "registry+https://github.com/rust-lang/crates.io-index"
264
+ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
265
+
266
+ [[package]]
267
+ name = "libc"
268
+ version = "0.2.179"
269
+ source = "registry+https://github.com/rust-lang/crates.io-index"
270
+ checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f"
271
+
272
+ [[package]]
273
+ name = "libloading"
274
+ version = "0.8.9"
275
+ source = "registry+https://github.com/rust-lang/crates.io-index"
276
+ checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
277
+ dependencies = [
278
+ "cfg-if",
279
+ "windows-link",
280
+ ]
281
+
282
+ [[package]]
283
+ name = "magnus"
284
+ version = "0.6.4"
285
+ source = "registry+https://github.com/rust-lang/crates.io-index"
286
+ checksum = "b1597ef40aa8c36be098249e82c9a20cf7199278ac1c1a1a995eeead6a184479"
287
+ dependencies = [
288
+ "magnus-macros",
289
+ "rb-sys",
290
+ "rb-sys-env",
291
+ "seq-macro",
292
+ ]
293
+
294
+ [[package]]
295
+ name = "magnus-macros"
296
+ version = "0.6.0"
297
+ source = "registry+https://github.com/rust-lang/crates.io-index"
298
+ checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
299
+ dependencies = [
300
+ "proc-macro2",
301
+ "quote",
302
+ "syn",
303
+ ]
304
+
305
+ [[package]]
306
+ name = "memchr"
307
+ version = "2.7.6"
308
+ source = "registry+https://github.com/rust-lang/crates.io-index"
309
+ checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
310
+
311
+ [[package]]
312
+ name = "minimal-lexical"
313
+ version = "0.2.1"
314
+ source = "registry+https://github.com/rust-lang/crates.io-index"
315
+ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
316
+
317
+ [[package]]
318
+ name = "nom"
319
+ version = "7.1.3"
320
+ source = "registry+https://github.com/rust-lang/crates.io-index"
321
+ checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
322
+ dependencies = [
323
+ "memchr",
324
+ "minimal-lexical",
325
+ ]
326
+
327
+ [[package]]
328
+ name = "once_cell_polyfill"
329
+ version = "1.70.2"
330
+ source = "registry+https://github.com/rust-lang/crates.io-index"
331
+ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
332
+
333
+ [[package]]
334
+ name = "proc-macro2"
335
+ version = "1.0.104"
336
+ source = "registry+https://github.com/rust-lang/crates.io-index"
337
+ checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0"
338
+ dependencies = [
339
+ "unicode-ident",
340
+ ]
341
+
342
+ [[package]]
343
+ name = "quote"
344
+ version = "1.0.42"
345
+ source = "registry+https://github.com/rust-lang/crates.io-index"
346
+ checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f"
347
+ dependencies = [
348
+ "proc-macro2",
349
+ ]
350
+
351
+ [[package]]
352
+ name = "rb-sys"
353
+ version = "0.9.123"
354
+ source = "registry+https://github.com/rust-lang/crates.io-index"
355
+ checksum = "45fb1a185af97ee456f1c9e56dbe6e2e662bec4fdeaf83c4c28e0e6adfb18816"
356
+ dependencies = [
357
+ "rb-sys-build",
358
+ ]
359
+
360
+ [[package]]
361
+ name = "rb-sys-build"
362
+ version = "0.9.123"
363
+ source = "registry+https://github.com/rust-lang/crates.io-index"
364
+ checksum = "a58ebd02d7a6033e6a5f6f8d150c1e9f16506039092b84a73e6bedce6d3adf41"
365
+ dependencies = [
366
+ "bindgen",
367
+ "lazy_static",
368
+ "proc-macro2",
369
+ "quote",
370
+ "regex",
371
+ "shell-words",
372
+ "syn",
373
+ ]
374
+
375
+ [[package]]
376
+ name = "rb-sys-env"
377
+ version = "0.1.2"
378
+ source = "registry+https://github.com/rust-lang/crates.io-index"
379
+ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
380
+
381
+ [[package]]
382
+ name = "regex"
383
+ version = "1.12.2"
384
+ source = "registry+https://github.com/rust-lang/crates.io-index"
385
+ checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
386
+ dependencies = [
387
+ "aho-corasick",
388
+ "memchr",
389
+ "regex-automata",
390
+ "regex-syntax",
391
+ ]
392
+
393
+ [[package]]
394
+ name = "regex-automata"
395
+ version = "0.4.13"
396
+ source = "registry+https://github.com/rust-lang/crates.io-index"
397
+ checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
398
+ dependencies = [
399
+ "aho-corasick",
400
+ "memchr",
401
+ "regex-syntax",
402
+ ]
403
+
404
+ [[package]]
405
+ name = "regex-syntax"
406
+ version = "0.8.8"
407
+ source = "registry+https://github.com/rust-lang/crates.io-index"
408
+ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
409
+
410
+ [[package]]
411
+ name = "rustc-hash"
412
+ version = "1.1.0"
413
+ source = "registry+https://github.com/rust-lang/crates.io-index"
414
+ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
415
+
416
+ [[package]]
417
+ name = "seq-macro"
418
+ version = "0.3.6"
419
+ source = "registry+https://github.com/rust-lang/crates.io-index"
420
+ checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc"
421
+
422
+ [[package]]
423
+ name = "serde"
424
+ version = "1.0.228"
425
+ source = "registry+https://github.com/rust-lang/crates.io-index"
426
+ checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
427
+ dependencies = [
428
+ "serde_core",
429
+ "serde_derive",
430
+ ]
431
+
432
+ [[package]]
433
+ name = "serde_core"
434
+ version = "1.0.228"
435
+ source = "registry+https://github.com/rust-lang/crates.io-index"
436
+ checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
437
+ dependencies = [
438
+ "serde_derive",
439
+ ]
440
+
441
+ [[package]]
442
+ name = "serde_derive"
443
+ version = "1.0.228"
444
+ source = "registry+https://github.com/rust-lang/crates.io-index"
445
+ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
446
+ dependencies = [
447
+ "proc-macro2",
448
+ "quote",
449
+ "syn",
450
+ ]
451
+
452
+ [[package]]
453
+ name = "serde_spanned"
454
+ version = "0.6.9"
455
+ source = "registry+https://github.com/rust-lang/crates.io-index"
456
+ checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"
457
+ dependencies = [
458
+ "serde",
459
+ ]
460
+
461
+ [[package]]
462
+ name = "shell-words"
463
+ version = "1.1.1"
464
+ source = "registry+https://github.com/rust-lang/crates.io-index"
465
+ checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
466
+
467
+ [[package]]
468
+ name = "shlex"
469
+ version = "1.3.0"
470
+ source = "registry+https://github.com/rust-lang/crates.io-index"
471
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
472
+
473
+ [[package]]
474
+ name = "strsim"
475
+ version = "0.11.1"
476
+ source = "registry+https://github.com/rust-lang/crates.io-index"
477
+ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
478
+
479
+ [[package]]
480
+ name = "syn"
481
+ version = "2.0.113"
482
+ source = "registry+https://github.com/rust-lang/crates.io-index"
483
+ checksum = "678faa00651c9eb72dd2020cbdf275d92eccb2400d568e419efdd64838145cb4"
484
+ dependencies = [
485
+ "proc-macro2",
486
+ "quote",
487
+ "unicode-ident",
488
+ ]
489
+
490
+ [[package]]
491
+ name = "toml"
492
+ version = "0.8.23"
493
+ source = "registry+https://github.com/rust-lang/crates.io-index"
494
+ checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
495
+ dependencies = [
496
+ "serde",
497
+ "serde_spanned",
498
+ "toml_datetime",
499
+ "toml_edit",
500
+ ]
501
+
502
+ [[package]]
503
+ name = "toml_datetime"
504
+ version = "0.6.11"
505
+ source = "registry+https://github.com/rust-lang/crates.io-index"
506
+ checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
507
+ dependencies = [
508
+ "serde",
509
+ ]
510
+
511
+ [[package]]
512
+ name = "toml_edit"
513
+ version = "0.22.27"
514
+ source = "registry+https://github.com/rust-lang/crates.io-index"
515
+ checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
516
+ dependencies = [
517
+ "indexmap",
518
+ "serde",
519
+ "serde_spanned",
520
+ "toml_datetime",
521
+ "toml_write",
522
+ "winnow",
523
+ ]
524
+
525
+ [[package]]
526
+ name = "toml_write"
527
+ version = "0.1.2"
528
+ source = "registry+https://github.com/rust-lang/crates.io-index"
529
+ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
530
+
531
+ [[package]]
532
+ name = "unicode-ident"
533
+ version = "1.0.22"
534
+ source = "registry+https://github.com/rust-lang/crates.io-index"
535
+ checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
536
+
537
+ [[package]]
538
+ name = "utf8parse"
539
+ version = "0.2.2"
540
+ source = "registry+https://github.com/rust-lang/crates.io-index"
541
+ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
542
+
543
+ [[package]]
544
+ name = "windows-link"
545
+ version = "0.2.1"
546
+ source = "registry+https://github.com/rust-lang/crates.io-index"
547
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
548
+
549
+ [[package]]
550
+ name = "windows-sys"
551
+ version = "0.61.2"
552
+ source = "registry+https://github.com/rust-lang/crates.io-index"
553
+ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
554
+ dependencies = [
555
+ "windows-link",
556
+ ]
557
+
558
+ [[package]]
559
+ name = "winnow"
560
+ version = "0.7.14"
561
+ source = "registry+https://github.com/rust-lang/crates.io-index"
562
+ checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
563
+ dependencies = [
564
+ "memchr",
565
+ ]
data/Cargo.toml ADDED
@@ -0,0 +1,7 @@
1
+ # This Cargo.toml is here to let externals tools (IDEs, etc.) know that this is
2
+ # a Rust project. Your extensions dependencies should be added to the Cargo.toml
3
+ # in the ext/ directory.
4
+
5
+ [workspace]
6
+ members = ["./ext/htmlsnob_ruby"]
7
+ resolver = "2"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Jens Dahl Møllerhøj
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,72 @@
1
+ <img src="htmlsnob.png" align="right"
2
+ alt="The htmlsnob himself" width="128" height="128">
3
+
4
+ _"A gentleman writes their HTML by hand"_
5
+ # HTMLsnob Ruby
6
+
7
+ Validates and formats HTML and ERB files according to your coding standards.
8
+
9
+ ## Installation
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+ ```
13
+ bundle add htmlsnob
14
+ ```
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+ ```
17
+ gem install htmlsnob
18
+ ```
19
+ Or manually add it to your application's Gemfile:
20
+ ```ruby
21
+ gem 'htmlsnob'
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ To ensure that your erb files are compliant, setup a test file like this:
27
+
28
+ Minitest:
29
+ ```ruby
30
+ class HtmlSnobTest < Minitest::Test
31
+ include HTMLsnob::Minitest
32
+
33
+ def test_htmlsnob
34
+ paths = ['*/*.html.erb', '*/**/*.html.erb'] # Glob patterns to your html or erb files
35
+
36
+ config_file = 'htmlsnob_config.yml' # Path to your config file
37
+ (status_code, message) = HtmlsnobRuby.run(paths)
38
+
39
+ # Optionally, you can specify the config file like this:
40
+ # (status_code, message) = HtmlsnobRuby.run(paths, config: "htmlsnob_config.yml")
41
+
42
+ # If there are any violations, print the message
43
+ if status_code != 0
44
+ puts message
45
+ end
46
+
47
+ assert_equal 0, status_code
48
+ end
49
+ end
50
+ ```
51
+
52
+ rspec:
53
+ ```ruby
54
+ RSpec.describe 'HTMLsnob' do
55
+ it 'validates HTML files' do
56
+ paths = ['*/*.html.erb', '*/**/*.html.erb'] # Glob patterns to your html or erb files
57
+
58
+ config_file = 'htmlsnob_config.yml' # Path to your config file
59
+ (status_code, message) = HtmlsnobRuby.run(paths)
60
+
61
+ # Optionally, you can specify the config file like this:
62
+ # (status_code, message) = HtmlsnobRuby.run(paths, config: "htmlsnob_config.yml")
63
+
64
+ # If there are any violations, print the message
65
+ if status_code != 0
66
+ puts message
67
+ end
68
+
69
+ expect(status_code).to eq(0)
70
+ end
71
+ end
72
+ ```
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ require "rb_sys/extensiontask"
13
+
14
+ task build: :compile
15
+
16
+ GEMSPEC = Gem::Specification.load("htmlsnob_ruby.gemspec")
17
+
18
+ RbSys::ExtensionTask.new("htmlsnob_ruby", GEMSPEC) do |ext|
19
+ ext.lib_dir = "lib/htmlsnob_ruby"
20
+ end
21
+
22
+ task default: %i[compile test rubocop]
@@ -0,0 +1,15 @@
1
+ [package]
2
+ name = "htmlsnob_ruby"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ authors = ["Jens Dahl Møllerhøj <mollerhoj3@gmail.com>"]
6
+ license = "MIT"
7
+ publish = false
8
+
9
+ [lib]
10
+ crate-type = ["cdylib"]
11
+
12
+ [dependencies]
13
+ htmlsnob_cli = { path = "../../../htmlsnob_cli" }
14
+ htmlsnob_rules = { path = "../../../htmlsnob_rules" }
15
+ magnus = { version = "0.6.2" }
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "mkmf"
4
+ require "rb_sys/mkmf"
5
+
6
+ create_rust_makefile("htmlsnob_ruby/htmlsnob_ruby")
@@ -0,0 +1,18 @@
1
+ use magnus::{function, prelude::*, Error, RHash, Ruby, Symbol};
2
+
3
+ fn run_simple(file_paths: Vec<String>, config: Option<String>) -> (i32, String) {
4
+ htmlsnob_cli::run(htmlsnob_cli::SimpleArgs {
5
+ paths: file_paths,
6
+ autofix: false,
7
+ config,
8
+ ignore: Vec::new(),
9
+ registry: htmlsnob_rules::registry(),
10
+ })
11
+ }
12
+
13
+ #[magnus::init]
14
+ fn init(ruby: &Ruby) -> Result<(), Error> {
15
+ let module = ruby.define_module("HtmlsnobRuby")?;
16
+ module.define_singleton_method("run_simple", function!(run_simple, 2))?;
17
+ Ok(())
18
+ }
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HtmlsnobRuby
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "htmlsnob_ruby/version"
4
+ require_relative "htmlsnob_ruby/htmlsnob_ruby"
5
+ require 'yaml'
6
+ require 'toml-rb'
7
+ require 'tempfile'
8
+
9
+ module HtmlsnobRuby
10
+ class Error < StandardError; end
11
+
12
+ def self.run(paths, options = {})
13
+ config = options[:config]
14
+
15
+ if config && (config.end_with?(".yml") || config.end_with?(".yaml"))
16
+ # YAML
17
+ Tempfile.create(['converted_config', '.toml']) do |temp|
18
+ temp.write(TomlRB.dump(YAML.load_file(config)))
19
+ temp.rewind
20
+ HtmlsnobRuby.run_simple(paths, temp.path)
21
+ end
22
+ else
23
+ # TOML
24
+ HtmlsnobRuby.run_simple(paths, config)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,4 @@
1
+ module HtmlsnobRuby
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: htmlsnob_ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jens Dahl Møllerhøj
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2026-01-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A Ruby binding for the HTMLSnob library, which provides HTML validation.
14
+ email:
15
+ - mollerhoj3@gmail.com
16
+ executables: []
17
+ extensions:
18
+ - ext/htmlsnob_ruby/Cargo.toml
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ".rubocop.yml"
22
+ - CODE_OF_CONDUCT.md
23
+ - Cargo.lock
24
+ - Cargo.toml
25
+ - LICENSE.txt
26
+ - README.md
27
+ - Rakefile
28
+ - ext/htmlsnob_ruby/Cargo.toml
29
+ - ext/htmlsnob_ruby/extconf.rb
30
+ - ext/htmlsnob_ruby/src/lib.rs
31
+ - lib/htmlsnob_ruby.rb
32
+ - lib/htmlsnob_ruby/version.rb
33
+ - sig/htmlsnob_ruby.rbs
34
+ homepage: https://github.com/mollerhoj/htmlsnob
35
+ licenses:
36
+ - MIT
37
+ metadata:
38
+ homepage_uri: https://github.com/mollerhoj/htmlsnob
39
+ source_code_uri: https://github.com/mollerhoj/htmlsnob
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: 3.0.0
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 3.3.11
54
+ requirements: []
55
+ rubygems_version: 3.5.11
56
+ signing_key:
57
+ specification_version: 4
58
+ summary: A Ruby binding for the HTMLSnob library.
59
+ test_files: []