gistcafe

gist.cafe utils for Kotlin

Лицензия

Лицензия

Категории

Категории

Сеть
Группа

Группа

net.servicestack
Идентификатор

Идентификатор

gistcafe
Последняя версия

Последняя версия

0.0.7
Дата

Дата

Тип

Тип

jar
Описание

Описание

gistcafe
gist.cafe utils for Kotlin
Ссылка на сайт

Ссылка на сайт

https://github.com/maven
Система контроля версий

Система контроля версий

https://github.com/ServiceStack/gistcafe-kotlin

Скачать gistcafe

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.servicestack/gistcafe/ -->
<dependency>
    <groupId>net.servicestack</groupId>
    <artifactId>gistcafe</artifactId>
    <version>0.0.7</version>
</dependency>
// https://jarcasting.com/artifacts/net.servicestack/gistcafe/
implementation 'net.servicestack:gistcafe:0.0.7'
// https://jarcasting.com/artifacts/net.servicestack/gistcafe/
implementation ("net.servicestack:gistcafe:0.0.7")
'net.servicestack:gistcafe:jar:0.0.7'
<dependency org="net.servicestack" name="gistcafe" rev="0.0.7">
  <artifact name="gistcafe" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.servicestack', module='gistcafe', version='0.0.7')
)
libraryDependencies += "net.servicestack" % "gistcafe" % "0.0.7"
[net.servicestack/gistcafe "0.0.7"]

Зависимости

runtime (2)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.21
com.google.code.gson : gson jar 2.8.6

test (2)

Идентификатор библиотеки Тип Версия
org.junit : junit-bom jar 5.7.0
org.junit.jupiter : junit-jupiter jar

Модули Проекта

Данный проект не имеет модулей.

Useful utils for gist.cafe Kotlin Apps.

Usage

Simple usage example:

import com.google.gson.Gson
import com.google.gson.annotations.SerializedName
import java.net.URL
import net.servicestack.gistcafe.*

data class GithubRepo(
    val name: String,
    val description: String = "",
    val homepage: String = "",
    @SerializedName("language") val lang: String = "",
    val watchers: Int,
    val forks: Int)

fun main(args: Array<String>) {
    val orgName = "Kotlin"

    val json = URL("https://api.github.com/orgs/$orgName/repos").readText()
    val orgRepos = Gson().fromJson<List<GithubRepo>>(json)
        .sortedByDescending { it.watchers }

    println("Top 3 $orgName GitHub Repos:")
    Inspect.printDump(orgRepos.take(3))

    println("\nTop 10 $orgName GitHub Repos:")
    Inspect.printDumpTable(orgRepos.take(10), listOf("name","language","watchers","forks"))

    Inspect.vars(mapOf("orgRepos" to orgRepos))
}

Which outputs:

Top 3 Kotlin GitHub Repos:
[
  {
    name: anko,
    description: Pleasant Android application development,
    homepage: ,
    language: Kotlin,
    watchers: 15892,
    forks: 1281
  },
  {
    name: kotlinx.coroutines,
    description: Library support for Kotlin coroutines ,
    homepage: ,
    language: Kotlin,
    watchers: 8684,
    forks: 1228
  },
  {
    name: kotlin-examples,
    description: Various examples for Kotlin,
    language: Kotlin,
    watchers: 2892,
    forks: 1056
  }
]

Top 10 Kotlin GitHub Repos:
+--------------------------------------------------------+
|          name           | language | watchers | forks  |
|--------------------------------------------------------|
| anko                    | Kotlin   |    15892 |   1281 |
| kotlinx.coroutines      | Kotlin   |     8684 |   1228 |
| kotlin-examples         | Kotlin   |     2892 |   1056 |
| kotlinx.serialization   | Kotlin   |     2697 |    287 |
| kotlin-koans            | Kotlin   |     2559 |   1504 |
| KEEP                    |          |     1953 |    215 |
| dokka                   | Kotlin   |     1839 |    194 |
| coroutines-examples     |          |     1259 |    149 |
| kotlin-fullstack-sample | Kotlin   |     1185 |    165 |
| kotlinx.html            | Kotlin   |     1074 |     97 |
+--------------------------------------------------------+

Features and bugs

Please file feature requests and bugs at the issue tracker.

net.servicestack

ServiceStack

Версии библиотеки

Версия
0.0.7
0.0.6
0.0.5
0.0.4
0.0.2