From ad8e0f445f1485ce29e8d3f50cde9e04fb26893e Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 12 Mar 2023 14:48:53 -0500 Subject: [PATCH] New multi platform external binary for YAML to /fromJSON conversions. --- src/MiniDocs/YQ.class.st | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/MiniDocs/YQ.class.st diff --git a/src/MiniDocs/YQ.class.st b/src/MiniDocs/YQ.class.st new file mode 100644 index 0000000..5248d46 --- /dev/null +++ b/src/MiniDocs/YQ.class.st @@ -0,0 +1,25 @@ +Class { + #name : #YQ, + #superclass : #Object, + #category : #MiniDocs +} + +{ #category : #accessing } +YQ class >> binaryDownloadLinkFor: operativeSystem on: processor [ + | binaryName binaryDownloadData | + binaryName := 'yq_', operativeSystem , '_', processor. + binaryDownloadData := ((self lastReleaseData at: 'assets') + select: [:each | (each at: 'name') beginsWith: binaryName ]) first. + ^ binaryDownloadData at: 'browser_download_url' +] + +{ #category : #accessing } +YQ class >> install [ + ^ self lastReleaseData +] + +{ #category : #accessing } +YQ class >> lastReleaseData [ + ^ (STONJSON + fromString: 'https://api.github.com/repos/mikefarah/yq/releases' asUrl retrieveContents) first +]