tail_merge 0.4.4 → 0.5.0.rc1
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 +4 -4
- data/.rubocop.yml +1 -1
- data/Cargo.lock +62 -128
- data/README.md +1 -1
- data/Rakefile +4 -19
- data/ext/tail_merge/Cargo.toml +3 -3
- data/ext/tail_merge/src/lib.rs +8 -10
- data/lib/tail_merge/version.rb +1 -1
- data/lib/tail_merge.rb +7 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2df99a56984864e9a24b5a4b9a9642d2e7ba60340cd053e2f36d9bc1b9c4d886
|
|
4
|
+
data.tar.gz: 74741c1fef765529f8df96a585fa2014fef751fd857a19fed5825bf343dd406a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b407571e40f7a86a45ffd160290a4e7aaa20193c43e04e06d55b2a3759bb9d16818f71ddbd30fc560fcd47d1ed6f9a7a8693b3862bd47571639a1649d5b284d2
|
|
7
|
+
data.tar.gz: 40af6877f5e3d4bbe45df7381e2ab16b59c1bda824320bca18c83a527941f269bcbd0952cf4cf208bee011756b2f2811692665d34596b2870f999149a4dcc38a
|
data/.rubocop.yml
CHANGED
data/Cargo.lock
CHANGED
|
@@ -4,25 +4,23 @@ version = 4
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "aho-corasick"
|
|
7
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.5"
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "
|
|
9
|
+
checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
|
|
10
10
|
dependencies = [
|
|
11
11
|
"memchr",
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
[[package]]
|
|
15
15
|
name = "bindgen"
|
|
16
|
-
version = "0.
|
|
16
|
+
version = "0.72.1"
|
|
17
17
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
-
checksum = "
|
|
18
|
+
checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
|
|
19
19
|
dependencies = [
|
|
20
20
|
"bitflags",
|
|
21
21
|
"cexpr",
|
|
22
22
|
"clang-sys",
|
|
23
23
|
"itertools",
|
|
24
|
-
"lazy_static",
|
|
25
|
-
"lazycell",
|
|
26
24
|
"proc-macro2",
|
|
27
25
|
"quote",
|
|
28
26
|
"regex",
|
|
@@ -33,9 +31,9 @@ dependencies = [
|
|
|
33
31
|
|
|
34
32
|
[[package]]
|
|
35
33
|
name = "bitflags"
|
|
36
|
-
version = "2.
|
|
34
|
+
version = "2.13.2"
|
|
37
35
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
38
|
-
checksum = "
|
|
36
|
+
checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
|
|
39
37
|
|
|
40
38
|
[[package]]
|
|
41
39
|
name = "cexpr"
|
|
@@ -48,15 +46,15 @@ dependencies = [
|
|
|
48
46
|
|
|
49
47
|
[[package]]
|
|
50
48
|
name = "cfg-if"
|
|
51
|
-
version = "1.0.
|
|
49
|
+
version = "1.0.5"
|
|
52
50
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
53
|
-
checksum = "
|
|
51
|
+
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
|
54
52
|
|
|
55
53
|
[[package]]
|
|
56
54
|
name = "clang-sys"
|
|
57
|
-
version = "1.
|
|
55
|
+
version = "1.9.1"
|
|
58
56
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
59
|
-
checksum = "
|
|
57
|
+
checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a"
|
|
60
58
|
dependencies = [
|
|
61
59
|
"glob",
|
|
62
60
|
"libc",
|
|
@@ -65,58 +63,52 @@ dependencies = [
|
|
|
65
63
|
|
|
66
64
|
[[package]]
|
|
67
65
|
name = "either"
|
|
68
|
-
version = "1.
|
|
66
|
+
version = "1.19.0"
|
|
69
67
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
70
|
-
checksum = "
|
|
68
|
+
checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
|
|
71
69
|
|
|
72
70
|
[[package]]
|
|
73
71
|
name = "glob"
|
|
74
|
-
version = "0.3.
|
|
72
|
+
version = "0.3.4"
|
|
75
73
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
76
|
-
checksum = "
|
|
74
|
+
checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
|
|
77
75
|
|
|
78
76
|
[[package]]
|
|
79
77
|
name = "itertools"
|
|
80
|
-
version = "0.
|
|
78
|
+
version = "0.13.0"
|
|
81
79
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
82
|
-
checksum = "
|
|
80
|
+
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
|
|
83
81
|
dependencies = [
|
|
84
82
|
"either",
|
|
85
83
|
]
|
|
86
84
|
|
|
87
85
|
[[package]]
|
|
88
86
|
name = "lazy_static"
|
|
89
|
-
version = "1.5.
|
|
90
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
91
|
-
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
|
92
|
-
|
|
93
|
-
[[package]]
|
|
94
|
-
name = "lazycell"
|
|
95
|
-
version = "1.3.0"
|
|
87
|
+
version = "1.5.1"
|
|
96
88
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
97
|
-
checksum = "
|
|
89
|
+
checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"
|
|
98
90
|
|
|
99
91
|
[[package]]
|
|
100
92
|
name = "libc"
|
|
101
|
-
version = "0.2.
|
|
93
|
+
version = "0.2.191"
|
|
102
94
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
103
|
-
checksum = "
|
|
95
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
104
96
|
|
|
105
97
|
[[package]]
|
|
106
98
|
name = "libloading"
|
|
107
|
-
version = "0.8.
|
|
99
|
+
version = "0.8.9"
|
|
108
100
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
109
|
-
checksum = "
|
|
101
|
+
checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
|
|
110
102
|
dependencies = [
|
|
111
103
|
"cfg-if",
|
|
112
|
-
"windows-
|
|
104
|
+
"windows-link",
|
|
113
105
|
]
|
|
114
106
|
|
|
115
107
|
[[package]]
|
|
116
108
|
name = "magnus"
|
|
117
|
-
version = "0.
|
|
109
|
+
version = "0.9.3"
|
|
118
110
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
119
|
-
checksum = "
|
|
111
|
+
checksum = "40ef424404d166cbb71c8b8d19c9c589c748c4547c1afa1928c5504299f6c713"
|
|
120
112
|
dependencies = [
|
|
121
113
|
"magnus-macros",
|
|
122
114
|
"rb-sys",
|
|
@@ -126,9 +118,9 @@ dependencies = [
|
|
|
126
118
|
|
|
127
119
|
[[package]]
|
|
128
120
|
name = "magnus-macros"
|
|
129
|
-
version = "0.
|
|
121
|
+
version = "0.9.1"
|
|
130
122
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
131
|
-
checksum = "
|
|
123
|
+
checksum = "9dafde2eeb66f090e0f326112323eb8324b12cb32b5d1210e541d3df6b0ce77e"
|
|
132
124
|
dependencies = [
|
|
133
125
|
"proc-macro2",
|
|
134
126
|
"quote",
|
|
@@ -137,9 +129,9 @@ dependencies = [
|
|
|
137
129
|
|
|
138
130
|
[[package]]
|
|
139
131
|
name = "memchr"
|
|
140
|
-
version = "2.
|
|
132
|
+
version = "2.8.3"
|
|
141
133
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
142
|
-
checksum = "
|
|
134
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
143
135
|
|
|
144
136
|
[[package]]
|
|
145
137
|
name = "merger"
|
|
@@ -147,7 +139,7 @@ version = "0.1.0"
|
|
|
147
139
|
dependencies = [
|
|
148
140
|
"magnus",
|
|
149
141
|
"rb-sys",
|
|
150
|
-
"
|
|
142
|
+
"tw_merge",
|
|
151
143
|
]
|
|
152
144
|
|
|
153
145
|
[[package]]
|
|
@@ -168,36 +160,36 @@ dependencies = [
|
|
|
168
160
|
|
|
169
161
|
[[package]]
|
|
170
162
|
name = "proc-macro2"
|
|
171
|
-
version = "1.0.
|
|
163
|
+
version = "1.0.107"
|
|
172
164
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
173
|
-
checksum = "
|
|
165
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
174
166
|
dependencies = [
|
|
175
167
|
"unicode-ident",
|
|
176
168
|
]
|
|
177
169
|
|
|
178
170
|
[[package]]
|
|
179
171
|
name = "quote"
|
|
180
|
-
version = "1.0.
|
|
172
|
+
version = "1.0.47"
|
|
181
173
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
182
|
-
checksum = "
|
|
174
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
183
175
|
dependencies = [
|
|
184
176
|
"proc-macro2",
|
|
185
177
|
]
|
|
186
178
|
|
|
187
179
|
[[package]]
|
|
188
180
|
name = "rb-sys"
|
|
189
|
-
version = "0.9.
|
|
181
|
+
version = "0.9.130"
|
|
190
182
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
191
|
-
checksum = "
|
|
183
|
+
checksum = "02faf625bb10ba893e3ae620f19c9fb1b5f8fcae0fe4eb86bb3f2230fad75edb"
|
|
192
184
|
dependencies = [
|
|
193
185
|
"rb-sys-build",
|
|
194
186
|
]
|
|
195
187
|
|
|
196
188
|
[[package]]
|
|
197
189
|
name = "rb-sys-build"
|
|
198
|
-
version = "0.9.
|
|
190
|
+
version = "0.9.130"
|
|
199
191
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
200
|
-
checksum = "
|
|
192
|
+
checksum = "05be6f9c86fe5482808162826f6c047d093b3670582296c770de1d94f8066694"
|
|
201
193
|
dependencies = [
|
|
202
194
|
"bindgen",
|
|
203
195
|
"lazy_static",
|
|
@@ -210,15 +202,15 @@ dependencies = [
|
|
|
210
202
|
|
|
211
203
|
[[package]]
|
|
212
204
|
name = "rb-sys-env"
|
|
213
|
-
version = "0.
|
|
205
|
+
version = "0.2.3"
|
|
214
206
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
215
|
-
checksum = "
|
|
207
|
+
checksum = "cca7ad6a7e21e72151d56fe2495a259b5670e204c3adac41ee7ef676ea08117a"
|
|
216
208
|
|
|
217
209
|
[[package]]
|
|
218
210
|
name = "regex"
|
|
219
|
-
version = "1.
|
|
211
|
+
version = "1.13.1"
|
|
220
212
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
221
|
-
checksum = "
|
|
213
|
+
checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
|
|
222
214
|
dependencies = [
|
|
223
215
|
"aho-corasick",
|
|
224
216
|
"memchr",
|
|
@@ -228,9 +220,9 @@ dependencies = [
|
|
|
228
220
|
|
|
229
221
|
[[package]]
|
|
230
222
|
name = "regex-automata"
|
|
231
|
-
version = "0.4.
|
|
223
|
+
version = "0.4.18"
|
|
232
224
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
233
|
-
checksum = "
|
|
225
|
+
checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
|
|
234
226
|
dependencies = [
|
|
235
227
|
"aho-corasick",
|
|
236
228
|
"memchr",
|
|
@@ -239,24 +231,15 @@ dependencies = [
|
|
|
239
231
|
|
|
240
232
|
[[package]]
|
|
241
233
|
name = "regex-syntax"
|
|
242
|
-
version = "0.8.
|
|
234
|
+
version = "0.8.11"
|
|
243
235
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
244
|
-
checksum = "
|
|
236
|
+
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
|
|
245
237
|
|
|
246
238
|
[[package]]
|
|
247
239
|
name = "rustc-hash"
|
|
248
|
-
version = "
|
|
240
|
+
version = "2.1.3"
|
|
249
241
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
250
|
-
checksum = "
|
|
251
|
-
|
|
252
|
-
[[package]]
|
|
253
|
-
name = "rustui_merge"
|
|
254
|
-
version = "0.1.6"
|
|
255
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
256
|
-
checksum = "393cd2993ada676d1a92a85dd1009eb9045e2891c228b4b073888f72872c3502"
|
|
257
|
-
dependencies = [
|
|
258
|
-
"nom",
|
|
259
|
-
]
|
|
242
|
+
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
|
|
260
243
|
|
|
261
244
|
[[package]]
|
|
262
245
|
name = "seq-macro"
|
|
@@ -266,9 +249,9 @@ checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc"
|
|
|
266
249
|
|
|
267
250
|
[[package]]
|
|
268
251
|
name = "shell-words"
|
|
269
|
-
version = "1.1.
|
|
252
|
+
version = "1.1.1"
|
|
270
253
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
271
|
-
checksum = "
|
|
254
|
+
checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
|
|
272
255
|
|
|
273
256
|
[[package]]
|
|
274
257
|
name = "shlex"
|
|
@@ -278,9 +261,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
|
278
261
|
|
|
279
262
|
[[package]]
|
|
280
263
|
name = "syn"
|
|
281
|
-
version = "2.0.
|
|
264
|
+
version = "2.0.119"
|
|
282
265
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
-
checksum = "
|
|
266
|
+
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
|
284
267
|
dependencies = [
|
|
285
268
|
"proc-macro2",
|
|
286
269
|
"quote",
|
|
@@ -288,71 +271,22 @@ dependencies = [
|
|
|
288
271
|
]
|
|
289
272
|
|
|
290
273
|
[[package]]
|
|
291
|
-
name = "
|
|
292
|
-
version = "1.
|
|
274
|
+
name = "tw_merge"
|
|
275
|
+
version = "0.1.22"
|
|
293
276
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
294
|
-
checksum = "
|
|
295
|
-
|
|
296
|
-
[[package]]
|
|
297
|
-
name = "windows-targets"
|
|
298
|
-
version = "0.53.0"
|
|
299
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
300
|
-
checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b"
|
|
277
|
+
checksum = "ce1e887eb679c1f4e57fa9ac9c06f0dd9a300b63642b42d147db568b3bae7428"
|
|
301
278
|
dependencies = [
|
|
302
|
-
"
|
|
303
|
-
"windows_aarch64_msvc",
|
|
304
|
-
"windows_i686_gnu",
|
|
305
|
-
"windows_i686_gnullvm",
|
|
306
|
-
"windows_i686_msvc",
|
|
307
|
-
"windows_x86_64_gnu",
|
|
308
|
-
"windows_x86_64_gnullvm",
|
|
309
|
-
"windows_x86_64_msvc",
|
|
279
|
+
"nom",
|
|
310
280
|
]
|
|
311
281
|
|
|
312
282
|
[[package]]
|
|
313
|
-
name = "
|
|
314
|
-
version = "0.
|
|
315
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
316
|
-
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
|
|
317
|
-
|
|
318
|
-
[[package]]
|
|
319
|
-
name = "windows_aarch64_msvc"
|
|
320
|
-
version = "0.53.0"
|
|
321
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
322
|
-
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
|
|
323
|
-
|
|
324
|
-
[[package]]
|
|
325
|
-
name = "windows_i686_gnu"
|
|
326
|
-
version = "0.53.0"
|
|
327
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
328
|
-
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
|
|
329
|
-
|
|
330
|
-
[[package]]
|
|
331
|
-
name = "windows_i686_gnullvm"
|
|
332
|
-
version = "0.53.0"
|
|
333
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
334
|
-
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
|
|
335
|
-
|
|
336
|
-
[[package]]
|
|
337
|
-
name = "windows_i686_msvc"
|
|
338
|
-
version = "0.53.0"
|
|
339
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
340
|
-
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
|
|
341
|
-
|
|
342
|
-
[[package]]
|
|
343
|
-
name = "windows_x86_64_gnu"
|
|
344
|
-
version = "0.53.0"
|
|
345
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
346
|
-
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
|
|
347
|
-
|
|
348
|
-
[[package]]
|
|
349
|
-
name = "windows_x86_64_gnullvm"
|
|
350
|
-
version = "0.53.0"
|
|
283
|
+
name = "unicode-ident"
|
|
284
|
+
version = "1.0.27"
|
|
351
285
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
352
|
-
checksum = "
|
|
286
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
353
287
|
|
|
354
288
|
[[package]]
|
|
355
|
-
name = "
|
|
356
|
-
version = "0.
|
|
289
|
+
name = "windows-link"
|
|
290
|
+
version = "0.2.1"
|
|
357
291
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
358
|
-
checksum = "
|
|
292
|
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@ TailMerge.merge %w[px-2 py-1 bg-red hover:bg-dark-red p-3 bg-[#B91C1C]]
|
|
|
9
9
|
|
|
10
10
|
Classes that appear later in the list override earlier ones.
|
|
11
11
|
|
|
12
|
-
By leveraging the Rust crate [
|
|
12
|
+
By leveraging the Rust crate [tw_merge](https://docs.rs/tw_merge/latest/tw_merge/), TailMerge merges classes significantly faster than pure Ruby alternatives.
|
|
13
13
|
|
|
14
14
|
## Purpose
|
|
15
15
|
|
data/Rakefile
CHANGED
|
@@ -18,9 +18,9 @@ task build: :compile
|
|
|
18
18
|
|
|
19
19
|
GEMSPEC = Gem::Specification.load("tail_merge.gemspec")
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
ENV["RUBY_CC_VERSION"] ||=
|
|
21
|
+
# Cross-compile for every Ruby in the rake-compiler-dock image that the gemspec supports
|
|
22
|
+
require "rake_compiler_dock"
|
|
23
|
+
ENV["RUBY_CC_VERSION"] ||= RakeCompilerDock.ruby_cc_version(GEMSPEC.required_ruby_version.to_s)
|
|
24
24
|
|
|
25
25
|
PLATFORMS = %w[
|
|
26
26
|
aarch64-linux-gnu
|
|
@@ -48,22 +48,7 @@ desc "Build native extension for a given platform (i.e. `rake 'native[x86_64-lin
|
|
|
48
48
|
task :native, [:platform] do |_t, platform:|
|
|
49
49
|
raise ArgumentError, "platform is required, e.g. rake 'native[x86_64-linux]'" if platform.nil? || platform.empty?
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
# On macOS runners, prefer the native rake task (no Docker available)
|
|
53
|
-
# Map generic arm64-darwin/x86_64-darwin to specific host suffix (e.g. arm64-darwin23)
|
|
54
|
-
require "rbconfig"
|
|
55
|
-
ruby_platform = RUBY_PLATFORM # e.g. "arm64-darwin23"
|
|
56
|
-
darwin_suffix = ruby_platform[/darwin\d+/, 0]
|
|
57
|
-
mapped = platform
|
|
58
|
-
if darwin_suffix && platform =~ /^(arm64|x86_64)-darwin$/
|
|
59
|
-
arch = platform.split("-").first
|
|
60
|
-
mapped = "#{arch}-#{darwin_suffix}"
|
|
61
|
-
end
|
|
62
|
-
sh "bundle", "exec", "rake", "native:#{mapped}", "gem"
|
|
63
|
-
else
|
|
64
|
-
# For Linux/Windows, use Docker-based cross compilation
|
|
65
|
-
sh "bundle", "exec", "rb-sys-dock", "--platform", platform, "--build"
|
|
66
|
-
end
|
|
51
|
+
sh "bundle", "exec", "rb-sys-dock", "--platform", platform, "--build"
|
|
67
52
|
end
|
|
68
53
|
|
|
69
54
|
task default: %i[compile test rubocop]
|
data/ext/tail_merge/Cargo.toml
CHANGED
data/ext/tail_merge/src/lib.rs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
use magnus::{
|
|
2
2
|
function, prelude::*, Error, RArray, RHash, RString, Ruby, Value,
|
|
3
3
|
};
|
|
4
|
-
use
|
|
4
|
+
use tw_merge::merge::merge_classes as tw_merge;
|
|
5
5
|
|
|
6
|
-
fn merge_tailwind_classes(args: &[Value]) -> Result<RString, Error> {
|
|
6
|
+
fn merge_tailwind_classes(ruby: &Ruby, args: &[Value]) -> Result<RString, Error> {
|
|
7
7
|
// ---------- 1. arity ----------------------------------------------------
|
|
8
8
|
if args.is_empty() || args.len() > 2 {
|
|
9
9
|
return Err(Error::new(
|
|
10
|
-
|
|
10
|
+
ruby.exception_arg_error(),
|
|
11
11
|
"wrong number of arguments (expected 1 or 2)",
|
|
12
12
|
));
|
|
13
13
|
}
|
|
@@ -32,15 +32,15 @@ fn merge_tailwind_classes(args: &[Value]) -> Result<RString, Error> {
|
|
|
32
32
|
let s = rstr.to_string()?;
|
|
33
33
|
if !s.contains(' ') {
|
|
34
34
|
// Single class string, return as-is
|
|
35
|
-
return Ok(
|
|
35
|
+
return Ok(ruby.str_new(&s));
|
|
36
36
|
}
|
|
37
37
|
} else {
|
|
38
38
|
// Array input
|
|
39
39
|
if tokens.is_empty() {
|
|
40
|
-
return Ok(
|
|
40
|
+
return Ok(ruby.str_new(""));
|
|
41
41
|
}
|
|
42
42
|
if tokens.len() == 1 {
|
|
43
|
-
return Ok(
|
|
43
|
+
return Ok(ruby.str_new(&tokens[0]));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -50,7 +50,6 @@ fn merge_tailwind_classes(args: &[Value]) -> Result<RString, Error> {
|
|
|
50
50
|
|
|
51
51
|
if args.len() == 2 {
|
|
52
52
|
let rhash: RHash = RHash::try_convert(args[1])?;
|
|
53
|
-
let ruby = Ruby::get().unwrap();
|
|
54
53
|
|
|
55
54
|
if let Some(v) = rhash.get(ruby.to_symbol("prefix")) {
|
|
56
55
|
let s: RString = RString::try_convert(v)?;
|
|
@@ -114,12 +113,11 @@ fn merge_tailwind_classes(args: &[Value]) -> Result<RString, Error> {
|
|
|
114
113
|
tw_merge(tokens.join(" "))
|
|
115
114
|
};
|
|
116
115
|
|
|
117
|
-
Ok(
|
|
116
|
+
Ok(ruby.str_new(&merged))
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
#[magnus::init]
|
|
121
|
-
fn init() -> Result<(), Error> {
|
|
122
|
-
let ruby = Ruby::get().unwrap();
|
|
120
|
+
fn init(ruby: &Ruby) -> Result<(), Error> {
|
|
123
121
|
let tail_merge_class: magnus::RClass = ruby.class_object().const_get("TailMerge")?;
|
|
124
122
|
let merger_module = tail_merge_class.define_module("Merger")?;
|
|
125
123
|
// Assuming merge_tailwind_classes is your target function
|
data/lib/tail_merge/version.rb
CHANGED
data/lib/tail_merge.rb
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "tail_merge/version"
|
|
4
|
-
|
|
4
|
+
begin
|
|
5
|
+
require "tail_merge/merger"
|
|
6
|
+
rescue LoadError
|
|
7
|
+
require "rbconfig"
|
|
8
|
+
major_minor = RbConfig::CONFIG["ruby_version"][/^\d+\.\d+/]
|
|
9
|
+
require "tail_merge/#{major_minor}/merger"
|
|
10
|
+
end
|
|
5
11
|
|
|
6
12
|
# Main class for merging tailwind classes.
|
|
7
13
|
class TailMerge
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tail_merge
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0.rc1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Achilleas Buisman
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-11-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|
|
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
59
59
|
requirements:
|
|
60
60
|
- - ">="
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: 3.
|
|
62
|
+
version: 3.2.0
|
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
65
|
- - ">="
|