๐Ÿ“ฆ Turbo87 / hosted-git-info-rs

Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab

โ˜… 8 stars โ‘‚ 1 forks ๐Ÿ‘ 8 watching โš–๏ธ ISC License
bitbucketgitgithubgitlab
๐Ÿ“ฅ Clone https://github.com/Turbo87/hosted-git-info-rs.git
HTTPS git clone https://github.com/Turbo87/hosted-git-info-rs.git
SSH git clone git@github.com:Turbo87/hosted-git-info-rs.git
CLI gh repo clone Turbo87/hosted-git-info-rs
Tobias Bieniek Tobias Bieniek Merge pull request #16 from Turbo87/msrv fbf2394 4 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ src
๐Ÿ“ test
๐Ÿ“ tests
๐Ÿ“„ .gitignore
๐Ÿ“„ .npmignore
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ CHANGELOG.md
๐Ÿ“„ git-host-info.js
๐Ÿ“„ git-host.js
๐Ÿ“„ index.js
๐Ÿ“„ LICENSE
๐Ÿ“„ package-lock.json
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ README.md

hosted-git-info ==============================================================================

Provides metadata and conversions from repository urls for [GitHub], [Bitbucket] and [GitLab].

This is a [Rust] port of the original [hosted-git-info] project on [npm].

This will let you identify and transform various git hosts URLs between
protocols. It also can tell you what the URL is for the raw path for
particular file for direct access without git.

Usage


use hosted_git_info::HostedGitInfo;

fn main() {
    let url = "https://github.com/foo/bar.git#branch";
    let info = HostedGitInfo::from_url(url).unwrap();
    assert_eq!(info.provider, Provider::GitHub);
    assert_eq!(info.user, Some("foo"));
    assert_eq!(info.project, "bar");
    assert_eq!(info.committish, Some("branch"));
}

MSRV


The "Minimum Supported Rust Version" of this project is: v1.46.0

Related


  • [hosted-git-info] โ€“ The original library for JavaScript

License


This project is licensed under the ISC license (LICENSE or ).