From 58007ea2fc2ad09c0b4bd913d3714e3b90e8251b Mon Sep 17 00:00:00 2001 From: Josh Channings Date: Wed, 18 May 2011 15:29:37 +0100 Subject: [PATCH] Try the SASS Gem before PHamlP. --- peroxide.engine | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/peroxide.engine b/peroxide.engine index ce6f942..908ce2b 100644 --- a/peroxide.engine +++ b/peroxide.engine @@ -130,6 +130,16 @@ function _peroxide_process_sass($theme, $sass) { return $css_file; } + // Try and build the file with the Ruby version + @exec( + 'sass '.($info['extension'] == 'scss' ? '--scss ' : ''). + escapeshellarg($sass).' '.escapeshellarg($css_file), + $op, $ret + ); + if($ret == 0) { + return $css_file; + } + try { $css = $parser->parse($sass)->render(); } @@ -150,7 +160,13 @@ function _peroxide_process_sass($theme, $sass) { function _peroxide_init() { $path = drupal_get_path('theme_engine', 'peroxide'); include_once $path . 'phamlp/haml/HamlParser.php'; - include_once $path . 'phamlp/sass/SassParser.php'; + + // Test for Ruby version first + @exec("sass -v", $op, $ret); + if($ret != 0) { + include_once $path . 'phamlp/sass/SassParser.php'; + } + include_once $path . 'lessphp/lessc.inc.php'; }