$ echo 'scalaVersion := "2.10.0-M7"' > build.sbt
$ sbt console
[info] Set current project to default-e9c0f6 (in build file:/Users/seratch/tmp/scala_2.10/)
Getting Scala 2.10.0-M7 ...
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.0-M7/scala-compiler-2.10.0-M7.jar ...
[SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.0-M7!scala-compiler.jar (2113ms)
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.0-M7/scala-library-2.10.0-M7.jar ...
[SUCCESSFUL ] org.scala-lang#scala-library;2.10.0-M7!scala-library.jar (2921ms)
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.0-M7/scala-reflect-2.10.0-M7.jar ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scala> case class SQLInterpolationResult[P](strings: Seq[String], param: P) | |
| defined class SQLInterpolationResult | |
| scala> class SQLInterpolation(val s: StringContext) extends AnyVal { | |
| | def sql[P](param: P) = new SQLInterpolationResult(s.parts, param) | |
| | } | |
| defined class SQLInterpolation | |
| scala> @inline implicit def interpolation(s: StringContext) = new SQLInterpolation(s) | |
| warning: there were 1 feature warnings; re-run with -feature for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source "http://rubygems.org/" | |
| gem 'scaruby' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.net.URLDecoder | |
| import java.io.File | |
| import org.keyczar.Crypter | |
| case class KeyczarService(keypath: String) { | |
| lazy val keyLocation = URLDecoder.decode( | |
| new File(classOf[KeyczarService].getClassLoader.getResource(keypath).getFile).getAbsolutePath, | |
| "UTF-8" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.scalatra.ScalatraKernel | |
| import org.thymeleaf.templateresolver._ | |
| import org.thymeleaf.TemplateEngine | |
| import org.thymeleaf.context.WebContext | |
| trait ThymeleafSupport { | |
| self: ScalatraKernel => | |
| lazy val thymeleafResolver: TemplateResolver = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo[A, B <: Option[A]] { | |
| @annotation.implicitNotFound(msg = "Should be Some!") | |
| sealed abstract class =:=[From, To] extends (From => To) with Serializable | |
| private[this] final val singleton_=:= = new =:=[Any,Any] { def apply(x: Any): Any = x } | |
| object =:= { | |
| implicit def tpEquals[A]: A =:= A = singleton_=:=.asInstanceOf[A =:= A] | |
| } | |
| type This = Foo[A, B] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| libraryDependencies ++= Seq( | |
| "com.github.seratch" %% "scalikejdbc" % "1.3.0", | |
| "org.slf4j" % "slf4j-simple" % "1.6.4", | |
| "com.h2database" % "h2" % "[1.3,)" | |
| ) | |
| initialCommands := """import scalikejdbc._ | |
| |Class.forName("org.h2.Driver") | |
| |ConnectionPool.singleton("jdbc:h2:mem:tmp", "", "") | |
| |implicit val session = DB.autoCommitSession |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import util.control.Exception._ | |
| def using[R <: { def close() }, A](resource: R)(f: R => A): A = ultimately { | |
| ignoring(classOf[Throwable]) apply resource.close() | |
| } apply f(resource) | |
| case class Sepal(length: Double, width: Double) | |
| case class Petal(length: Double, width: Double) | |
| case class Species(name: String) | |
| case class Iris(sepal: Sepal, petal: Petal, species: Species) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.scalatest._ | |
| import org.scalatest.matchers._ | |
| import org.joda.time.DateTime | |
| import java.util.concurrent.Executors | |
| import akka.dispatch._ | |
| import akka.util.Duration | |
| import akka.util.duration._ | |
| class RendezvousSpec extends FlatSpec with ShouldMatchers { |
細かい点で間違いなどあるかと思います。fork して直していただけると助かります。
Finagle is built using sbt. We've included a bootstrap script to ensure the correct version of sbt is used. To build:
Finagle は sbt を使ってビルドしています。私たちは確実に適切なバージョンの sbt を使うようにブートストラップ用のスクリプトを含めています。このように実行します。
$ ./sbt test