Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/turbo87/hosted-git-info-rs
Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab
https://github.com/turbo87/hosted-git-info-rs
bitbucket git github gitlab
Last synced: about 2 months ago
JSON representation
Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab
- Host: GitHub
- URL: https://github.com/turbo87/hosted-git-info-rs
- Owner: Turbo87
- License: isc
- Created: 2021-08-07T22:45:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-04T14:07:24.000Z (about 3 years ago)
- Last Synced: 2024-10-27T10:06:53.173Z (about 2 months ago)
- Topics: bitbucket, git, github, gitlab
- Language: JavaScript
- Homepage: https://crates.io/crates/hosted-git-info
- Size: 524 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
hosted-git-info
==============================================================================Provides metadata and conversions from repository urls for [GitHub], [Bitbucket]
and [GitLab].[GitHub]: https://github.com/
[Bitbucket]: https://www.bitbucket.org/
[GitLab]: https://www.gitlab.com/__This is a [Rust] port of the original [hosted-git-info] project on [npm].__
[Rust]: https://www.rustlang.org/
[hosted-git-info]: https://github.com/npm/hosted-git-info
[npm]: https://www.npmjs.com> 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
------------------------------------------------------------------------------```rust
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](LICENSE) or
).