Created
June 20, 2015 00:36
-
-
Save pdehaan/32efce19780bc6beb089 to your computer and use it in GitHub Desktop.
Grab a JSON manifest from a remote GitHub URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovy.json.JsonSlurper | |
| Map getJson(String project) { | |
| String repoUrl = "https://raw.githubusercontent.com/mozilla-services/services-test/master/e2e/${project}/package.json".toString() | |
| JsonSlurper jsonSlurper = new JsonSlurper() | |
| return jsonSlurper.parse(repoUrl.toURL()) | |
| } | |
| Map datum = getJson('pocket') | |
| println datum.name + '@' + datum.version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment