Getting Started

Getting Started

Dependencies

ScalaWords is designed with the thought that you’ll include all dependencies you’ll need.

For example: don’t need MongoStream? Don’t include mogo in your dependencies - you’ll never bump into using a Mongo Verb by accident anyway ;-)

What we do require though is Google Guava.

So to include ScalaWords in your build use this snippet:

// TODO
val guava =
val scalaWords =

val rainbow = "pl.project13.scala" % "rainbow" % "0.1"

dependencies ++= Seq(scalaWords, guava)

How to use Words?

How to use Words?

Each Word (with one or two documented exceptions) can be used in one of the following ways:

Via Mixin

The simplest way to use ScalaWords is to mixin the word you need. This also has the advantage of clearly letting everyone know you’ll be using some word in this file.

Via Import

You can simply import all methods from a word using such construct:

import TimedVerb._

Please note that putting this in the imports section of your file may be handy, but it may confuse people with the typical “Where did that implicit come from?!”. Instead, try to import just near the place where you’ll be using the Word like in the example bellow:

class Something(magicIsReal: Boolean) {

  def doMagic() = {
    import UnlessWord._
    "Magic is " + "NOT ".unless(magicIsReal) + "real!"
  }
}

Contents