From 1a6f8c4f5daca74d93d5577542eb5513a85e58ed Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Mon, 23 Dec 2019 14:56:19 +0300 Subject: [PATCH] chore: change structure --- .gitignore | 2 +- Cargo.toml | 22 +++++-------------- itconfig/Cargo.toml | 17 ++++++++++++++ README.md => itconfig/README.md | 0 {src => itconfig/src}/lib.rs | 4 ++-- itconfig_tests/Cargo.toml | 11 ++++++++++ .../tests}/config_macro.rs | 2 +- 7 files changed, 37 insertions(+), 21 deletions(-) create mode 100644 itconfig/Cargo.toml rename README.md => itconfig/README.md (100%) rename {src => itconfig/src}/lib.rs (98%) create mode 100644 itconfig_tests/Cargo.toml rename {tests => itconfig_tests/tests}/config_macro.rs (98%) diff --git a/.gitignore b/.gitignore index 060e7fb..3472ba2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,5 @@ /target Cargo.lock -src/main.rs +itconfig/src/main.rs .env* diff --git a/Cargo.toml b/Cargo.toml index 8cd30c3..c77a2ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,17 +1,5 @@ -[package] -name = "itconfig" -version = "0.2.2" -authors = ["Dmitriy Pleshevskiy "] -description = "Easy build a configs from environment variables and use it in globally." -categories = ["config", "web-programming"] -keywords = ["config", "env", "macro", "configuration", "environment"] -edition = "2018" -license = "MIT" -repository = "https://github.com/icetemple/itconfig-rs" -homepage = "https://github.com/icetemple/itconfig-rs" -documentation = "https://docs.rs/itconfig" -readme = "README.md" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] +[workspace] +members = [ + "itconfig", + "itconfig_tests" +] \ No newline at end of file diff --git a/itconfig/Cargo.toml b/itconfig/Cargo.toml new file mode 100644 index 0000000..f550f07 --- /dev/null +++ b/itconfig/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "itconfig" +version = "0.2.3" +authors = ["Dmitriy Pleshevskiy "] +description = "Easy build a configs from environment variables and use it in globally." +categories = ["config", "web-programming"] +keywords = ["config", "env", "macro", "configuration", "environment"] +edition = "2018" +license = "MIT" +repository = "https://github.com/icetemple/itconfig-rs" +homepage = "https://github.com/icetemple/itconfig-rs" +documentation = "https://docs.rs/itconfig" +readme = "README.md" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/README.md b/itconfig/README.md similarity index 100% rename from README.md rename to itconfig/README.md diff --git a/src/lib.rs b/itconfig/src/lib.rs similarity index 98% rename from src/lib.rs rename to itconfig/src/lib.rs index 482c0bc..fc4dec7 100644 --- a/src/lib.rs +++ b/itconfig/src/lib.rs @@ -108,7 +108,7 @@ impl From for String { /// ```rust /// # #[macro_use] extern crate itconfig; /// config! { -/// #![mod_name = configuration]; +/// #![mod_name = configuration] /// /// DEBUG: bool, /// } @@ -166,7 +166,7 @@ macro_rules! __itconfig_parse_module { // Find module name ( tokens = [ - #![mod_name = $mod_name:ident]; + #![mod_name = $mod_name:ident] $($rest:tt)* ], name = $ignore:tt, diff --git a/itconfig_tests/Cargo.toml b/itconfig_tests/Cargo.toml new file mode 100644 index 0000000..f9c7846 --- /dev/null +++ b/itconfig_tests/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "itconfig_tests" +version = "0.1.0" +authors = ["Dmitriy Pleshevskiy "] +edition = "2018" +license = "MIT" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +itconfig = { path = '../itconfig' } \ No newline at end of file diff --git a/tests/config_macro.rs b/itconfig_tests/tests/config_macro.rs similarity index 98% rename from tests/config_macro.rs rename to itconfig_tests/tests/config_macro.rs index 4b50ca5..1037ac1 100644 --- a/tests/config_macro.rs +++ b/itconfig_tests/tests/config_macro.rs @@ -114,7 +114,7 @@ fn convert_number_value_from_env() { #[test] fn change_config_module_name() { config! { - #![mod_name = custom_config_name]; + #![mod_name = custom_config_name] DEBUG: bool => true, }