Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ktor-http Dependency from ksoup-core by Implementing String.resolveOrNull in Pure Kotlin #73

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.fleeksoft.ksoup.io.FileSource
import com.fleeksoft.ksoup.io.SourceReader

interface KsoupEngine {
fun urlResolveOrNull(base: String, relUrl: String): String?

fun openSourceReader(content: String, charset: Charset? = null): SourceReader

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ package com.fleeksoft.ksoup.engine

import com.fleeksoft.ksoup.io.*
import korlibs.io.lang.Charsets
import korlibs.io.net.URL

object KsoupEngineImpl : KsoupEngine {
override fun urlResolveOrNull(base: String, relUrl: String): String? {
return URL.resolveOrNull(base = base, access = relUrl)
}

override fun openSourceReader(content: String, charset: Charset?): SourceReader {
return SourceReader.from(charset?.toByteArray(content) ?: content.encodeToByteArray())
Expand Down
3 changes: 1 addition & 2 deletions ksoup-engine-kotlinx/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ aliases:
dependencies:
- ../ksoup-engine-common
- $libs.kotlinx.io: exported
- $libs.ktor.io
- $libs.ktor.http
- $libs.ktor.io
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import io.ktor.utils.io.charsets.*

object KsoupEngineImpl : KsoupEngine {

override fun urlResolveOrNull(base: String, relUrl: String): String? {
return URLUtil.urlResolveOrNull(base = base, relUrl = relUrl)
}

override fun openSourceReader(content: String, charset: Charset?): SourceReader {
return SourceReader.from(charset?.toByteArray(content) ?: content.encodeToByteArray())
}
Expand Down
153 changes: 0 additions & 153 deletions ksoup-engine-kotlinx/src/com/fleeksoft/ksoup/engine/URLUtil.kt

This file was deleted.

3 changes: 1 addition & 2 deletions ksoup-engine-ktor2/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ aliases:
dependencies:
- ../ksoup-engine-common
- $libs.kotlinx.io: exported
- $libs.ktor2.io
- $libs.ktor2.http
- $libs.ktor2.io
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import io.ktor.utils.io.charsets.*

object KsoupEngineImpl : KsoupEngine {

override fun urlResolveOrNull(base: String, relUrl: String): String? {
return URLUtil.urlResolveOrNull(base = base, relUrl = relUrl)
}

override fun openSourceReader(content: String, charset: Charset?): SourceReader {
return SourceReader.from(charset?.toByteArray(content) ?: content.encodeToByteArray())
}
Expand Down
153 changes: 0 additions & 153 deletions ksoup-engine-ktor2/src/com/fleeksoft/ksoup/engine/URLUtil.kt

This file was deleted.

1 change: 0 additions & 1 deletion ksoup-engine-okio/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- ../ksoup-engine-common
- $libs.okio: exported
- $libs.ktor2.io
- $libs.ktor2.http

dependencies@js:
- $libs.okio.nodefilesystem
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import io.ktor.utils.io.charsets.*

object KsoupEngineImpl : KsoupEngine {

override fun urlResolveOrNull(base: String, relUrl: String): String? {
return URLUtil.urlResolveOrNull(base = base, relUrl = relUrl)
}

override fun openSourceReader(content: String, charset: Charset?): SourceReader {
return SourceReader.from(charset?.toByteArray(content) ?: content.encodeToByteArray())
}
Expand Down
Loading
Loading