Skip to content

Releases: umpire274/rFortune

v0.5.6

17 Nov 12:00

Choose a tag to compare

Changelog

[0.5.6] - 2025-11-17

Added

  • Official Debian (.deb) package generation using cargo-deb.
    A .deb package is now automatically built, signed, and included in every release.
    This update addresses Issue #79 — “Provide a .deb package”.

Changed

  • Updated CI pipeline to integrate .deb production on Linux (ubuntu-latest).
  • Improved artifact handling and release asset organization across platforms.

Fixed

  • Ensured consistent SHA256 and GPG signature generation for all package formats.

[0.5.5] - 2025-11-06

Added

  • Support for multiple fortune files via the repeatable --file <PATH> option.
    Example:
    rfortune --file ~/fortunes/dev --file ~/fortunes/humor
  • New configuration key fortune_files (list). When populated, it takes priority over default_file.
  • Automatic configuration migration: if fortune_files is missing or empty, it is initialized with the value of
    default_file.
  • Unified JSON-based quote cache shared across multiple fortune files.
  • Intelligent no-repeat mechanism: prevents showing the same quote twice in a row
    from the same fortune file.
  • Informational log message showing the active configuration directory during startup.
  • Advisory file locking using the fs2 crate to protect concurrent access to the shared JSON cache (
    last_quotes.json).
  • A dedicated integration test tests/cache_tests.rs to verify save/load roundtrip for the cache using a sandboxed
    application directory.

Changed

  • The function app_dir() now provides a consistent and reliable fallback when dirs::data_dir() returns None (e.g.
    in
    CI or headless environments).
    • macOS → $HOME/Library/Application Support/rfortune
    • Linux → $HOME/.local/share/rfortune
  • Improved cross-platform consistency for configuration and cache directories.
  • Fixed inconsistent cache path resolution caused by incorrect app_dir() usage on Linux/macOS.
  • Extracted duplicated cache directory creation logic into a new helper function ensure_cache_dir(), now used by both
    save_last_cache() and save_last_cache_json() for more reliable cache writes.
  • Implemented atomic writes for the JSON cache store: writes now go to a temporary file in the same directory and are
    replaced via rename. On Windows the code attempts a remove+rename fallback to cover older semantics that may prevent
    overwrites.
  • Introduced open_and_lock() helper to centralize file opening and locking logic (DRY).
  • Switched internal cache APIs to use anyhow::Result for richer error context.
  • Unified cache path resolution to consistently use config::app_dir().
  • Added fs2 and anyhow dependencies in Cargo.toml.

Fixed

  • Removed unused helper save_last_cache_json and cleaned up duplicate cache initialization logic.
  • Ensure the cache write path releases the file lock and closes the handle before attempting rename/remove (fixes
    Windows "file in use" errors during replacement).
  • Make app_dir() test override re-entrant so tests can set a sandboxed app directory per test run (replaced
    OnceLock<PathBuf> with OnceLock<Mutex<Option<PathBuf>>>).
  • Make tests robust for parallel CI runs by using unique sandbox directories (timestamp + pid) and ensuring the fortune
    source file exists before writing cache (fixes intermittent test failures on CI/Windows).

Removed

  • Deprecated single-file print_random() function replaced by multi-file logic.

[0.5.3] - 2025-11-05

Fixed

  • Added interactive check when rFortune is launched without an existing configuration directory:
    • If run in an interactive terminal, the user is asked to confirm initialization (Initialize rFortune now? [Y/n]).
    • If run in a non-interactive context (script, CI, etc.), initialization proceeds automatically.
  • Prevents unintended directory creation and improves transparency during the first launch.

Changed

  • Initialization flow is now clearer and reports actions through ConsoleLog messages.

[0.5.2] - 2025-11-04

Added

  • New ConsoleLog utility for rich, colorized console output with Unicode symbols:
    • info() – Informational messages
    • ok() – Successful operations
    • ⚠️ warn() – Warnings and recoverable issues
    • ko() – Errors and critical failures
  • Integrated ConsoleLog throughout configuration, cache, and file management commands for consistent CLI feedback.
  • New subcommand config edit for editing the configuration file directly from the terminal:
    • rfortune config edit → opens rfortune.conf using the system’s default text editor.
    • rfortune config edit --editor <name|path> → opens it with a specific editor (e.g. vi, nano, code).
  • Automatic editor detection logic:
    • Checks $VISUAL and $EDITOR environment variables.
    • Falls back to nano on macOS/Linux and notepad on Windows.
  • Integrated colored console messages (ConsoleLog) for clear feedback during editing.

