Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Roy plugin for Play 2.0
JavaScript Scala
branch: master
Failed to load latest commit information.
project Use system properties instead of environment variables
src/main
LICENSE.txt Add MIT license
README.md
build.sbt

README.md

Ray - Roy on Play 2.0

About

Ray is a Roy 'compiled asset plugin' for Play 2.0 - it is similar to the built-in CoffeeScript compiler. Roy files placed under app/assets/javascripts will be requestable as if they were plain JavaScript files.

For example, Roy code in app/assets/javascripts/main.roy will be automatically compiled to JavaScript when requested via public/javascripts/main.js:

Compile time errors (such as static type errors) will cause a nice Play error page:

Installation

First you must publish the plugin to your Play 2.0 repository. You will have to specify your top level play directory and the version:

sbt -Dplay.path=../play-2.0-RC3 -Dplay.version=2.0-RC3 publish

Then add the plugin to your application's project/plugins.sbt:

addSbtPlugin("org.brianmckenna" % "ray" % "0.1")

Now you can add an import to your application's project/Build.scala:

import org.brianmckenna.ray.RoyBuild

And extend your Build with the RoyBuild trait:

object ApplicationBuild extends Build with RoyBuild

Finally add the following lines to the settings call:

royEntryPoints <<= (sourceDirectory in Compile)(base => base / "assets" ** "*.roy"),

royOptions := Seq.empty[String],

resourceGenerators in Compile <+= RoyCompiler
Something went wrong with that request. Please try again.