1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

Remove sprockets/compass references

This commit is contained in:
Thomas Reynolds 2015-11-30 17:14:02 -08:00
parent e9b3a8abe4
commit 07a216d5ca
5 changed files with 5 additions and 55 deletions

View file

@ -1,5 +1,4 @@
ENV["TEST"] = "true"
ENV["AUTOLOAD_SPROCKETS"] ||= "false"
require 'sassc'

View file

@ -124,15 +124,15 @@ module Middleman
# @return [String]
define_setting :js_dir, 'javascripts', 'Location of javascripts within source'
# Location of stylesheets within source. Used by Compass.
# Location of stylesheets within source.
# @return [String]
define_setting :css_dir, 'stylesheets', 'Location of stylesheets within source'
# Location of images within source. Used by HTML helpers and Compass.
# Location of images within source. Used by HTML helpers.
# @return [String]
define_setting :images_dir, 'images', 'Location of images within source'
# Location of fonts within source. Used by Compass.
# Location of fonts within source.
# @return [String]
define_setting :fonts_dir, 'fonts', 'Location of fonts within source'
@ -144,7 +144,7 @@ module Middleman
# @return [String]
define_setting :build_dir, 'build', 'Where to build output files'
# Default prefix for building paths. Used by HTML helpers and Compass.
# Default prefix for building paths. Used by HTML helpers.
# @return [String]
define_setting :http_prefix, '/', 'Default prefix for building paths'

View file

@ -54,7 +54,6 @@ module Middleman
@app.execute_callbacks(:before_build, [self])
queue_current_paths if @cleaning
prerender_css
output_files
@ -67,39 +66,14 @@ module Middleman
!@has_error
end
# Pre-request CSS to give Compass a chance to build sprites
# @return [Array<Resource>] List of css resources that were output.
Contract ResourceList
def prerender_css
logger.debug '== Prerendering CSS'
css_files = @app.sitemap.resources.select do |resource|
resource.ext == '.css'
end.each(&method(:output_resource))
logger.debug '== Checking for Compass sprites'
# Double-check for compass sprites
@app.files.find_new_files!
@app.sitemap.ensure_resource_list_updated!
css_files
end
# Find all the files we need to output and do so.
# @return [Array<Resource>] List of resources that were output.
Contract ResourceList
def output_files
logger.debug '== Building files'
# Sort paths to be built by the above order. This is primarily so Compass can
# find files in the build folder when it needs to generate sprites for the
# css files.
#
# Loop over all the paths and build them.
@app.sitemap.resources
.sort_by { |resource| SORT_ORDER.index(resource.ext) || 100 }
.reject { |resource| resource.ext == '.css' }
.select { |resource| !@glob || File.fnmatch(@glob, resource.destination_path) }
.each(&method(:output_resource))
end

View file

@ -61,7 +61,7 @@ module Middleman
# * `app.before_render {|body, path, locs, template_class| ... }` - Manipulate template sources before they are rendered.
# * `app.after_render {|content, path, locs, template_class| ... }` - Manipulate output text after a template has been rendered. It is also common to install a Rack middleware to do this instead.
# * `app.ready { ... }` - Run code once Middleman is ready to serve or build files (after `after_configuration`).
# * `app.compass_config { |compass_config| ... }` - Manipulate the Compass configuration after it has been set up.
#
# @see http://middlemanapp.com/advanced/custom/ Middleman Custom Extensions Documentation
class Extension

View file

@ -112,26 +112,3 @@ else
end
SASS_MODULE::Script::Functions.send :include, ::Middleman::Sass::Functions
# module SASS_MODULE::Script::Functions
# include ::Middleman::Sass::Functions
# # # Hack to ensure previous API declarations (by Compass or whatever)
# # # don't take precedence.
# # [:asset_path, :asset_url, :image_path, :image_url, :font_path, :font_url, :asset_data_uri].each do |method|
# # defined?(@signatures) && @signatures.delete(method)
# # end
# # declare :asset_path, [:source], var_kwargs: true
# # declare :asset_path, [:source, :kind]
# # declare :asset_url, [:source], var_kwargs: true
# # declare :asset_url, [:source, :kind]
# # declare :image_path, [:source], var_kwargs: true
# # declare :image_url, [:source], var_kwargs: true
# # declare :image_url, [:source, :only_path]
# # declare :image_url, [:source, :only_path, :cache_buster]
# # declare :font_path, [:source], var_kwargs: true
# # declare :font_url, [:source], var_kwargs: true
# # declare :font_url, [:source, :only_path]
# # declare :asset_data_uri, [:source]
# end