Changed

  • Configuration filename renamed from config.yamlrfortune.conf for better clarity and platform
    consistency.
  • Updated initialization logic to automatically migrate existing config.yaml to the new format (backup saved as
    config.yaml.bak).
  • Unified editor behavior across platforms for a consistent CLI experience.
  • Improved user feedback when creating or editing the configuration file.

Fixed

  • Improved user feedback during config init, file init, and cache clear operations to prevent duplicate or missing
    log messages.

[0.5.1] - 2025-10-27

Added

  • Embedded Windows application icon (res/rFortune.ico) directly into the executable.
    • Implemented using the winres build dependency.
    • The icon is now visible in Windows Explorer and taskbar.
  • New res/ directory introduced for graphical assets (SVG, PNG, ICO).

Changed

  • Build process updated to automatically compile and embed Windows resources during cargo build --release.

Notes

  • The .res file generated during build is temporary and not stored in the repository.

[v0.5.0] - 2025-10-04

🔧 Refactoring

  • Split CLI definition into a dedicated cli.rs module
  • Added a new commands.rs module to handle subcommand actions (config init, file init, cache clear)
  • Extracted configuration logic from utils.rs into a new config.rs module
  • Simplified main.rs to only parse CLI input and dispatch commands

✨ CLI Improvements

  • Introduced subcommands:
    • config init → initialize the configuration file
    • file init → create a sample default fortune file (rfortune.dat)
    • cache clear → clear the cache directory
  • Enhanced --help output with a detailed long_about description and usage examples

✅ Misc

  • Clearer module boundaries (cli, commands, config, utils, loader)
  • Improved maintainability and readability of the codebase

[v0.3.0] - 2025-07-30

🔧 Refactoring

  • Removed fortune.rs and consolidated logic into new utils.rs
  • Updated main.rs and lib.rs to use rfortune crate structure consistently

🧪 Unit Testing

  • Added unit tests for loader module (parsing .dat files)
  • Added unit tests for utils module, including random_quote and print_random
  • Fixed the signature of print_random() to accept file path for cache handling

💾 Cache Support

  • Implemented cache system to avoid repeating the same fortune twice
  • Cache is stored in user-specific system path ($XDG_DATA_HOME/rfortune/cache/ or %APPDATA%\rfortune\cache\)
  • Added tests for reading/writing cache and ensuring uniqueness of quotes
  • Introduced --clear-cache flag to manually delete the entire cache directory

✅ Misc

  • Ensured full cross-platform compatibility (Linux, macOS, Windows)
  • Cleaned up unused code and improved module boundaries

[v0.2.2] - 2025-07-29

Changed

  • Updated the README.md in the homebrew-rfortune tap repository to include installation instructions via Homebrew.

Notes

  • No changes to the binary or functionality of rfortune itself.

[v0.2.1] - 2025-07-29

Added

  • Support for publishing rfortune to crates.io
  • Updated Cargo.toml with metadata required by crates.io:
    • Package description, authors, license, keywords, categories
    • Repository and homepage URLs
    • Included files for packaging

Notes

  • This version does not introduce new features or changes to functionality.
  • Users can now install rfortune directly via:
    cargo install rfortune

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.5.3

05 Nov 11:11
44edc18

Choose a tag to compare

Changelog

[0.5.3] - 2025-11-05

Fixed

  • Added interactive check when rFortune is launched without an existing configuration directory:
    • If run in an interactive terminal, the user is asked to confirm initialization (Initialize rFortune now? [Y/n]).
    • If run in a non-interactive context (script, CI, etc.), initialization proceeds automatically.
  • Prevents unintended directory creation and improves transparency during the first launch.

Changed

  • Initialization flow is now clearer and reports actions through ConsoleLog messages.

[0.5.2] - 2025-11-04

