New multi platform external binary for YAML to /fromJSON conversions.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-03-12 14:48:53 -05:00
parent 4b75042fab
commit ad8e0f445f

25
src/MiniDocs/YQ.class.st Normal file
View File

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