Files
sbt/main/StringUtilities.scala
T
Mark Harrah b16b0adc0f add sbt package object
for use from project definitions only-
 it is a top-level project
add dependency and repository builders
 cross-versioning will be a post-construction transformation
2010-09-21 22:24:24 -04:00

15 lines
335 B
Scala

/* sbt -- Simple Build Tool
* Copyright 2009 Mark Harrah
*/
package sbt
object StringUtilities
{
def normalize(s: String) = s.toLowerCase.replaceAll("""\s+""", "-")
def nonEmpty(s: String, label: String)
{
require(s.trim.length > 0, label + " cannot be empty.")
}
def appendable(s: String) = if(s.isEmpty) "" else "_" + s
}