Skip to content

Commit

Permalink
Ensure to compile Less assets with :paths option
Browse files Browse the repository at this point in the history
We can't provide a unit test for this change because Less has a bug:

  cowboyd/less.rb#80
  • Loading branch information
jodosha committed Mar 26, 2016
1 parent d65e7e7 commit 8343583
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/hanami/assets/compiler.rb
Expand Up @@ -172,7 +172,11 @@ def compile!
#
# This is needed to don't create a `.sass-cache' directory at the root of the project,
# but to have it under `tmp/sass-cache'.
write { Tilt.new(source, nil, load_paths: sass_load_paths, cache_location: sass_cache_location).render }
#
# NOTE: We need another option for Less: `:paths'.
#
# This is required by Less to reference variables defined in other files.
write { Tilt.new(source, nil, paths: less_load_paths, load_paths: sass_load_paths, cache_location: sass_cache_location).render }
rescue RuntimeError
raise UnknownAssetEngine.new(source)
end
Expand Down Expand Up @@ -218,6 +222,10 @@ def sass_load_paths
result
end

# @since x.x.x
# @api private
alias_method :less_load_paths, :sass_load_paths

# @since 0.1.0
# @api private
def sass_cache_location
Expand Down

0 comments on commit 8343583

Please sign in to comment.