-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Sass 3.4 and SilverStripe 3.2/3.3 #19
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,14 @@ | |
class Compass extends Controller | ||
{ | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private static $allowed_actions = array( | ||
'convert', | ||
'rebuild' | ||
); | ||
|
||
/** | ||
* @var array | ||
*/ | ||
|
@@ -29,7 +37,7 @@ class Compass extends Controller | |
/** | ||
* @var float Which version of sass should we use. | ||
*/ | ||
public static $sass_version = '3'; | ||
public static $sass_version = 'latest'; | ||
|
||
/** | ||
* @var string - preferred syntax to use. | ||
|
@@ -46,6 +54,9 @@ class Compass extends Controller | |
'3' => array( | ||
'yard' => '', 'maruku' => '', 'sass' => '~>3.2', 'compass' => '~> 0.12.2', 'compass-colors' => '' | ||
), | ||
'3.4' => array( | ||
'yard' => '', 'maruku' => '', 'sass' => '~>3.4', 'compass' => '~>1.0', 'compass-colors' => '' | ||
), | ||
'latest' => array( | ||
'yard' => '', 'maruku' => '', 'sass' => '', 'compass' => '', 'compass-colors' => '' | ||
) | ||
|
@@ -290,15 +301,15 @@ public function rebuild($verbose = false) | |
$this->rebuildDirectory($dir); | ||
} else { | ||
if ($verbose) { | ||
echo "\nRebuilding all\n"; | ||
echo "\nRebuilding all<br>\n"; | ||
} | ||
|
||
foreach ($this->getAllThemes() as $theme) { | ||
$dir = THEMES_PATH . DIRECTORY_SEPARATOR . $theme; | ||
|
||
if (file_exists($dir . DIRECTORY_SEPARATOR . 'config.rb')) { | ||
if ($verbose) { | ||
echo "\nRebuilding theme: $theme\n"; | ||
echo "\nRebuilding theme: $theme<br>\n"; | ||
} | ||
$this->rebuildDirectory($dir); | ||
} | ||
|
@@ -310,9 +321,20 @@ public function rebuild($verbose = false) | |
continue; | ||
} | ||
|
||
// Skip other modules | ||
if ($name == 'framework') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why skip these core modules? If you're contributing to those modules you'd want them recompiled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know why, but framework's Sass threw some compiling errors, so I thought, you need some more Compass plugins or external mixins to compile. However, I've tested this now without skipping core modules – no compile errors :) |
||
continue; | ||
} | ||
if ($name == 'cms') { | ||
continue; | ||
} | ||
if ($name == 'admin') { | ||
continue; | ||
} | ||
|
||
if (file_exists($path . DIRECTORY_SEPARATOR . 'config.rb')) { | ||
if ($verbose) { | ||
echo "\nRebuilding module: $name\n"; | ||
echo "\nRebuilding module: $name<br>\n"; | ||
} | ||
$this->rebuildDirectory($path); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add these HTML tags is probably a bad idea and scope creep of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I also thought this is a bad idea. But if you rebuild in browser by dev/compass/rebuild you get all the messages in one line
I'll take it out and that "module skipping" below und make a new Pull.