diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a9bff60 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "lib_tests" +version = "0.1.0" +authors = ["JesusPerez "] +edition = "2018" + +[dependencies] +anyhow = "1.0.40" +envmnt = "0.9.0" +serde = { version = "1.0", features = ["derive"] } +serde_derive = "1.0.125" +serde_json = "1.0.64" +serde_yaml = "0.8.17" +toml = "0.5.8" + +[dev-dependencies] +#pretty_assertions = "0.6.1" +# test-case = "1.1.0" diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..3fea39e --- /dev/null +++ b/TODO.md @@ -0,0 +1,5 @@ +### Test library + +- [ ] Implement more tests + +- [ ] Use [Test Case](https://github.com/frondeus/test-case) diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..a99dfaf --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,13 @@ +use dsc::{ + utils::load_fs_content, +}; + +use anyhow::{Result}; + +pub fn load_fs_data_content() -> Result { + let data_path = &envmnt::get_or("DATA_PATH", "."); + let data_target = &envmnt::get_or("DATA_TARGET", "data"); + let data_frmt = &envmnt::get_or("DATA_FORMAT", "yaml"); + println!("Data path: {} in {} format.", &data_path, &data_frmt); + Ok(load_fs_content(&data_path, &data_target, &data_frmt)) +}