Added

  • New ConsoleLog utility for rich, colorized console output with Unicode symbols:
    • info() – Informational messages
    • ok() – Successful operations
    • ⚠️ warn() – Warnings and recoverable issues
    • ko() – Errors and critical failures
  • Integrated ConsoleLog throughout configuration, cache, and file management commands for consistent CLI feedback.
  • New subcommand config edit for editing the configuration file directly from the terminal:
    • rfortune config edit → opens rfortune.conf using the system’s default text editor.
    • rfortune config edit --editor <name|path> → opens it with a specific editor (e.g. vi, nano, code).
  • Automatic editor detection logic:
    • Checks $VISUAL and $EDITOR environment variables.
    • Falls back to nano on macOS/Linux and notepad on Windows.
  • Integrated colored console messages (ConsoleLog) for clear feedback during editing.

Changed

  • Configuration filename renamed from config.yamlrfortune.conf for better clarity and platform
    consistency.
  • Updated initialization logic to automatically migrate existing config.yaml to the new format (backup saved as
    config.yaml.bak).
  • Unified editor behavior across platforms for a consistent CLI experience.
  • Improved user feedback when creating or editing the configuration file.

Fixed

  • Improved user feedback during config init, file init, and cache clear operations to prevent duplicate or missing
    log messages.

[0.5.1] - 2025-10-27

Added

  • Embedded Windows application icon (res/rFortune.ico) directly into the executable.
    • Implemented using the winres build dependency.
    • The icon is now visible in Windows Explorer and taskbar.
  • New res/ directory introduced for graphical assets (SVG, PNG, ICO).

Changed

  • Build process updated to automatically compile and embed Windows resources during cargo build --release.

Notes

  • The .res file generated during build is temporary and not stored in the repository.

[v0.5.0] - 2025-10-04

🔧 Refactoring

  • Split CLI definition into a dedicated cli.rs module
  • Added a new commands.rs module to handle subcommand actions (config init, file init, cache clear)
  • Extracted configuration logic from utils.rs into a new config.rs module
  • Simplified main.rs to only parse CLI input and dispatch commands

✨ CLI Improvements

  • Introduced subcommands:
    • config init → initialize the configuration file
    • file init → create a sample default fortune file (rfortune.dat)
    • cache clear → clear the cache directory
  • Enhanced --help output with a detailed long_about description and usage examples

✅ Misc

  • Clearer module boundaries (cli, commands, config, utils, loader)
  • Improved maintainability and readability of the codebase

[v0.3.0] - 2025-07-30

🔧 Refactoring

  • Removed fortune.rs and consolidated logic into new utils.rs
  • Updated main.rs and lib.rs to use rfortune crate structure consistently

🧪 Unit Testing

  • Added unit tests for loader module (parsing .dat files)
  • Added unit tests for utils module, including random_quote and print_random
  • Fixed the signature of print_random() to accept file path for cache handling

💾 Cache Support

  • Implemented cache system to avoid repeating the same fortune twice
  • Cache is stored in user-specific system path ($XDG_DATA_HOME/rfortune/cache/ or %APPDATA%\rfortune\cache\)
  • Added tests for reading/writing cache and ensuring uniqueness of quotes
  • Introduced --clear-cache flag to manually delete the entire cache directory

✅ Misc

  • Ensured full cross-platform compatibility (Linux, macOS, Windows)
  • Cleaned up unused code and improved module boundaries

[v0.2.2] - 2025-07-29

Changed

  • Updated the README.md in the homebrew-rfortune tap repository to include installation instructions via Homebrew.

Notes

  • No changes to the binary or functionality of rfortune itself.

[v0.2.1] - 2025-07-29

Added

  • Support for publishing rfortune to crates.io
  • Updated Cargo.toml with metadata required by crates.io:
    • Package description, authors, license, keywords, categories
    • Repository and homepage URLs
    • Included files for packaging

Notes

  • This version does not introduce new features or changes to functionality.
  • Users can now install rfortune directly via:
    cargo install rfortune

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.5.2

04 Nov 16:12

Choose a tag to compare

Changelog

[0.5.2] - 2025-11-04

Added

  • New ConsoleLog utility for rich, colorized console output with Unicode symbols:
    • info() – Informational messages
    • ok() – Successful operations
    • ⚠️ warn() – Warnings and recoverable issues
    • ko() – Errors and critical failures
  • Integrated ConsoleLog throughout configuration, cache, and file management commands for consistent CLI feedback.
  • New subcommand config edit for editing the configuration file directly from the terminal:
    • rfortune config edit → opens rfortune.conf using the system’s default text editor.
    • rfortune config edit --editor <name|path> → opens it with a specific editor (e.g. vi, nano, code).
  • Automatic editor detection logic:
    • Checks $VISUAL and $EDITOR environment variables.
    • Falls back to nano on macOS/Linux and notepad on Windows.
  • Integrated colored console messages (ConsoleLog) for clear feedback during editing.

Changed

  • Configuration filename renamed from config.yamlrfortune.conf for better clarity and platform
    consistency.
  • Updated initialization logic to automatically migrate existing config.yaml to the new format (backup saved as
    config.yaml.bak).
  • Unified editor behavior across platforms for a consistent CLI experience.
  • Improved user feedback when creating or editing the configuration file.

Fixed

  • Improved user feedback during config init, file init, and cache clear operations to prevent duplicate or missing
    log messages.

[0.5.1] - 2025-10-27

Added

  • Embedded Windows application icon (res/rFortune.ico) directly into the executable.
    • Implemented using the winres build dependency.
    • The icon is now visible in Windows Explorer and taskbar.
  • New res/ directory introduced for graphical assets (SVG, PNG, ICO).

Changed

  • Build process updated to automatically compile and embed Windows resources during cargo build --release.

Notes

  • The .res file generated during build is temporary and not stored in the repository.

[v0.5.0] - 2025-10-04

🔧 Refactoring

  • Split CLI definition into a dedicated cli.rs module
  • Added a new commands.rs module to handle subcommand actions (config init, file init, cache clear)
  • Extracted configuration logic from utils.rs into a new config.rs module
  • Simplified main.rs to only parse CLI input and dispatch commands

✨ CLI Improvements

  • Introduced subcommands:
    • config init → initialize the configuration file
    • file init → create a sample default fortune file (rfortune.dat)
    • cache clear → clear the cache directory
  • Enhanced --help output with a detailed long_about description and usage examples

✅ Misc

  • Clearer module boundaries (cli, commands, config, utils, loader)
  • Improved maintainability and readability of the codebase

[v0.3.0] - 2025-07-30

🔧 Refactoring

  • Removed fortune.rs and consolidated logic into new utils.rs
  • Updated main.rs and lib.rs to use rfortune crate structure consistently

🧪 Unit Testing

  • Added unit tests for loader module (parsing .dat files)
  • Added unit tests for utils module, including random_quote and print_random
  • Fixed the signature of print_random() to accept file path for cache handling

💾 Cache Support

  • Implemented cache system to avoid repeating the same fortune twice
  • Cache is stored in user-specific system path ($XDG_DATA_HOME/rfortune/cache/ or %APPDATA%\rfortune\cache\)
  • Added tests for reading/writing cache and ensuring uniqueness of quotes
  • Introduced --clear-cache flag to manually delete the entire cache directory

✅ Misc

  • Ensured full cross-platform compatibility (Linux, macOS, Windows)
  • Cleaned up unused code and improved module boundaries

[v0.2.2] - 2025-07-29

Changed

  • Updated the README.md in the homebrew-rfortune tap repository to include installation instructions via Homebrew.

Notes

  • No changes to the binary or functionality of rfortune itself.

[v0.2.1] - 2025-07-29

Added

  • Support for publishing rfortune to crates.io
  • Updated Cargo.toml with metadata required by crates.io:
    • Package description, authors, license, keywords, categories
    • Repository and homepage URLs
    • Included files for packaging

Notes

  • This version does not introduce new features or changes to functionality.
  • Users can now install rfortune directly via:
    cargo install rfortune

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.5.1

28 Oct 15:41

Choose a tag to compare

Changelog

[0.5.1] - 2025-10-27

Added

  • Embedded Windows application icon (res/rFortune.ico) directly into the executable.
    • Implemented using the winres build dependency.
    • The icon is now visible in Windows Explorer and taskbar.
  • New res/ directory introduced for graphical assets (SVG, PNG, ICO).

Changed

  • Build process updated to automatically compile and embed Windows resources during cargo build --release.

Notes

  • The .res file generated during build is temporary and not stored in the repository.

