Skip to content

Commit b33702e

Browse files
author
Rafael Mendonça França
committed
Fail fast if options[:sprockets] is not present
1 parent 91f7509 commit b33702e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/sass/rails/importer.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Globbing
1010
GLOB = /(\A|\/)(\*|\*\*\/\*)\z/
1111

1212
def find_relative(name, base, options)
13-
if m = name.match(GLOB)
13+
if options[:sprockets] && m = name.match(GLOB)
1414
path = name.sub(m[0], "")
1515
base = File.expand_path(path, File.dirname(base))
1616
glob_imports(base, m[2], options)
@@ -84,7 +84,7 @@ def find(*args)
8484

8585
private
8686
def process_erb_engine(engine)
87-
if engine && syntax = erb_extensions[engine.options[:syntax]]
87+
if engine && engine.options[:sprockets] && syntax = erb_extensions[engine.options[:syntax]]
8888
template = Tilt::ERBTemplate.new(engine.options[:filename])
8989
contents = template.render(engine.options[:sprockets][:context], {})
9090

0 commit comments

Comments
 (0)