Expand description
A module for collecting files based on include and exclude patterns.
This module provides functionality to collect files from a specified folder while respecting configured include and exclude patterns.
§Examples
use rdocs::collect::Collector;
use std::path::Path;
let folder = Path::new("./fixtures");
let collector = Collector::new(folder).expect("Failed to create collector instance");
let files = collector.collect_files();
println!("Collected files: {:?}", files);
use rdocs::collect::{Collector, Config};
use std::path::Path;
use regex::Regex;
let folder = Path::new("./fixtures");
let config = Config{
includes: vec![],
excludes: vec![Regex::new("exclude.rs").unwrap()].into()
};
let collector = Collector::from_config(folder, &config).expect("Failed to create collector instance");
let files = collector.collect_files();
println!("Collected files: {:?}", files);