Crates.io | gitfrog |
lib.rs | gitfrog |
version | 0.1.3 |
source | src |
created_at | 2024-03-19 17:03:29.308381 |
updated_at | 2024-04-27 14:31:41.024179 |
description | Get current info about PRs and issues |
homepage | |
repository | https://github.com/mrtnvgr/gitfrog |
max_upload_size | |
id | 1179478 |
size | 51,312 |
Get current info about PRs and issues
use gitfrog::Info;
let url = Url::parse("https://github.com/catppuccin/nvim/pull/8").unwrap();
let info = Info::from_url(&url).await.unwrap();
assert_eq!(info.title, "Add Kitty themes");
assert_eq!(info.state, State::Closed);
assert_eq!(info.state.is_open(), false);
[!NOTE] Feel free to file an issue about missing forges. Contributions are welcome too!
use gitfrog::Host;
let url = Url::parse("https://gitlab.freedesktop.org/wayland/wayland/-/issues/369").unwrap();
let domain = url.domain().unwrap();
let info = Host::Gitlab(domain).get(&url).await.unwrap();
assert_eq!(info.title, "libwayland-server.so.0.21.0 ends in segfault and then somehow shuts down my system.");
assert_eq!(info.state, State::Closed);
assert_eq!(info.state.is_open(), false);
let wrapper = |x| Url::parse(&format!("https://github.com/catppuccin/nvim/pull/{x}")).unwrap();
let urls: Vec<Url> = vec![110, 143, 1].iter().map(wrapper).collect();
let info = Info::from_urls(&urls).await;
assert_eq!(info[0].as_ref().unwrap().title, "fix: typo");
assert_eq!(info[1].as_ref().unwrap().title, "fix: #103");
assert_eq!(info[2].is_err(), true);