Fix combo of compass-import-once and sass-globs. Closes middleman/middleman-sprockets#56

This commit is contained in:
Thomas Reynolds 2014-05-01 10:01:45 -07:00
parent 8eabe4d354
commit 2dd87bab74
2 changed files with 30 additions and 1 deletions

View file

@ -1,6 +1,35 @@
require 'sass' require 'sass'
require 'compass/import-once' require 'compass/import-once'
GLOB = /\*|\[.+\]/
# Hack around broken sass globs when combined with import-once
# Targets compass-import-once 1.0.4
# Tracking issue: https://github.com/chriseppstein/compass/issues/1529
module Compass
module ImportOnce
module Importer
def find_relative(uri, base, options, *args)
if uri =~ GLOB
force_import = true
else
uri, force_import = handle_force_import(uri)
end
maybe_replace_with_dummy_engine(super(uri, base, options, *args), options, force_import)
end
def find(uri, options, *args)
if uri =~ GLOB
force_import = true
else
uri, force_import = handle_force_import(uri)
end
maybe_replace_with_dummy_engine(super(uri, options, *args), options, force_import)
end
end
end
end
module Middleman module Middleman
module Renderers module Renderers
# Sass renderer # Sass renderer

View file

@ -22,7 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency("middleman-sprockets", ">= 3.1.2") s.add_dependency("middleman-sprockets", ">= 3.1.2")
s.add_dependency("haml", [">= 4.0.5"]) s.add_dependency("haml", [">= 4.0.5"])
s.add_dependency("sass", [">= 3.2.17", "< 4.0"]) s.add_dependency("sass", [">= 3.2.17", "< 4.0"])
s.add_dependency("compass-import-once", ["~> 1.0.4"]) s.add_dependency("compass-import-once", ["1.0.4"])
s.add_dependency("compass", [">= 0.12.4"]) s.add_dependency("compass", [">= 0.12.4"])
s.add_dependency("uglifier", ["~> 2.5"]) s.add_dependency("uglifier", ["~> 2.5"])
s.add_dependency("coffee-script", ["~> 2.2.0"]) s.add_dependency("coffee-script", ["~> 2.2.0"])