mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Merge pull request #536 from kematzy/fix-sass-cache-location
Fix sass cache location
This commit is contained in:
commit
6f0f9b00a2
7 changed files with 42 additions and 1 deletions
|
@ -14,6 +14,11 @@ module Middleman
|
||||||
# Default sass options
|
# Default sass options
|
||||||
app.set :sass, {}
|
app.set :sass, {}
|
||||||
|
|
||||||
|
# Location of SASS .sass_cache directory.
|
||||||
|
# @return [String]
|
||||||
|
# set :sass_cache_path, "/tmp/middleman-app-name/sass_cache"
|
||||||
|
app.set(:sass_cache_path) { File.join(app.root_path, '.sass_cache') } # runtime compile of path
|
||||||
|
|
||||||
app.before_configuration do
|
app.before_configuration do
|
||||||
template_extensions :scss => :css,
|
template_extensions :scss => :css,
|
||||||
:sass => :css
|
:sass => :css
|
||||||
|
|
22
middleman-more/features/sass_cache_path.feature
Normal file
22
middleman-more/features/sass_cache_path.feature
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
Feature: SASS .sass_cache custom location
|
||||||
|
|
||||||
|
Scenario: Using the default location for .sass_cache folder
|
||||||
|
Given the Server is running at "sass-cache-path-default-app"
|
||||||
|
|
||||||
|
When I go to "/stylesheets/plain.css"
|
||||||
|
Then I should see "color: blue;"
|
||||||
|
|
||||||
|
# TODO::
|
||||||
|
# Not sure how to test this location, as the directory is stored outside of the app root
|
||||||
|
# during testing, but inside app root in "production"
|
||||||
|
|
||||||
|
# Then a directory named ".sass_cache" should exist
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Using a custom location for .sass_cache folder
|
||||||
|
Given the Server is running at "sass-cache-path-custom-app"
|
||||||
|
|
||||||
|
When I go to "/stylesheets/plain.css"
|
||||||
|
Then I should see "html, body, div, span, applet, object, iframe,"
|
||||||
|
|
||||||
|
Then a directory named "/tmp/middleman-more-custom-sass_cache_path" should exist
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
set :sass_cache_path, File.join('/tmp', "#{File.basename(Dir.pwd)}-custom-sass_cache_path")
|
|
@ -0,0 +1,4 @@
|
||||||
|
@import "compass/reset"
|
||||||
|
|
||||||
|
red
|
||||||
|
color: blue
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
# Using default setting
|
||||||
|
# set :sass_cache_path, File.join(Dir.pwd, '.sass_cache')
|
|
@ -0,0 +1,4 @@
|
||||||
|
@import "compass/reset"
|
||||||
|
|
||||||
|
red
|
||||||
|
color: blue
|
|
@ -21,7 +21,7 @@ module Middleman
|
||||||
::Compass.configuration do |config|
|
::Compass.configuration do |config|
|
||||||
config.project_path = source_dir
|
config.project_path = source_dir
|
||||||
config.environment = :development
|
config.environment = :development
|
||||||
config.cache_path = File.join(root, ".sass-cache")
|
config.cache_path = sass_cache_path
|
||||||
config.sass_dir = css_dir
|
config.sass_dir = css_dir
|
||||||
config.css_dir = css_dir
|
config.css_dir = css_dir
|
||||||
config.javascripts_dir = js_dir
|
config.javascripts_dir = js_dir
|
||||||
|
|
Loading…
Reference in a new issue