From 9fa2bfea24808b6c8ba9db21c3bd15f4149559c3 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 5 May 2019 19:36:04 +0100 Subject: [PATCH] [S3Thorp] Extract class --- src/main/scala/net/kemitix/s3thorp/Main.scala | 2 +- src/main/scala/net/kemitix/s3thorp/S3Thorp.scala | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/main/scala/net/kemitix/s3thorp/S3Thorp.scala diff --git a/src/main/scala/net/kemitix/s3thorp/Main.scala b/src/main/scala/net/kemitix/s3thorp/Main.scala index e7fedd4..4057f39 100644 --- a/src/main/scala/net/kemitix/s3thorp/Main.scala +++ b/src/main/scala/net/kemitix/s3thorp/Main.scala @@ -8,7 +8,7 @@ object Main extends IOApp { override def run(args: List[String]): IO[ExitCode] = (for { - ec <- IO(println("S3Thorp - hashed sync for s3")).as(ExitCode.Success) + ec <- S3Thorp(args).as(ExitCode.Success) } yield ec).guaranteeCase { case Canceled => IO(println("Interrupted")) case Error(e) => IO(println("ERROR: " + e)) diff --git a/src/main/scala/net/kemitix/s3thorp/S3Thorp.scala b/src/main/scala/net/kemitix/s3thorp/S3Thorp.scala new file mode 100644 index 0000000..91bc2a5 --- /dev/null +++ b/src/main/scala/net/kemitix/s3thorp/S3Thorp.scala @@ -0,0 +1,15 @@ +package net.kemitix.s3thorp + +import cats.effect.IO + +object S3Thorp { + + def putStrLn(value: String): IO[Unit] = IO(println(value)) + + def apply(args: List[String]): IO[Unit] = { + for { + _ <- putStrLn("S3Thorp - hashed sync for s3") + } yield () + } + +}