Skip to content

Instantly share code, notes, and snippets.

@samueltardieu
Forked from ymasory/GetVersion.scala
Created April 17, 2011 14:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueltardieu/924051 to your computer and use it in GitHub Desktop.
Save samueltardieu/924051 to your computer and use it in GitHub Desktop.
// Use with a default value as in:
// runningScalaVersion getOrElse "2.8.0"
lazy val runningScalaVersion = {
val matcher = """version (\d+\.\d+\.\d+).*""".r
util.Properties.versionString match {
case matcher(vsn) => Some(vsn)
case _ => None
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment