mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-10-26 16:16:16 +01:00
16 lines
417 B
Scala
16 lines
417 B
Scala
import com.eclipsesource.json.Json
|
|
import scala.collection.JavaConverters._
|
|
|
|
object PluginsJson {
|
|
|
|
def getUrls(json: String): Seq[String] = {
|
|
val value = Json.parse(json)
|
|
value.asArray.values.asScala.map { plugin =>
|
|
val pluginObject = plugin.asObject
|
|
val latestVersionObject = pluginObject.get("versions").asArray.asScala.head.asObject
|
|
latestVersionObject.get("url").asString
|
|
}
|
|
}
|
|
|
|
}
|