No description
Find a file
2025-09-09 15:26:00 +07:00
lib update gitignore and sync_file_list doc 2025-09-09 15:19:50 +07:00
src update gitignore and sync_file_list doc 2025-09-09 15:19:50 +07:00
.gitignore update gitignore and sync_file_list doc 2025-09-09 15:19:50 +07:00
Cargo.lock add deps and some guide 2025-09-09 15:26:00 +07:00
Cargo.toml add deps and some guide 2025-09-09 15:26:00 +07:00
libfilesGuide.png add deps and some guide 2025-09-09 15:26:00 +07:00
README.md add deep diff pd 2025-09-05 08:56:21 +07:00

libtbr

libtbr is library for operating files especially for Taobin recipes. Provides a set of utilities for operations like querying, filtering, sorting, merging and more.

cargo add --git https://gitlab.forthrd.io/Pakin/libtbr.git
cargo update

Examples

Initialize Config

use libtbr::recipe_functions::common;

// this read file `.tbcfg` in the current directory
let cfg = common::get_config();

let recipe_dir = cfg.get("RECIPE_DIR").unwrap();

Get recipe from specific country (latest)

...
let latest_versions = grep_latest_versions(recipe_dir).unwrap();

// try get malaysia recipe, may fail if country does not exist
let mys_version = latest_versions.get("mys");
// try to create malaysia recipe model
let mys_recipe_model = common::create_recipe_model_from_file(common::create_recipe_path(
    "mys",
    *mys_version.unwrap(),
));

...

...WIP