Skip to content

Commit d69d750

Browse files
authored
Merge pull request #70 from umpire274/v0.5.0
V0.5.0
2 parents 729df7f + d2f9aa1 commit d69d750

File tree

12 files changed

+425
-154
lines changed

12 files changed

+425
-154
lines changed

.github/workflows/rust.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@ jobs:
1010
check:
1111
name: Lint & Test
1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4
17-
17+
1818
- name: Install Rust
1919
uses: dtolnay/rust-toolchain@stable
20-
20+
21+
- name: Install rustfmt and clippy components
22+
run: |
23+
rustup component add rustfmt
24+
rustup component add clippy
25+
2126
- name: Format Check
2227
run: cargo fmt --all -- --check
23-
28+
2429
- name: Clippy Check
2530
run: cargo clippy --all-targets --all-features -- -D warnings
26-
31+
2732
- name: Run Tests
2833
run: cargo test --all

CHANGELOG.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,51 @@
11
# Changelog
22

3+
## [v0.5.0] - 2025-10-04
4+
5+
### 🔧 Refactoring
6+
7+
- Split CLI definition into a dedicated `cli.rs` module
8+
- Added a new `commands.rs` module to handle subcommand actions (`config init`, `file init`, `cache clear`)
9+
- Extracted configuration logic from `utils.rs` into a new `config.rs` module
10+
- Simplified `main.rs` to only parse CLI input and dispatch commands
11+
12+
### ✨ CLI Improvements
13+
14+
- Introduced subcommands:
15+
- `config init` → initialize the configuration file
16+
- `file init` → create a sample default fortune file (`rfortune.dat`)
17+
- `cache clear` → clear the cache directory
18+
- Enhanced `--help` output with a detailed `long_about` description and usage examples
19+
20+
### ✅ Misc
21+
22+
- Clearer module boundaries (`cli`, `commands`, `config`, `utils`, `loader`)
23+
- Improved maintainability and readability of the codebase
24+
25+
---
26+
327
## [v0.3.0] - 2025-07-30
428

529
### 🔧 Refactoring
30+
631
- Removed `fortune.rs` and consolidated logic into new `utils.rs`
732
- Updated `main.rs` and `lib.rs` to use `rfortune` crate structure consistently
833

934
### 🧪 Unit Testing
35+
1036
- Added unit tests for `loader` module (parsing `.dat` files)
1137
- Added unit tests for `utils` module, including `random_quote` and `print_random`
1238
- Fixed the signature of `print_random()` to accept file path for cache handling
1339

1440
### 💾 Cache Support
41+
1542
- Implemented cache system to avoid repeating the same fortune twice
1643
- Cache is stored in user-specific system path (`$XDG_DATA_HOME/rfortune/cache/` or `%APPDATA%\rfortune\cache\`)
1744
- Added tests for reading/writing cache and ensuring uniqueness of quotes
1845
- Introduced `--clear-cache` flag to manually delete the entire cache directory
1946

2047
### ✅ Misc
48+
2149
- Ensured full cross-platform compatibility (Linux, macOS, Windows)
2250
- Cleaned up unused code and improved module boundaries
2351

@@ -26,29 +54,33 @@
2654
## [v0.2.2] - 2025-07-29
2755

2856
### Changed
57+
2958
- Updated the `README.md` in the `homebrew-rfortune` tap repository to include installation instructions via Homebrew.
3059

3160
### Notes
61+
3262
- No changes to the binary or functionality of `rfortune` itself.
3363

3464
---
3565

3666
## [v0.2.1] - 2025-07-29
3767

3868
### Added
69+
3970
- Support for publishing `rfortune` to [crates.io](https://crates.io/crates/rfortune)
4071
- Updated `Cargo.toml` with metadata required by crates.io:
41-
- Package description, authors, license, keywords, categories
42-
- Repository and homepage URLs
43-
- Included files for packaging
72+
- Package description, authors, license, keywords, categories
73+
- Repository and homepage URLs
74+
- Included files for packaging
4475

4576
### Notes
77+
4678
- This version does not introduce new features or changes to functionality.
4779
- Users can now install `rfortune` directly via:
4880
```bash
4981
cargo install rfortune
5082
```
51-
83+
5284
---
5385

5486
## [v0.2.0] - 2025-07-27

Cargo.lock

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

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rfortune"
3-
version = "0.3.0"
4-
edition = "2021"
3+
version = "0.5.0"
4+
edition = "2024"
55
authors = ["Umpire274 <umpire274@gmail.com>"]
66
description = "A Rust-based clone of the classic UNIX 'fortune' command"
77
homepage = "https://github.com/umpire274/rFortune"
@@ -19,6 +19,9 @@ include = [
1919
]
2020

2121
[dependencies]
22+
clap = { version = "4.5.48", features = ["derive"] }
2223
rand = "0.9.2"
23-
clap = { version = "4.5.42", features = ["derive"] }
2424
dirs = "6.0.0"
25+
serde = { version = "1.0.228", features = ["derive"] }
26+
serde_yaml = "0.9.33"
27+

0 commit comments

Comments
 (0)