rust-cookbook/build.rs
Michał Budzyński 254ee9bf43 Hide examples showing custom header setup until a clean solution is available (#430)
Hidden ./src/web/clients/requests/header.md and
./src/web/clients/api/rate-limited.md as the custom header story is being reworked
in https://github.com/hyperium/headers
2018-07-11 13:13:51 -07:00

21 lines
575 B
Rust

extern crate skeptic;
extern crate walkdir;
use walkdir::WalkDir;
const REMOVED_TESTS: &[&str] = &[
"./src/web/clients/requests/header.md",
"./src/web/clients/api/rate-limited.md",
];
fn main() {
let paths = WalkDir::new("./src/").into_iter()
// convert paths to Strings
.map(|p| p.unwrap().path().to_str().unwrap().to_string())
// only compile markdown files
.filter(|p| p.ends_with(".md"))
.filter(|p| !REMOVED_TESTS.contains(&p.as_ref()))
.collect::<Vec<_>>();
skeptic::generate_doc_tests(&paths[..]);
}