mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2024-11-22 03:04:54 +08:00
bump resource-tools to 0.3.1
This commit is contained in:
parent
597e87f5fe
commit
46519138e1
@ -18,7 +18,7 @@ lib_spotbugs_v = 4.8.4
|
||||
lib_scalamodule_xml_v = 2.2.0
|
||||
|
||||
lib_messiva_v = 0.2.0
|
||||
lib_resourcetools_v = 0.2.2
|
||||
lib_resourcetools_v = 0.3.1
|
||||
lib_slf4j_v = 2.0.13
|
||||
|
||||
lib_javatelegramapi_v = 6.9.1
|
||||
|
@ -5,7 +5,7 @@ import java.io.IOException
|
||||
object MornyAbout {
|
||||
|
||||
val MORNY_PREVIEW_IMAGE_ASCII: String =
|
||||
try { MornyAssets.pack getResource "texts/server-hello.txt" readAsString }
|
||||
try { MornyAssets.pack getFile "texts/server-hello.txt" readString }
|
||||
catch case e: IOException =>
|
||||
throw RuntimeException("Cannot read MORNY_PREVIEW_IMAGE_ASCII from assets pack", e)
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package cc.sukazyo.cono.morny
|
||||
|
||||
import cc.sukazyo.restools.ResourcesPackage
|
||||
import cc.sukazyo.restools.{ResourceDirectory, ResourcePackage}
|
||||
|
||||
object MornyAssets {
|
||||
|
||||
class AssetsException (caused: Throwable) extends Exception("Cannot read assets file.", caused)
|
||||
|
||||
val pack: ResourcesPackage = ResourcesPackage(MornyAssets.getClass, "assets_morny")
|
||||
val pack: ResourceDirectory = ResourcePackage.get("assets_morny").getDirectory("assets_morny")
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ object TelegramImages {
|
||||
|
||||
@throws[AssetsException]
|
||||
private def read (): Unit = {
|
||||
Using ((MornyAssets.pack getResource assetsPath)read) { stream =>
|
||||
Using (MornyAssets.pack getFile assetsPath read) { stream =>
|
||||
try { this.cache = Some(stream.readAllBytes()) }
|
||||
catch case e: IOException => {
|
||||
throw AssetsException(e)
|
||||
|
@ -1,13 +1,13 @@
|
||||
package cc.sukazyo.cono.morny.test
|
||||
|
||||
import cc.sukazyo.restools.ResourcesPackage
|
||||
import cc.sukazyo.restools.{ResourceDirectory, ResourcePackage}
|
||||
import org.scalatest.freespec.AnyFreeSpec
|
||||
import org.scalatest.matchers.should
|
||||
|
||||
abstract class MornyTests extends AnyFreeSpec with should.Matchers {
|
||||
|
||||
val assets: ResourcesPackage =
|
||||
ResourcesPackage(classOf[MornyTests], "assets_morny_tests")
|
||||
val assets: ResourceDirectory =
|
||||
ResourcePackage.get("assets_morny_tests").getDirectory("assets_morny_tests")
|
||||
|
||||
val pending_val = "[not-implemented]"
|
||||
|
||||
|
@ -83,7 +83,7 @@ class CommonEncryptTest extends MornyTests with TableDrivenPropertyChecks {
|
||||
if file == null then
|
||||
Array.empty[Byte]
|
||||
else
|
||||
assets.getResource(file).read.readAllBytes
|
||||
assets.getFile(file).read.readAllBytes
|
||||
|
||||
s"while hashing binary $_name :" - {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user