Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 47 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ chrono = "0.4.40"
hex = "0.4.3"
iri-string = "0.7.8"
log = { version = "0.4.26", features = ["kv"] }
pgxn_meta = "0.5.2"
owo-colors = "4.2.0"
pgxn_meta = "0.6.0"
regex = "1.11.1"
semver = "1.0.26"
serde = "1.0.219"
serde_json = "1.0.140"
supports-color = "3.0.2"
tempfile = "3.19.1"
thiserror = "2.0.12"
ureq = { version = "3.0.10", features = ["json"] }
Expand Down
90 changes: 90 additions & 0 deletions corpus/dist/api/0.1.2/META.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"abstract": "A key/value pair data type (with added fields from api.pgxn.org)",
"date": "2011-04-20T23:47:22Z",
"description": "This library contains a single PostgreSQL extension, a key/value pair data type called “pair”, along with a convenience function for constructing key/value pairs.",
"docs": {
"README": {
"title": "pair 0.1.2"
},
"doc/pair": {
"abstract": "A key/value pair data type",
"title": "pair 0.1.2"
}
},
"license": "postgresql",
"maintainer": ["David E. Wheeler <david@justatheory.com>"],
"name": "pair",
"provides": {
"pair": {
"abstract": "A key/value pair data type",
"docfile": "doc/pair.md",
"docpath": "doc/pair",
"file": "sql/pair.sql",
"version": "0.1.2"
}
},
"release_status": "stable",
"releases": {
"stable": [
{
"date": "2020-10-25T21:54:02Z",
"version": "0.1.7"
},
{
"date": "2018-11-10T20:55:55Z",
"version": "0.1.6"
},
{
"date": "2011-11-11T17:56:30Z",
"version": "0.1.5"
},
{
"date": "2011-11-11T06:52:41Z",
"version": "0.1.4"
},
{
"date": "2011-05-12T18:55:30Z",
"version": "0.1.3"
},
{
"date": "2011-04-20T23:47:22Z",
"version": "0.1.2"
},
{
"date": "2010-10-29T22:44:42Z",
"version": "0.1.1"
},
{
"date": "2010-10-19T03:59:54Z",
"version": "0.1.0"
}
]
},
"resources": {
"bugtracker": {
"web": "http://github.com/theory/kv-pair/issues/"
},
"repository": {
"type": "git",
"url": "git://github.com/theory/kv-pair.git",
"web": "http://github.com/theory/kv-pair/"
}
},
"sha1": "9988d7adb056b11f8576db44cca30f88a08bd652",
"special_files": [
"Changes",
"README.md",
"META.json",
"Makefile",
"pair.control"
],
"tags": [
"variadic function",
"ordered pair",
"pair",
"key value",
"key value pair"
],
"user": "theory",
"version": "0.1.2"
}
6 changes: 6 additions & 0 deletions mocks/emit.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Print to STDOUT and STDERR.
fn main() {
let args: Vec<String> = std::env::args().skip(1).collect();
println!("{}", &args[0]);
eprintln!("{}", &args[1]);
}
5 changes: 5 additions & 0 deletions src/api/dist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! [Dist API]: https://github.com/pgxn/pgxn-api/wiki/dist-api

use chrono::{DateTime, Utc};
use log::{debug, info};
use semver::Version;
use serde::{Deserialize, Serialize};
use std::{borrow::Borrow, io};
Expand Down Expand Up @@ -89,13 +90,17 @@ impl Dist {
/// returns the latest unstable versions. Returns an error if there are no
/// versions at all.
pub fn best_version(&self) -> Result<&Version, BuildError> {
debug!(of = self.name(); "Determining best version");
if let Some(v) = self.latest_stable_version() {
info!(of=self.name(), v:display; "Best version");
return Ok(v);
}
if let Some(v) = self.latest_testing_version() {
info!(of=self.name(), v:display; "Best version");
return Ok(v);
}
if let Some(v) = self.latest_unstable_version() {
info!(of=self.name(), v:display; "Best version");
return Ok(v);
}

Expand Down
Loading
Loading