Skip to content

Commit

Permalink
update kug's workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanle committed Dec 5, 2024
1 parent 180949f commit d38a050
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Rust target directory (output files)
target/

# Build artifacts
**/*.rs.bk
*.rlib
*.lock

# Dependencies
Cargo.lock
/.cargo/
target/
debug/
release/

# IDE/Editor config files
.idea/
.vscode/
*.iml

# Temporary files
*.tmp
*.log
*.bak
*.swp

# MacOS-specific
.DS_Store

# Node.js/npm (optional if using Node for scripts)
node_modules/
npm-debug.log
yarn-error.log
pnpm-debug.log

# Rust language server
rls/
.clippy/
rustfmt.toml

# Environment variables
.env

# Key files (Ensure sensitive data is not committed)
*.key
*.pem
*.json
key.json
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]
members = [
"kug-cli",
"kug-core",
"kug-utils"
]

resolver = "2"
11 changes: 11 additions & 0 deletions kug-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "kug-cli"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.0", features = ["derive"] }
kug-core = { path = "../kug-core" }
kug-utils = { path = "../kug-utils" }
13 changes: 13 additions & 0 deletions kug-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use clap::Parser;
use kug_utils::greet;

#[derive(Parser)]
struct Cli {
#[arg(short, long)]
name: String,
}

fn main() {
let args = Cli::parse();
greet(&args.name);
}
8 changes: 8 additions & 0 deletions kug-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "kug-core"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
12 changes: 12 additions & 0 deletions kug-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pub fn core_functionality() {
println!("Kug-core: Core functionality activated.");
}

#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}
8 changes: 8 additions & 0 deletions kug-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "kug-utils"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
16 changes: 16 additions & 0 deletions kug-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pub fn greet(name: &str) {
println!("Hello from {}!", name);
}

pub fn validate_data(data: &str) -> bool {
!data.is_empty()
}

#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}

0 comments on commit d38a050

Please sign in to comment.