[v0.5.0] - 2025-10-04

🔧 Refactoring

  • Split CLI definition into a dedicated cli.rs module
  • Added a new commands.rs module to handle subcommand actions (config init, file init, cache clear)
  • Extracted configuration logic from utils.rs into a new config.rs module
  • Simplified main.rs to only parse CLI input and dispatch commands

✨ CLI Improvements

  • Introduced subcommands:
    • config init → initialize the configuration file
    • file init → create a sample default fortune file (rfortune.dat)
    • cache clear → clear the cache directory
  • Enhanced --help output with a detailed long_about description and usage examples

✅ Misc

  • Clearer module boundaries (cli, commands, config, utils, loader)
  • Improved maintainability and readability of the codebase

[v0.3.0] - 2025-07-30

🔧 Refactoring

  • Removed fortune.rs and consolidated logic into new utils.rs
  • Updated main.rs and lib.rs to use rfortune crate structure consistently

🧪 Unit Testing

  • Added unit tests for loader module (parsing .dat files)
  • Added unit tests for utils module, including random_quote and print_random
  • Fixed the signature of print_random() to accept file path for cache handling

💾 Cache Support

  • Implemented cache system to avoid repeating the same fortune twice
  • Cache is stored in user-specific system path ($XDG_DATA_HOME/rfortune/cache/ or %APPDATA%\rfortune\cache\)
  • Added tests for reading/writing cache and ensuring uniqueness of quotes
  • Introduced --clear-cache flag to manually delete the entire cache directory

✅ Misc

  • Ensured full cross-platform compatibility (Linux, macOS, Windows)
  • Cleaned up unused code and improved module boundaries

[v0.2.2] - 2025-07-29

Changed

  • Updated the README.md in the homebrew-rfortune tap repository to include installation instructions via Homebrew.

Notes

  • No changes to the binary or functionality of rfortune itself.

[v0.2.1] - 2025-07-29

Added

  • Support for publishing rfortune to crates.io
  • Updated Cargo.toml with metadata required by crates.io:
    • Package description, authors, license, keywords, categories
    • Repository and homepage URLs
    • Included files for packaging

Notes

  • This version does not introduce new features or changes to functionality.
  • Users can now install rfortune directly via:
    cargo install rfortune

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.5.0

03 Oct 22:50

Choose a tag to compare

Changelog

[v0.5.0] - 2025-10-04

🔧 Refactoring

  • Split CLI definition into a dedicated cli.rs module
  • Added a new commands.rs module to handle subcommand actions (config init, file init, cache clear)
  • Extracted configuration logic from utils.rs into a new config.rs module
  • Simplified main.rs to only parse CLI input and dispatch commands

✨ CLI Improvements

  • Introduced subcommands:
    • config init → initialize the configuration file
    • file init → create a sample default fortune file (rfortune.dat)
    • cache clear → clear the cache directory
  • Enhanced --help output with a detailed long_about description and usage examples

✅ Misc

  • Clearer module boundaries (cli, commands, config, utils, loader)
  • Improved maintainability and readability of the codebase

[v0.3.0] - 2025-07-30

🔧 Refactoring

  • Removed fortune.rs and consolidated logic into new utils.rs
  • Updated main.rs and lib.rs to use rfortune crate structure consistently

🧪 Unit Testing

  • Added unit tests for loader module (parsing .dat files)
  • Added unit tests for utils module, including random_quote and print_random
  • Fixed the signature of print_random() to accept file path for cache handling

💾 Cache Support

  • Implemented cache system to avoid repeating the same fortune twice
  • Cache is stored in user-specific system path ($XDG_DATA_HOME/rfortune/cache/ or %APPDATA%\rfortune\cache\)
  • Added tests for reading/writing cache and ensuring uniqueness of quotes
  • Introduced --clear-cache flag to manually delete the entire cache directory

✅ Misc

  • Ensured full cross-platform compatibility (Linux, macOS, Windows)
  • Cleaned up unused code and improved module boundaries

[v0.2.2] - 2025-07-29

Changed

  • Updated the README.md in the homebrew-rfortune tap repository to include installation instructions via Homebrew.

Notes

  • No changes to the binary or functionality of rfortune itself.

[v0.2.1] - 2025-07-29

