Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Karasiq committed Sep 9, 2017
1 parent f681c1b commit b2f8c4c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val commonSettings = Seq(
organization := "com.github.karasiq",
isSnapshot := false,
version := "1.0.6",
scalaVersion := "2.11.11"
scalaVersion := "2.11.8"
)

lazy val publishSettings = Seq(
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 0.13.9
sbt.version = 0.13.16
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6")

addSbtPlugin("com.github.karasiq" % "sbt-scalajs-bundler" % "1.0.7")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.20")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")

Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/com/karasiq/torrentstream/app/AppHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import com.karasiq.torrentstream.TorrentStream
import com.karasiq.torrentstream.app.AppSerializers.StringConversions

private[app] class AppHandler(torrentManager: ActorRef, store: TorrentStore)
(implicit actorSystem: ActorSystem, actorMaterializer: ActorMaterializer)
extends AppSerializers.Marshallers {
(implicit actorSystem: ActorSystem, actorMaterializer: ActorMaterializer) {

import AppSerializers.Marshallers._

// -----------------------------------------------------------------------
// Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ private[app] object AppSerializers {
}
}

trait Marshallers {
object Marshallers {
implicit def binaryMarshaller[A, B](implicit ev: Pickler[A], m: Marshaller[ByteString, B]): Marshaller[A, B] = {
Marshaller(implicit ec value m(ByteString(Pickle.intoBytes(value))))
}
}

trait Picklers {
object Picklers {
implicit val byteStringPickler: Pickler[ByteString] = new Pickler[ByteString] {
override def pickle(obj: ByteString)(implicit state: PickleState): Unit = {
state.enc.writeByteArray(obj.toArray)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import com.karasiq.bittorrent.format.Torrent
import com.karasiq.mapdb.{MapDbSingleFileProducer, MapDbWrapper}
import com.karasiq.torrentstream.shared.TorrentInfo

final class TorrentStore(config: Config) extends mutable.Map[ByteString, Torrent] with Closeable with AppSerializers.Picklers {
final class TorrentStore(config: Config) extends mutable.Map[ByteString, Torrent] with Closeable {
import AppSerializers.Picklers._

private object DbProvider extends MapDbSingleFileProducer(Paths.get(config.getString("karasiq.torrentstream.store.path"))) {
override protected def setSettings(dbMaker: Maker): Maker = {
dbMaker
Expand Down

0 comments on commit b2f8c4c

Please sign in to comment.