[][src]Struct librelic::prelude::git::RepoGroup

pub struct RepoGroup<'a> { /* fields omitted */ }

Git repository

Implementations

impl<'a> RepoGroup<'a>[src]

pub fn new() -> RepoGroup<'a>[src]

Create a new repo group instance.

Examples

use skellige::prelude::*;

let _group = git::RepoGroup::new();

pub fn add(self, repo: Repo<'a>) -> RepoGroup<'a>[src]

Add the given repo to the repo group

Examples

use skellige::prelude::*;

let group = git::RepoGroup::new();
group.add(git::Repo::new("foo").unwrap());

pub fn with_progress(self, yes: bool) -> RepoGroup<'a>[src]

Enable terminal progress bars using the indicatif crate

Examples

use skellige::prelude::*;

let group = git::RepoGroup::new().with_progress(true);

pub fn clone(&self) -> Result<(), Error>[src]

Clone the repos locally. This method spins off threads to handle cloning all the repos in parallel. Calling this function consumes any progress callbacks you may have set.

Examples

use skellige::prelude::*;

let tmpdir = PathBuf::from("tests/temp").abs().unwrap().mash("git_repo_clone_many_doc");
assert!(sys::remove_all(&tmpdir).is_ok());
let repo1 = tmpdir.mash("repo1");
let repo2 = tmpdir.mash("repo2");
let repo1file = repo1.mash("README.md");
let repo2file = repo2.mash("README.md");
assert!(sys::mkdir(&tmpdir).is_ok());
let repos = git::RepoGroup::new()
    .with_progress(true)
    .add(git::Repo::new(&repo1).unwrap().url("https://github.com/phR0ze/alpine-base"))
    .add(git::Repo::new(&repo2).unwrap().url("https://github.com/phR0ze/alpine-core"));
assert!(repos.clone().is_ok());
assert_eq!(repo1file.exists(), true);
assert_eq!(repo2file.exists(), true);
assert!(sys::remove_all(&tmpdir).is_ok());

pub fn update(&self) -> Result<(), Error>[src]

Update the given repos emitting terminal progress. Clones the entire repo if necessary.

Examples

use skellige::prelude::*;

let tmpdir = PathBuf::from("tests/temp").abs().unwrap().mash("git_repo_update_many_doc");
assert!(sys::remove_all(&tmpdir).is_ok());
let repo1 = tmpdir.mash("repo1");
let repo2 = tmpdir.mash("repo2");
let repo1file = repo1.mash("README.md");
let repo2file = repo2.mash("README.md");
assert!(sys::mkdir(&tmpdir).is_ok());
let repos = git::RepoGroup::new()
    .with_progress(true)
    .add(git::Repo::new(&repo1).unwrap().url("https://github.com/phR0ze/alpine-base"))
    .add(git::Repo::new(&repo2).unwrap().url("https://github.com/phR0ze/alpine-core"));
assert!(repos.update().is_ok());
assert_eq!(repo1file.exists(), true);
assert_eq!(repo2file.exists(), true);
assert!(sys::remove_all(&tmpdir).is_ok());

Trait Implementations

impl<'a> Default for RepoGroup<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for RepoGroup<'a>[src]

impl<'a> !Send for RepoGroup<'a>[src]

impl<'a> !Sync for RepoGroup<'a>[src]

impl<'a> Unpin for RepoGroup<'a>[src]

impl<'a> !UnwindSafe for RepoGroup<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.