summaryrefslogtreecommitdiff
path: root/scalalib/test/resources/hello-world/core/src/Main.scala
blob: 32706d4470ae41c0515ebf546cdd2237eb712972 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import scala.collection._
import java.nio.file.{Files, Paths}

import Main.{args, greeting}
object Main0{
  def apply(s: String, greeting: String) = {
    val resultPath = Paths.get(s)
    Files.createDirectories(resultPath.getParent)
    Files.write(resultPath, greeting.getBytes)
  }
}
object Main extends App {

  val person = Person.fromString("rockjam:25")
  val greeting = s"hello ${person.name}, your age is: ${person.age}"
  println(greeting)
  Main0(args(0), greeting)
}