Skip to content

Commit

Permalink
merge pull request #12 from k2s/master
Browse files Browse the repository at this point in the history
  • Loading branch information
dpcasady committed Oct 1, 2013
1 parent a3ce016 commit 1f706b5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 20 deletions.
41 changes: 22 additions & 19 deletions grails-app/conf/DefaultGrassConfig.groovy
@@ -1,19 +1,22 @@
grass {
sass_dir = "./src/stylesheets"

css_dir = "./web-app/css"

images_dir = "web-app/images"

// default is true
relative_assets = true

// default is true
line_comments = true

// other options: nested, expanded, compact, compressed
output_style = "compact"

// scss or sass
framework_output_type = "scss"
}
grass {
sass_dir = "./src/stylesheets"

css_dir = "./web-app/css"

images_dir = "web-app/images"

// default is true
relative_assets = true

// default is true
line_comments = true

// other options: nested, expanded, compact, compressed
output_style = "compact"

// scss or sass
framework_output_type = "scss"

// what to do when Tomcat is configured: "watch" (default), "compile", "print", otherwise do nothing
do_on_start = "watch"
}
2 changes: 1 addition & 1 deletion scripts/_Events.groovy
Expand Up @@ -2,5 +2,5 @@ includeTargets << new File(compassSassPluginDir, "scripts/_GetCompassInvoker.gro

eventConfigureTomcat = {
compass.killCompass()
compass.watch()
compass.execute()
}
18 changes: 18 additions & 0 deletions src/groovy/grails/plugins/sass/CompassInvoker.groovy
Expand Up @@ -59,6 +59,24 @@ class CompassInvoker {
runCompassCommandInThread(['watch'] + getCompileArgs(null))
}

void execute() {
def what = config.grass.containsKey("do_on_start") ? config.grass.do_on_start : "watch"
switch (what) {
case "compile":
compile() { msg ->
event("StatusError", [msg])
}
break
case "watch":
watch()
break
case "print":
String[] command = ['jruby', '-S', 'compass', ['watch'] + getCompileArgs(null)].flatten()
System.out.append("Execute manually if needed: ${command.join(' ')}\n")
break
}
}

void installBlueprint() {
def installBlueprintCommand = ['create', '--using', 'blueprint', '--syntax', (config.grass?.framework_output_type ?: "scss")]

Expand Down

0 comments on commit 1f706b5

Please sign in to comment.