diff --git a/Cargo.toml b/Cargo.toml index 05533a7..9d08248 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,12 +2,11 @@ name = "riven" version = "0.0.2" authors = ["Mingwei Samuel "] +repository = "https://github.com/MingweiSamuel/Riven" description = "Riot API Library (WIP)" license = "LGPL-3.0" edition = "2018" -exclude = [ - ".gitignore" -] +include = [ "src/**/*" ] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/srcgen/champion.rs b/src/consts/champion.rs similarity index 97% rename from srcgen/champion.rs rename to src/consts/champion.rs index 1a2a673..cad8bf3 100644 --- a/srcgen/champion.rs +++ b/src/consts/champion.rs @@ -1,7 +1,7 @@  // This file is automatically generated. // Do not directly edit. -// Generated on 2019-10-20T06:19:43.696Z +// Generated on 2019-10-21T02:25:22.691Z use std::fmt; use num_derive; diff --git a/src/consts/mod.rs b/src/consts/mod.rs index f1b9ad6..013291a 100644 --- a/src/consts/mod.rs +++ b/src/consts/mod.rs @@ -1,4 +1,5 @@ mod region; +mod champion; pub use region::*; -pub use crate::champion::*; +pub use champion::*; diff --git a/srcgen/dto.rs b/src/dto.rs similarity index 97% rename from srcgen/dto.rs rename to src/dto.rs index f7ba64c..5f07af2 100644 --- a/srcgen/dto.rs +++ b/src/dto.rs @@ -1,7 +1,7 @@ // This file is automatically generated. // Do not directly edit. -// Generated on 2019-10-20T06:19:43.812Z +// Generated on 2019-10-21T02:25:22.768Z // http://www.mingweisamuel.com/riotapi-schema/tool/ // Version 0c74167e0eaaeb6de1c7e8219fecaabcf8386d1f diff --git a/srcgen/endpoints.rs b/src/endpoints.rs similarity index 98% rename from srcgen/endpoints.rs rename to src/endpoints.rs index e519200..1432b1c 100644 --- a/srcgen/endpoints.rs +++ b/src/endpoints.rs @@ -1,7 +1,7 @@ // This file is automatically generated. // Do not directly edit. -// Generated on 2019-10-20T06:19:43.832Z +// Generated on 2019-10-21T02:25:22.772Z // http://www.mingweisamuel.com/riotapi-schema/tool/ // Version 0c74167e0eaaeb6de1c7e8219fecaabcf8386d1f diff --git a/src/lib.rs b/src/lib.rs index 0860187..9b8e230 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,9 @@ -include!("../srcgen/mod.rs"); - +mod dto; pub use dto::*; +mod endpoints; +pub use endpoints::*; + pub mod consts; mod riot_api_config; diff --git a/srcgen/champion.rs.dt b/srcgen/consts/champion.rs.dt similarity index 100% rename from srcgen/champion.rs.dt rename to srcgen/consts/champion.rs.dt diff --git a/srcgen/index.js b/srcgen/index.js index 50a5f6a..cccbcd5 100644 --- a/srcgen/index.js +++ b/srcgen/index.js @@ -54,7 +54,7 @@ downloadFilesPromise.then(() => glob.promise("**/*" + suffix, { ignore: ["**/nod console.error(`Error thrown while running "${file}":`, e); } }) - .then(output => fs.writeFileAsync(file.slice(0, -suffix.length), output, "utf8")) + .then(output => fs.writeFileAsync("../src/" + file.slice(0, -suffix.length), output, "utf8")) ) )) .catch(console.error); \ No newline at end of file diff --git a/srcgen/mod.rs b/srcgen/mod.rs deleted file mode 100644 index 60b1ab3..0000000 --- a/srcgen/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod champion; - -mod dto; -pub use dto::*; - -mod endpoints; -pub use endpoints::*; diff --git a/tests/async_tests.rs b/tests/async_tests.rs index cfc5fea..50b1568 100644 --- a/tests/async_tests.rs +++ b/tests/async_tests.rs @@ -59,6 +59,11 @@ macro_rules! rassert { if $x { Ok(()) } else { Err(stringify!($x)) }? } }; + ( $x:expr, $format:expr $(, $arg:expr)* ) => { + { + if $x { Ok(()) } else { Err( format!($format, $( $arg )* ) ) }? + } + }; } #[macro_export]