Added

  • Support for publishing rfortune to crates.io
  • Updated Cargo.toml with metadata required by crates.io:
    • Package description, authors, license, keywords, categories
    • Repository and homepage URLs
    • Included files for packaging

Notes

  • This version does not introduce new features or changes to functionality.
  • Users can now install rfortune directly via:
    cargo install rfortune

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.3.0

30 Jul 15:46
729df7f

Choose a tag to compare

Changelog

[v0.3.0] - 2025-07-30

🔧 Refactoring

  • Removed fortune.rs and consolidated logic into new utils.rs
  • Updated main.rs and lib.rs to use rfortune crate structure consistently

🧪 Unit Testing

  • Added unit tests for loader module (parsing .dat files)
  • Added unit tests for utils module, including random_quote and print_random
  • Fixed the signature of print_random() to accept file path for cache handling

💾 Cache Support

  • Implemented cache system to avoid repeating the same fortune twice
  • Cache is stored in user-specific system path ($XDG_DATA_HOME/rfortune/cache/ or %APPDATA%\rfortune\cache\)
  • Added tests for reading/writing cache and ensuring uniqueness of quotes
  • Introduced --clear-cache flag to manually delete the entire cache directory

✅ Misc

  • Ensured full cross-platform compatibility (Linux, macOS, Windows)
  • Cleaned up unused code and improved module boundaries

[v0.2.2] - 2025-07-29

Changed

  • Updated the README.md in the homebrew-rfortune tap repository to include installation instructions via Homebrew.

Notes

  • No changes to the binary or functionality of rfortune itself.

[v0.2.1] - 2025-07-29

Added

  • Support for publishing rfortune to crates.io
  • Updated Cargo.toml with metadata required by crates.io:
    • Package description, authors, license, keywords, categories
    • Repository and homepage URLs
    • Included files for packaging

Notes

  • This version does not introduce new features or changes to functionality.
  • Users can now install rfortune directly via:
    cargo install rfortune

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.2.2

30 Jul 07:53
274dae7

Choose a tag to compare

Changelog

[v0.2.2] - 2025-07-29

Changed

  • Updated the README.md in the homebrew-rfortune tap repository to include installation instructions via Homebrew.

Notes

  • No changes to the binary or functionality of rfortune itself.

[v0.2.1] - 2025-07-29

Added

  • Support for publishing rfortune to crates.io
  • Updated Cargo.toml with metadata required by crates.io:
    • Package description, authors, license, keywords, categories
    • Repository and homepage URLs
    • Included files for packaging

Notes

  • This version does not introduce new features or changes to functionality.
  • Users can now install rfortune directly via:
    cargo install rfortune

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.2.1

29 Jul 22:08
ace4df7

Choose a tag to compare

Changelog

Changelog

[v0.2.1] - 2025-07-29

Added

  • Support for publishing rfortune to crates.io
  • Updated Cargo.toml with metadata required by crates.io:
    • Package description, authors, license, keywords, categories
    • Repository and homepage URLs
    • Included files for packaging

Notes

  • This version does not introduce new features or changes to functionality.
  • Users can now install rfortune directly via:
    cargo install rfortune

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.2.0

29 Jul 20:37
f3e3746

Choose a tag to compare

Changelog

[v0.2.0] - 2025-07-27

✨ Added

  • Support for --init flag to automatically create the default directory and a sample rfortunes.dat file.
  • Cross-platform default path detection:
    • Linux/macOS: /usr/local/share/rfortune/rfortunes.dat
    • Windows: %APPDATA%\rfortune\rfortunes.dat or fallback to C:\Users\Public\rfortune\rfortunes.dat
  • Basic CLI argument parsing via clap:
    • --file <path> to specify a custom .dat file
    • --version, --help standard output
  • New README.md with full documentation of features, usage, installation, and init.
  • Modular refactoring of codebase:
    • main.rs: CLI and application entry point
    • loader.rs: reads and parses .dat files
    • fortune.rs: selects a random fortune

🛠 Changed

  • Default fortune file format now expects phrases separated by % on their own line (BSD style).
  • Improved error messages and file validation.

v0.1.1

25 Nov 21:15

Choose a tag to compare

  • Added two flags: '-h|--help' for an help message and '-v|--version' for print out the application version
  • Optimized source codes