clean code
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package fr.postgresjson.definition
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
|
||||
class Function(
|
||||
@@ -70,21 +69,4 @@ class Function(
|
||||
infix fun `is different from`(other: Function): Boolean {
|
||||
return other.script != this.script
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun build(source: File): List<Function> {
|
||||
return source.readText()
|
||||
.split(
|
||||
"CREATE +(OR REPLACE +)?(PROCEDURE|FUNCTION)".toRegex(
|
||||
setOf(
|
||||
RegexOption.IGNORE_CASE,
|
||||
RegexOption.MULTILINE
|
||||
)
|
||||
)
|
||||
)
|
||||
.map {
|
||||
Function("CREATE OR REPLACE FUNCTION $it")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user