This commit is contained in:
Erik C. Thauvin 2019-09-20 20:39:33 -07:00
parent 9993309a0f
commit ca4c87b3cf
4 changed files with 8 additions and 11 deletions

View file

@ -1,5 +1,5 @@
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
import org.jetbrains.dokka.gradle.LinkMapping
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileInputStream
import java.util.Properties
@ -141,14 +141,14 @@ tasks {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
jdkVersion = 8
val mapping = LinkMapping().apply {
linkMapping {
dir = "src/main/kotlin"
url = "https://github.com/ethauvin/${project.name}/blob/${project.version}/src/main/kotlin"
url = "https://github.com/ethauvin/akismet-kotlin/blob/master/src/main/kotlin"
suffix = "#L"
}
includes = listOf("config/dokka/packages.md")
linkMappings = arrayListOf(mapping)
includeNonPublic = false
}

View file

@ -23,6 +23,5 @@ tasks {
group = "application"
main = "com.example.AkismetSample"
classpath = sourceSets["main"].runtimeClasspath
}
}

View file

@ -182,13 +182,12 @@ open class Akismet(apiKey: String) {
* Submit Ham.
* See the [Akismet API](https://akismet.com/development/api/#submit-ham) for more details.
*/
fun submitHam(comment: AkismetComment): Boolean {
return executeMethod(buildApiUrl("submit-ham"), buildFormBody(comment))
}
/**
* Convert a [Date][java.util.Date] to a UTC timestamp for use with [dateGmt][AkismetComment.dateGmt], etc.
* Convert a date to a UTC timestamp.
*/
fun dateToGmt(date: Date): String {
return DateTimeFormatter.ISO_DATE_TIME.format(
@ -196,8 +195,7 @@ open class Akismet(apiKey: String) {
}
/**
* Convert a [LocalDateTime][java.time.LocalDateTime] to a UTC timestamp for use with
* [dateGmt][AkismetComment.dateGmt], etc.
* Convert a locale date/time to a UTC timestamp.
*/
fun dateToGmt(date: LocalDateTime): String {
return DateTimeFormatter.ISO_DATE_TIME.format(
@ -291,7 +289,7 @@ open class Akismet(apiKey: String) {
add("user_role", comment.userRole)
}
if (comment.isTest) {
add("is_test", "true")
add("is_test", "1")
}
if (comment.recheckReason.isNotBlank()) {
add("recheck_reason", comment.recheckReason)

View file

@ -128,7 +128,7 @@ open class AkismetComment() {
* Akismet.
*
* How the submitted content interacts with the server can be very telling, so please include as much of it as
* ossible.
* possible.
*/
var other: Map<String, String> = emptyMap()