ruby_native_statistics 1.1.1 → 2.0.0.rc.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5faf5b996b751f29af9914b8a53c5769740c9f18d371a373df61c684750f7d11
4
- data.tar.gz: 990e8e34656e6756da68b2c93a1178034f857e29fa4c61d98714159df7681a64
3
+ metadata.gz: 4061d94e415b85b563b6f2046f8ee1100a7c9a05bcf971a11e6fd5b1db5dc4d4
4
+ data.tar.gz: fdb7a32215568471ac91e185697164605db62332c2761cda77c4417a7ce6fec8
5
5
  SHA512:
6
- metadata.gz: dc32a38de8184f484f725c9b9599c0f92a61555df9bd65db7bf4ee6b06c6897204398dee61bcf55e4f2a1768534b839da3e153014fb181794067e458229f79d6
7
- data.tar.gz: 2bee531af2e32b7bd51a55154992473c727f50cfb98a98be62865b13f6fd6e5c6f8b31a84466b11ea89128f60ad30697b18dc43ac248b697d7ec4d68c665475d
6
+ metadata.gz: 6dd8223ab5edb3d5756eae8c7f6a4a480ee34a238b7c9e621d1fa597a8a6c2499675e81841df52f8ef7251bb6b399fc86830827189a5ef4b7d374a416d0a3549
7
+ data.tar.gz: ed5344f11912a90f3cbaa7ad6d18872039bba1012375d1a2f4bdbb90759844e337502fa988903c3c413f57f56775221ff8cb09b31ec1fa701f1bfaad6d8d303f
data/Cargo.lock ADDED
@@ -0,0 +1,399 @@
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.3"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "bindgen"
16
+ version = "0.69.5"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
19
+ dependencies = [
20
+ "bitflags",
21
+ "cexpr",
22
+ "clang-sys",
23
+ "itertools",
24
+ "lazy_static",
25
+ "lazycell",
26
+ "proc-macro2",
27
+ "quote",
28
+ "regex",
29
+ "rustc-hash",
30
+ "shlex",
31
+ "syn",
32
+ ]
33
+
34
+ [[package]]
35
+ name = "bitflags"
36
+ version = "2.9.1"
37
+ source = "registry+https://github.com/rust-lang/crates.io-index"
38
+ checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
39
+
40
+ [[package]]
41
+ name = "cexpr"
42
+ version = "0.6.0"
43
+ source = "registry+https://github.com/rust-lang/crates.io-index"
44
+ checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
45
+ dependencies = [
46
+ "nom",
47
+ ]
48
+
49
+ [[package]]
50
+ name = "cfg-if"
51
+ version = "1.0.1"
52
+ source = "registry+https://github.com/rust-lang/crates.io-index"
53
+ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
54
+
55
+ [[package]]
56
+ name = "clang-sys"
57
+ version = "1.8.1"
58
+ source = "registry+https://github.com/rust-lang/crates.io-index"
59
+ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
60
+ dependencies = [
61
+ "glob",
62
+ "libc",
63
+ "libloading",
64
+ ]
65
+
66
+ [[package]]
67
+ name = "either"
68
+ version = "1.15.0"
69
+ source = "registry+https://github.com/rust-lang/crates.io-index"
70
+ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
71
+
72
+ [[package]]
73
+ name = "glob"
74
+ version = "0.3.2"
75
+ source = "registry+https://github.com/rust-lang/crates.io-index"
76
+ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
77
+
78
+ [[package]]
79
+ name = "itertools"
80
+ version = "0.12.1"
81
+ source = "registry+https://github.com/rust-lang/crates.io-index"
82
+ checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
83
+ dependencies = [
84
+ "either",
85
+ ]
86
+
87
+ [[package]]
88
+ name = "lazy_static"
89
+ version = "1.5.0"
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"
96
+ source = "registry+https://github.com/rust-lang/crates.io-index"
97
+ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
98
+
99
+ [[package]]
100
+ name = "libc"
101
+ version = "0.2.174"
102
+ source = "registry+https://github.com/rust-lang/crates.io-index"
103
+ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
104
+
105
+ [[package]]
106
+ name = "libloading"
107
+ version = "0.8.8"
108
+ source = "registry+https://github.com/rust-lang/crates.io-index"
109
+ checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
110
+ dependencies = [
111
+ "cfg-if",
112
+ "windows-targets",
113
+ ]
114
+
115
+ [[package]]
116
+ name = "magnus"
117
+ version = "0.7.1"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "3d87ae53030f3a22e83879e666cb94e58a7bdf31706878a0ba48752994146dab"
120
+ dependencies = [
121
+ "magnus-macros",
122
+ "rb-sys",
123
+ "rb-sys-env 0.1.2",
124
+ "seq-macro",
125
+ ]
126
+
127
+ [[package]]
128
+ name = "magnus-macros"
129
+ version = "0.6.0"
130
+ source = "registry+https://github.com/rust-lang/crates.io-index"
131
+ checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
132
+ dependencies = [
133
+ "proc-macro2",
134
+ "quote",
135
+ "syn",
136
+ ]
137
+
138
+ [[package]]
139
+ name = "memchr"
140
+ version = "2.7.5"
141
+ source = "registry+https://github.com/rust-lang/crates.io-index"
142
+ checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
143
+
144
+ [[package]]
145
+ name = "minimal-lexical"
146
+ version = "0.2.1"
147
+ source = "registry+https://github.com/rust-lang/crates.io-index"
148
+ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
149
+
150
+ [[package]]
151
+ name = "nom"
152
+ version = "7.1.3"
153
+ source = "registry+https://github.com/rust-lang/crates.io-index"
154
+ checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
155
+ dependencies = [
156
+ "memchr",
157
+ "minimal-lexical",
158
+ ]
159
+
160
+ [[package]]
161
+ name = "proc-macro2"
162
+ version = "1.0.95"
163
+ source = "registry+https://github.com/rust-lang/crates.io-index"
164
+ checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
165
+ dependencies = [
166
+ "unicode-ident",
167
+ ]
168
+
169
+ [[package]]
170
+ name = "quote"
171
+ version = "1.0.40"
172
+ source = "registry+https://github.com/rust-lang/crates.io-index"
173
+ checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
174
+ dependencies = [
175
+ "proc-macro2",
176
+ ]
177
+
178
+ [[package]]
179
+ name = "rb-sys"
180
+ version = "0.9.116"
181
+ source = "registry+https://github.com/rust-lang/crates.io-index"
182
+ checksum = "7059846f68396df83155779c75336ca24567741cb95256e6308c9fcc370e8dad"
183
+ dependencies = [
184
+ "rb-sys-build",
185
+ ]
186
+
187
+ [[package]]
188
+ name = "rb-sys-build"
189
+ version = "0.9.116"
190
+ source = "registry+https://github.com/rust-lang/crates.io-index"
191
+ checksum = "ac217510df41b9ffc041573e68d7a02aaff770c49943c7494441c4b224b0ecd0"
192
+ dependencies = [
193
+ "bindgen",
194
+ "lazy_static",
195
+ "proc-macro2",
196
+ "quote",
197
+ "regex",
198
+ "shell-words",
199
+ "syn",
200
+ ]
201
+
202
+ [[package]]
203
+ name = "rb-sys-env"
204
+ version = "0.1.2"
205
+ source = "registry+https://github.com/rust-lang/crates.io-index"
206
+ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
207
+
208
+ [[package]]
209
+ name = "rb-sys-env"
210
+ version = "0.2.2"
211
+ source = "registry+https://github.com/rust-lang/crates.io-index"
212
+ checksum = "08f8d2924cf136a1315e2b4c7460a39f62ef11ee5d522df9b2750fab55b868b6"
213
+
214
+ [[package]]
215
+ name = "rb-sys-test-helpers"
216
+ version = "0.2.2"
217
+ source = "registry+https://github.com/rust-lang/crates.io-index"
218
+ checksum = "d6ccb543252549fc28f5d290322e041cd682bd199a8e1caaa813fb6e63dd221e"
219
+ dependencies = [
220
+ "rb-sys",
221
+ "rb-sys-env 0.2.2",
222
+ "rb-sys-test-helpers-macros",
223
+ ]
224
+
225
+ [[package]]
226
+ name = "rb-sys-test-helpers-macros"
227
+ version = "0.2.2"
228
+ source = "registry+https://github.com/rust-lang/crates.io-index"
229
+ checksum = "1508caed999cb659ab1b3308e7b2985186b3b550ef5492dc18da71b560c55615"
230
+ dependencies = [
231
+ "quote",
232
+ "syn",
233
+ ]
234
+
235
+ [[package]]
236
+ name = "regex"
237
+ version = "1.11.1"
238
+ source = "registry+https://github.com/rust-lang/crates.io-index"
239
+ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
240
+ dependencies = [
241
+ "aho-corasick",
242
+ "memchr",
243
+ "regex-automata",
244
+ "regex-syntax",
245
+ ]
246
+
247
+ [[package]]
248
+ name = "regex-automata"
249
+ version = "0.4.9"
250
+ source = "registry+https://github.com/rust-lang/crates.io-index"
251
+ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
252
+ dependencies = [
253
+ "aho-corasick",
254
+ "memchr",
255
+ "regex-syntax",
256
+ ]
257
+
258
+ [[package]]
259
+ name = "regex-syntax"
260
+ version = "0.8.5"
261
+ source = "registry+https://github.com/rust-lang/crates.io-index"
262
+ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
263
+
264
+ [[package]]
265
+ name = "ruby_native_statistics"
266
+ version = "2.0.0-rc.1"
267
+ dependencies = [
268
+ "magnus",
269
+ "rb-sys",
270
+ "rb-sys-env 0.1.2",
271
+ "rb-sys-env 0.2.2",
272
+ "rb-sys-test-helpers",
273
+ "thiserror",
274
+ ]
275
+
276
+ [[package]]
277
+ name = "rustc-hash"
278
+ version = "1.1.0"
279
+ source = "registry+https://github.com/rust-lang/crates.io-index"
280
+ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
281
+
282
+ [[package]]
283
+ name = "seq-macro"
284
+ version = "0.3.6"
285
+ source = "registry+https://github.com/rust-lang/crates.io-index"
286
+ checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc"
287
+
288
+ [[package]]
289
+ name = "shell-words"
290
+ version = "1.1.0"
291
+ source = "registry+https://github.com/rust-lang/crates.io-index"
292
+ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
293
+
294
+ [[package]]
295
+ name = "shlex"
296
+ version = "1.3.0"
297
+ source = "registry+https://github.com/rust-lang/crates.io-index"
298
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
299
+
300
+ [[package]]
301
+ name = "syn"
302
+ version = "2.0.104"
303
+ source = "registry+https://github.com/rust-lang/crates.io-index"
304
+ checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
305
+ dependencies = [
306
+ "proc-macro2",
307
+ "quote",
308
+ "unicode-ident",
309
+ ]
310
+
311
+ [[package]]
312
+ name = "thiserror"
313
+ version = "2.0.12"
314
+ source = "registry+https://github.com/rust-lang/crates.io-index"
315
+ checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
316
+ dependencies = [
317
+ "thiserror-impl",
318
+ ]
319
+
320
+ [[package]]
321
+ name = "thiserror-impl"
322
+ version = "2.0.12"
323
+ source = "registry+https://github.com/rust-lang/crates.io-index"
324
+ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
325
+ dependencies = [
326
+ "proc-macro2",
327
+ "quote",
328
+ "syn",
329
+ ]
330
+
331
+ [[package]]
332
+ name = "unicode-ident"
333
+ version = "1.0.18"
334
+ source = "registry+https://github.com/rust-lang/crates.io-index"
335
+ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
336
+
337
+ [[package]]
338
+ name = "windows-targets"
339
+ version = "0.53.2"
340
+ source = "registry+https://github.com/rust-lang/crates.io-index"
341
+ checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef"
342
+ dependencies = [
343
+ "windows_aarch64_gnullvm",
344
+ "windows_aarch64_msvc",
345
+ "windows_i686_gnu",
346
+ "windows_i686_gnullvm",
347
+ "windows_i686_msvc",
348
+ "windows_x86_64_gnu",
349
+ "windows_x86_64_gnullvm",
350
+ "windows_x86_64_msvc",
351
+ ]
352
+
353
+ [[package]]
354
+ name = "windows_aarch64_gnullvm"
355
+ version = "0.53.0"
356
+ source = "registry+https://github.com/rust-lang/crates.io-index"
357
+ checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
358
+
359
+ [[package]]
360
+ name = "windows_aarch64_msvc"
361
+ version = "0.53.0"
362
+ source = "registry+https://github.com/rust-lang/crates.io-index"
363
+ checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
364
+
365
+ [[package]]
366
+ name = "windows_i686_gnu"
367
+ version = "0.53.0"
368
+ source = "registry+https://github.com/rust-lang/crates.io-index"
369
+ checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
370
+
371
+ [[package]]
372
+ name = "windows_i686_gnullvm"
373
+ version = "0.53.0"
374
+ source = "registry+https://github.com/rust-lang/crates.io-index"
375
+ checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
376
+
377
+ [[package]]
378
+ name = "windows_i686_msvc"
379
+ version = "0.53.0"
380
+ source = "registry+https://github.com/rust-lang/crates.io-index"
381
+ checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
382
+
383
+ [[package]]
384
+ name = "windows_x86_64_gnu"
385
+ version = "0.53.0"
386
+ source = "registry+https://github.com/rust-lang/crates.io-index"
387
+ checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
388
+
389
+ [[package]]
390
+ name = "windows_x86_64_gnullvm"
391
+ version = "0.53.0"
392
+ source = "registry+https://github.com/rust-lang/crates.io-index"
393
+ checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
394
+
395
+ [[package]]
396
+ name = "windows_x86_64_msvc"
397
+ version = "0.53.0"
398
+ source = "registry+https://github.com/rust-lang/crates.io-index"
399
+ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
data/Cargo.toml ADDED
@@ -0,0 +1,3 @@
1
+ [workspace]
2
+ members = ["./ext/ruby_native_statistics"]
3
+ resolver = "3"
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Test status](https://github.com/corybuecker/ruby-native-statistics/workflows/Test%20suite/badge.svg)](https://github.com/corybuecker/ruby-native-statistics/actions)
4
4
 
5
- This is a native extension to Ruby that adds native (C) statistical functions to the Array class. At present the following functions are provided:
5
+ This is a native extension to Ruby that adds native (Rust) statistical functions to the Array class. At present the following functions are provided:
6
6
 
7
7
  - [Sample Standard Deviation](https://en.wikipedia.org/wiki/Standard_deviation#Corrected_sample_standard_deviation) (stdev, stdevs)
8
8
  - [Population Standard Deviation](https://en.wikipedia.org/wiki/Standard_deviation#Uncorrected_sample_standard_deviation) (stdevp)
@@ -16,20 +16,16 @@ Check the Github Actions build to see the currently supported versions of Ruby.
16
16
 
17
17
  It is generally more performant than calculating these values with pure Ruby. For a comparison, run the benchmarks with `rake benchmark`.
18
18
 
19
- | Test (Ruby 3.3.0) | Run 1 | Run 2 | Run 3 | Run 4 | Run 5 |
20
- | ------------------ | -------- | -------- | -------- | -------- | -------- |
21
- | bench_native_stdev | 0.000069 | 0.000074 | 0.000064 | 0.000065 | 0.000065 |
22
- | bench_ruby_stdev | 0.000947 | 0.000932 | 0.000927 | 0.000948 | 0.000909 |
19
+ Here's the data converted to a Markdown table:
23
20
 
24
- | Test (Ruby 3.3.0) | Run 1 | Run 2 | Run 3 | Run 4 | Run 5 |
25
- | ------------------- | -------- | -------- | -------- | -------- | -------- |
26
- | bench_native_median | 0.000719 | 0.00067 | 0.000659 | 0.000638 | 0.000668 |
27
- | bench_ruby_median | 0.000774 | 0.000743 | 0.000724 | 0.000697 | 0.000683 |
28
-
29
- | Test (Ruby 3.3.0) | Run 1 | Run 2 | Run 3 | Run 4 | Run 5 |
30
- | ----------------- | -------- | -------- | -------- | -------- | -------- |
31
- | bench_native_mean | 0.000035 | 0.000035 | 0.000034 | 0.000032 | 0.000033 |
32
- | bench_ruby_mean | 0.000291 | 0.000287 | 0.000291 | 0.000299 | 0.000281 |
21
+ | Benchmark (Ruby 3.4.4) | Run 1 | Run 2 | Run 3 | Run 4 | Run 5 |
22
+ |--------------------------|----------|----------|----------|----------|----------|
23
+ | bench_ruby_median | 0.000676 | 0.000611 | 0.000619 | 0.000620 | 0.000583 |
24
+ | bench_native_median | 0.000179 | 0.000167 | 0.000127 | 0.000118 | 0.000188 |
25
+ | bench_ruby_stdev | 0.000780 | 0.000767 | 0.000730 | 0.000718 | 0.000733 |
26
+ | bench_native_stdev | 0.000046 | 0.000027 | 0.000034 | 0.000026 | 0.000043 |
27
+ | bench_ruby_mean | 0.000261 | 0.000240 | 0.000242 | 0.000250 | 0.000241 |
28
+ | bench_native_mean | 0.000033 | 0.000023 | 0.000022 | 0.000028 | 0.000022 |
33
29
 
34
30
  ## Found a bug? Need a function?
35
31
 
@@ -46,6 +42,12 @@ If you found a bug or need a particular function, please let me know! I work on
46
42
  # calculate population standard deviation
47
43
  p r.stdevp
48
44
 
45
+ # calculate sample variance
46
+ p r.var
47
+
48
+ # calculate population variance
49
+ p r.varp
50
+
49
51
  # calculate mean
50
52
  p r.mean
51
53
 
@@ -60,12 +62,3 @@ If you found a bug or need a particular function, please let me know! I work on
60
62
  ### Percentile
61
63
 
62
64
  Percentile uses the same rounding method as Excel, sometimes called R7.
63
-
64
- ## Links
65
-
66
- This is the third version of this gem, and it is a total rewrite of a SWIG-based design. Lots of thanks to the following resources:
67
-
68
- - https://blog.jcoglan.com/2012/07/29/your-first-ruby-native-extension-c/
69
- - https://github.com/andremedeiros/ruby-c-cheat-sheet
70
- - http://silverhammermba.github.io/emberb/c/
71
- - http://docs.ruby-lang.org/en/2.3.0/extension_rdoc.html
data/Rakefile CHANGED
@@ -1,20 +1,18 @@
1
- require "rake/extensiontask"
2
- require "rake/testtask"
1
+ # frozen_string_literal: true
3
2
 
4
- Rake::ExtensionTask.new "ruby_native_statistics" do |ext|
5
- ext.lib_dir = "lib/ruby_native_statistics"
6
- end
3
+ require 'minitest/test_task'
4
+ Minitest::TestTask.create
7
5
 
8
- Rake::TestTask.new(:test) do |t|
9
- t.libs << "test"
10
- t.libs << "lib"
11
- t.test_files = FileList["test/**/*_test.rb"]
6
+ require 'rb_sys/extensiontask'
7
+ GEMSPEC = Gem::Specification.load('ruby_native_statistics.gemspec')
8
+ RbSys::ExtensionTask.new('ruby_native_statistics', GEMSPEC) do |ext|
9
+ ext.lib_dir = 'lib/ruby_native_statistics'
12
10
  end
13
11
 
14
- Rake::TestTask.new(benchmark: [:clean, :compile]) do |t|
15
- t.libs << "test"
16
- t.libs << "lib"
17
- t.test_files = FileList["test/**/*_benchmark.rb"]
12
+ require 'rake/testtask'
13
+ Rake::TestTask.new benchmark: [:clean, :clobber, 'compile:release'] do |t|
14
+ t.libs << 'test'
15
+ t.test_files = ['test/**/*_benchmark.rb']
18
16
  end
19
17
 
20
- task :default => [:clean, :compile, :test]
18
+ task :default => ['compile:dev', :test]
data/changelog.md CHANGED
@@ -1,3 +1,8 @@
1
+ # Version 2.0.0
2
+
3
+ - Replace the C-based implementation with a Rust-based implementation. The public API is mostly unchanged (see README.md) with the exception of the error messages.
4
+ - Test and publish cross-platform Gems for Linux x86_64, Linux aarch64, and macOS arm64.
5
+
1
6
  # Version 1.1.1
2
7
 
3
8
  - Update all supported Ruby versions
@@ -0,0 +1,19 @@
1
+ [package]
2
+ name = "ruby_native_statistics"
3
+ version = "2.0.0-rc.1"
4
+ edition = "2024"
5
+
6
+ [lib]
7
+ crate-type = ["cdylib"]
8
+
9
+ [build-dependencies]
10
+ rb-sys-env = "0.2"
11
+
12
+ [dev-dependencies]
13
+ rb-sys-env = { version = "0.1" }
14
+ rb-sys-test-helpers = { version = "0.2" }
15
+
16
+ [dependencies]
17
+ magnus = { version = "0.7.1" }
18
+ rb-sys = "0.9.116"
19
+ thiserror = "2.0.12"
@@ -1,9 +1,6 @@
1
- require "mkmf"
1
+ # frozen_string_literal: true
2
2
 
3
- abort "missing pow()" unless have_func "pow"
4
- abort "missing sqrt()" unless have_func "sqrt"
5
- abort "missing malloc()" unless have_func "malloc"
6
- abort "missing free()" unless have_func "free"
7
- abort "missing trunc()" unless have_func "trunc"
3
+ require "mkmf"
4
+ require "rb_sys/mkmf"
8
5
 
9
- create_makefile "ruby_native_statistics/ruby_native_statistics"
6
+ create_rust_makefile("ruby_native_statistics/ruby_native_statistics")