https://github.com/rk0cc/dart_repourl
Alternative Uri object of representing repository URL in Git
https://github.com/rk0cc/dart_repourl
dart git http https parser repository repository-url rsync ssh uri url
Last synced: about 1 year ago
JSON representation
Alternative Uri object of representing repository URL in Git
- Host: GitHub
- URL: https://github.com/rk0cc/dart_repourl
- Owner: rk0cc
- License: bsd-3-clause
- Created: 2023-05-22T16:08:41.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-04T13:33:06.000Z (almost 3 years ago)
- Last Synced: 2025-01-17T01:08:51.070Z (about 1 year ago)
- Topics: dart, git, http, https, parser, repository, repository-url, rsync, ssh, uri, url
- Language: Dart
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Alternative `Uri` object for handling Git repository URL format
There are various format of URL can be applied for fetching Git repository.
However, not every format can be simply handled by `Uri.parse` in Dart.
For example, it is possible to parse `https://git-example.com/alice/sample_text.git`
but not `git@git-example.com:alice/sample_text.git`.
```dart
// That works
final Uri httpsGit = Uri.parse("https://git-example.com/alice/sample_text.git");
// FormatException
final Uri altSsh = Uri.parse("git@git-example.com:alice/sample_text.git");
```
As a result, `RepositoryUrl` should be used rather than `Uri` which able to resolve URL that `Uri.parse` can't:
```dart
// Both worked
final RepositoryUrl httpRepo = RepositoryUrl("https://git-example.com/alice/sample_text.git");
final RepositoryUrl altSshRepo = RepositoryUrl("git@git-example.com:alice/sample_text.git");
```
More usage can be found in [example](example/main.dart);
## License
BSD-3