From c93421066fce1e4b579767793a48dcddf473853c Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Wed, 1 Jan 2025 18:31:49 -0500 Subject: [PATCH] expose library api --- Cargo.lock | 4 ++-- cli/Cargo.toml | 4 ++-- lib/Cargo.toml | 2 +- lib/src/range/mod.rs | 8 ++++---- lib/src/range/parse.rs | 2 +- lib/src/semver/mod.rs | 10 +++++----- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1e570e..d9892f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,7 +107,7 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "libsemverator" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "regex", @@ -150,7 +150,7 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "semverator" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "clap", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 4ed710e..6ff67a0 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "semverator" -version = "0.7.0" +version = "0.7.1" edition = "2021" license = "Apache-2.0" readme = "../README.md" @@ -13,7 +13,7 @@ categories = ["command-line-utilities"] [dependencies] anyhow = "1.0.75" clap = { version = '4.4.2', features = ['cargo'] } -libsemverator = { path = "../lib", version = "0.7.0" } +libsemverator = { path = "../lib", version = "0.7.1" } [lints.rust] unexpected_cfgs = { level = "allow", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 8773974..ccb48bc 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libsemverator" -version = "0.7.0" +version = "0.7.1" edition = "2021" license = "Apache-2.0" readme = "../README.md" diff --git a/lib/src/range/mod.rs b/lib/src/range/mod.rs index 7ccb246..3b1a963 100644 --- a/lib/src/range/mod.rs +++ b/lib/src/range/mod.rs @@ -1,10 +1,10 @@ use crate::semver::Semver; use std::hash::{Hash, Hasher}; -mod intersect; -mod max; -mod parse; -mod satisfies; +pub mod intersect; +pub mod max; +pub mod parse; +pub mod satisfies; #[derive(Debug, Clone)] pub struct Range { diff --git a/lib/src/range/parse.rs b/lib/src/range/parse.rs index f160ce4..e514d47 100644 --- a/lib/src/range/parse.rs +++ b/lib/src/range/parse.rs @@ -35,7 +35,7 @@ impl Range { } impl Constraint { - fn parse(constraint: &str) -> Result { + pub fn parse(constraint: &str) -> Result { let re = Regex::new(r"^>=((\d+\.)*\d+)\s*(<((\d+\.)*\d+))?$")?; if let Some(cap) = re.captures(constraint) { let v1 = Semver::parse(cap.get(1).context("invalid description")?.as_str())?; diff --git a/lib/src/semver/mod.rs b/lib/src/semver/mod.rs index 6eb4921..367bd9e 100644 --- a/lib/src/semver/mod.rs +++ b/lib/src/semver/mod.rs @@ -1,6 +1,6 @@ pub mod bump; -mod compare; -mod parse; +pub mod compare; +pub mod parse; #[derive(Default, Debug, Clone, Eq)] pub struct Semver { @@ -8,10 +8,10 @@ pub struct Semver { pub major: usize, pub minor: usize, - patch: usize, + pub patch: usize, - prerelease: Vec, - build: Vec, + pub prerelease: Vec, + pub build: Vec, pub raw: String, }