Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Tool to streamline running public crate examples #30

Closed
lgarczyn opened this issue May 17, 2019 · 7 comments
Closed

Tool to streamline running public crate examples #30

lgarczyn opened this issue May 17, 2019 · 7 comments

Comments

@lgarczyn
Copy link

lgarczyn commented May 17, 2019

A large part of trying out new libraries (say rust-sdl2) is to clone them from their github page, and calling cargo --example on one of the listed examples.

It implies opening a browser, cloning, different folders, etc. All in all, it's a lot of work to do things that cargo knows how to do.

A cargo plugin (and maybe a feature later on) allowing to run cargo example rust-sdl2 example-n1 that would just work, without having to create then delete a whole folder, and maybe even caching large libraries, would streamline the whole process.

Simply running cargo example rust-sdl2 would list the available examples.

Some sandboxing might even be added for more safety.

@BrandtM
Copy link

BrandtM commented Jul 5, 2019

I'm gonna give this one a shot.

@dtolnay
Copy link
Owner

dtolnay commented Jul 5, 2019

Nice! Thanks. Drop a link to your repository here once you start putting code up, even if it's not ready to use.

@BrandtM
Copy link

BrandtM commented Jul 5, 2019

Alright I've got the repo setup with some very basic functionality: https://github.com/BrandtM/cargo-example
For now it only uses the name of the crate you supply to clone its git repository to your CARGO_HOME/.cargo-example directory. It'll need a lot of work and I already have a bunch of ideas to make it really cool but I think the biggest roadblock will be crates.io itself.
For now you'll need to enter the specific name of the crate or the program explodes :D

@BrandtM
Copy link

BrandtM commented Jul 19, 2019

Just to give you guys a quick update: The repo is still very much WIP but it's now usable in a state where I felt comfortable publishing it on crates.io
There's still a long road ahead but at least it's not in a totally broken development stage anymore!

@dtolnay
Copy link
Owner

dtolnay commented Jul 19, 2019

Nice, that's terrific. I am confused by the readme (BrandtM/cargo-example#2) but it looks like great progress! I'll let @lgarczyn make the call as to when this solves what they were looking for, and then we can close out this issue.

@lgarczyn
Copy link
Author

I haven't had to time to try it out yet, but I'll do that as soon as I can

@dtolnay
Copy link
Owner

dtolnay commented Dec 26, 2019

I am going to close this out, and @lgarczyn and others can follow up in the issue tracker of https://github.com/BrandtM/cargo-example with any further feature requests.

Thanks @BrandtM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants