Skip to content

Instantly share code, notes, and snippets.

@chiquitinxx
Created January 6, 2015 22:28
Show Gist options
  • Save chiquitinxx/94bbc82cb6652a4b19a2 to your computer and use it in GitHub Desktop.
Save chiquitinxx/94bbc82cb6652a4b19a2 to your computer and use it in GitHub Desktop.
Show 10 latest gradle plugins published in repository
@GrabConfig(systemClassLoader=true)
@Grab('org.grooscript:grooscript:1.0.0-rc-1')
import org.grooscript.asts.PhantomJsTest
//Where you have phantom js, in my case 'which phantomjs' is '/usr/local/bin/phantomjs'
System.setProperty('PHANTOMJS_HOME', '/usr/local')
@PhantomJsTest(url = 'http://plugins.gradle.org')
void getLatestPlugins() {
assert $('body h1').text() == 'Search Gradle Plugins'
$('td.name h3').toArray().inject([]) { acc, value ->
acc << $(value).text()
}
}
latestPlugins.
collect { it.toUpperCase() }.
each { println it.center(40, '*') }
/* Running this script:
***********DE.GESELLIX.DOCKER***********
********FI.JASOFT.PLUGIN.VAADIN*********
********NET.NEMEROSA.VERSIONING*********
***ORG.ASCIIDOCTOR.GRADLE.ASCIIDOCTOR***
********ORG.ASCIIDOCTOR.CONVERT*********
************AT.BXM.SVNTOOLS*************
************ORG.HIDETAKE.SSH************
**********NET.ALCHIM31.GETDOWN**********
***********COM.DATAMAIO.SCD4J***********
*******COM.GITHUB.KT3K.COVERALLS********
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment