projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
✅ Add test for parser to be injectable
[Sone.git]
/
src
/
main
/
kotlin
/
net
/
pterodactylus
/
sone
/
text
/
SoneTextParser.kt
diff --git
a/src/main/kotlin/net/pterodactylus/sone/text/SoneTextParser.kt
b/src/main/kotlin/net/pterodactylus/sone/text/SoneTextParser.kt
index
690ce6d
..
3cd6587
100644
(file)
--- a/
src/main/kotlin/net/pterodactylus/sone/text/SoneTextParser.kt
+++ b/
src/main/kotlin/net/pterodactylus/sone/text/SoneTextParser.kt
@@
-17,11
+17,12
@@
import net.pterodactylus.sone.text.LinkType.SSK
import net.pterodactylus.sone.text.LinkType.USK
import org.bitpedia.util.Base32
import java.net.MalformedURLException
import net.pterodactylus.sone.text.LinkType.USK
import org.bitpedia.util.Base32
import java.net.MalformedURLException
+import javax.inject.*
/**
* [Parser] implementation that can recognize Freenet URIs.
*/
/**
* [Parser] implementation that can recognize Freenet URIs.
*/
-class SoneTextParser(private val soneProvider: SoneProvider?, private val postProvider: PostProvider?) {
+class SoneTextParser
@Inject constructor
(private val soneProvider: SoneProvider?, private val postProvider: PostProvider?) {
fun parse(source: String, context: SoneTextParserContext?) =
source.split("\n")
fun parse(source: String, context: SoneTextParserContext?) =
source.split("\n")