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 +]