Skip to content

Commit afcb96f

Browse files
authored
refactor: enhance build system and improve code organization (#47)
- Add Cargo to dependabot configuration for dependency management - Extend CI matrix to include ARM Ubuntu (ubuntu-24.04-arm) platform - Refactor mathematics.rs to separate pure Rust functions from Ruby bindings - Update build dependencies and add proper build.rs configuration - Update documentation to reflect Rust implementation instead of C - Add .ruby-version file for Ruby version management - Add test case for single element standard deviation edge case - Clean up .gitignore and add .env to ignored files
1 parent 926836e commit afcb96f

File tree

13 files changed

+65
-31
lines changed

13 files changed

+65
-31
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ updates:
88
- package-ecosystem: "github-actions"
99
directory: "/"
1010
schedule:
11-
interval: "weekly"
11+
interval: "weekly"
12+
13+
- package-ecosystem: "cargo"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"

.github/workflows/branch-protection.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
os:
1313
- ubuntu-latest
1414
- macos-latest
15+
- ubuntu-24.04-arm
1516
ruby:
1617
- 3.2.8
1718
- 3.3.8

.github/workflows/continuous-delivery.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- main
10+
1011
concurrency:
1112
group: continuous-delivery
1213
cancel-in-progress: true
@@ -19,6 +20,7 @@ jobs:
1920
os:
2021
- ubuntu-latest
2122
- macos-latest
23+
- ubuntu-24.04-arm
2224
runs-on: ${{ matrix.os }}
2325
steps:
2426
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ build-iPhoneSimulator/
5757

5858
*.bundle
5959

60-
/ext/ruby_native_statistics/target
6160
/target
6261
/.rules
62+
.env

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.4.4

Cargo.lock

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ PLATFORMS
2222

2323
DEPENDENCIES
2424
minitest (~> 5.21)
25+
rake (~> 13.0)
2526
ruby_native_statistics!
2627

2728
BUNDLED WITH

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Test status](https://github.com/corybuecker/ruby-native-statistics/workflows/Test%20suite/badge.svg)](https://github.com/corybuecker/ruby-native-statistics/actions)
44

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:
66

77
- [Sample Standard Deviation](https://en.wikipedia.org/wiki/Standard_deviation#Corrected_sample_standard_deviation) (stdev, stdevs)
88
- [Population Standard Deviation](https://en.wikipedia.org/wiki/Standard_deviation#Uncorrected_sample_standard_deviation) (stdevp)

ext/ruby_native_statistics/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ edition = "2024"
66
[lib]
77
crate-type = ["cdylib"]
88

9+
[build-dependencies]
10+
rb-sys-env = "0.2.2"
11+
912
[dependencies]
10-
magnus = { version = "0.7.1", features = ["rb-sys"] }
13+
magnus = { version = "0.7.1" }
14+
rb-sys = "0.9.116"
1115
thiserror = "2.0.12"
12-
13-
[build-dependencies]
14-
rb-sys-env = "0.1"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
use rb_sys_env;
2+
3+
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
rb_sys_env::activate()?;
5+
Ok(())
6+
}

0 commit comments

Comments
 (0)