Skip to content

Commit 529bdf5

Browse files
author
root
committed
Release v0.6.5: Add FileStorage module, EnvVarGuard, and fix bugs
1 parent bb50430 commit 529bdf5

5 files changed

Lines changed: 27 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.6.5] - 2026-03-16
6+
### Added
7+
- **FileStorage Module**: New `FileStorage` struct in `src/core/storage.rs` with full CRUD operations:
8+
- `new()`, `ensure_dir()`, `exists()`, `read()`, `write()`, `delete()`
9+
- `list_files()`, `copy()`, `move_file()`, `get_size()`
10+
- Includes comprehensive unit tests (6 tests)
11+
- **EnvVarGuard**: Safe pattern for managing environment variables in tests (replaces `unsafe { env::set_var }`)
12+
13+
### Bug Fixes
14+
- **Export Error Handling**: Fixed missing error return for unsupported export formats in `src/commands/export.rs`
15+
- **Persistence Tests**: Replaced 3 instances of unsafe env var manipulation with safe `EnvVarGuard` pattern
16+
17+
### Improvements
18+
- Removed duplicate `derive_key_secure` function in `src/core/crypto.rs`
19+
- Updated dependencies in Cargo.toml
20+
21+
## [0.6.4] - 2026-03-16
22+
### Fixed
23+
- Duplicate code in crypto.rs - removed redundant `derive_key_secure` function
24+
525
## [0.6.3] - 2026-03-15
626
### Added
727
- **Search Command**: New `naru search <query>` command to find configuration keys and values across environments

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "naru-config"
3-
version = "0.6.4"
3+
version = "0.6.5"
44
edition = "2021"
55
license = "MIT"
66
repository = "https://github.com/Luvion1/naru"

src/core/locking.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ pub struct FileLock {
1414
path: std::path::PathBuf,
1515
}
1616

17+
#[allow(dead_code)]
1718
impl FileLock {
19+
#[allow(dead_code)]
1820
pub fn path(&self) -> &std::path::PathBuf {
1921
&self.path
2022
}
@@ -82,7 +84,7 @@ mod tests {
8284

8385
// First lock
8486
let lock1 = FileLock::acquire_exclusive(&target_file).expect("Should acquire first lock");
85-
assert!(lock1.path.exists());
87+
assert!(lock1.path().exists());
8688

8789
// Second lock attempt in another scope or handled correctly
8890
// (fs2 lock_exclusive is blocking, so this would block indefinitely in a single thread)

src/core/storage.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
use std::fs;
22
use std::path::{Path, PathBuf};
33

4+
#[allow(dead_code)]
45
pub struct FileStorage {
56
base_path: PathBuf,
67
}
78

9+
#[allow(dead_code)]
810
impl FileStorage {
911
pub fn new(base_path: impl Into<PathBuf>) -> Self {
1012
Self {

0 commit comments

Comments
 (0)