diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a9d37c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fc8501a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: rust + +branches: + only: + - master + +rust: + - stable + +notifications: + irc: 'irc.mozilla.org#rustsec' diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..28f2912 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "rustsec-advisory-db" +version = "0.0.0" +authors = ["Tony Arcieri "] +repository = "https://github.com/rustsec/advisory-db" +documentation = "https://github.com/rustsec/advisory-db" +categories = ["api-bindings", "development-tools"] +keywords = ["rustsec", "security", "advisory", "vulnerability"] + +[dependencies] +rustsec = "^0.2" diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..6d53758 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,25 @@ +extern crate rustsec; + +#[cfg(test)] +mod tests { + // Name of the advisory database in the current repo + const ADVISORY_DB_FILE: &'static str = "Advisories.toml"; + + use rustsec::AdvisoryDatabase; + use std::fs::File; + use std::io::Read; + use std::path::Path; + + #[test] + fn advisories_toml_is_well_formed() { + let path = Path::new(ADVISORY_DB_FILE); + + let mut file = File::open(&path).unwrap(); + + let mut toml = String::new(); + file.read_to_string(&mut toml).unwrap(); + + // Ensure Advisories.toml parses + AdvisoryDatabase::from_toml(&toml).unwrap(); + } +}