frewsxcv / rust-crates-index

Rust library for retrieving and interacting with the crates.io index
https://docs.rs/crates-index/
Apache License 2.0
72 stars 37 forks source link

This just does dependency names for now #1

Closed steveklabnik closed 9 years ago

steveklabnik commented 9 years ago

... any interest in exposing the rest of the information? I'm tempted to use this crate, but I need all the info.

frewsxcv commented 9 years ago

Just so I have a better understanding of what you're looking for, what's an example of another piece of data you'd like from the 'rest of the information'?

steveklabnik commented 9 years ago

Well, right now, you have all of this: https://github.com/frewsxcv/rust-crates-index/blob/master/src/lib.rs#L29-L47

but the dependency map only includes the names https://github.com/frewsxcv/rust-crates-index/blob/master/src/lib.rs#L92

any of those other columns would be useful, for example, if I wanted to only look at certain versions instead of literally everything.

frewsxcv commented 9 years ago

Ah gotcha. Thanks for the clarification, I'll look into this

steveklabnik commented 9 years ago

:+1:

it's also possible that instead of using dependency_map, I should be just creating them directly or something. but it seemed like that method was the main entry point

frewsxcv commented 9 years ago

Just published 0.2.0

I attempted to make it more general purpose. Instead of having just a dependency_map method, one would do something like:

let index = Index::new("some-directory".into());
if !index.exists() {
    index.clone().unwrap();
}
let crate_ = index.crates().nth(0).unwrap();
let version = crate_.latest_version();
let _ = version.deps;  // vec of dependencies here (more than just names)

See the docs linked from the README for more info. If you have any suggestions, let me know