Minor relative_assets cleanup

This commit is contained in:
Thomas Reynolds 2012-04-26 15:59:28 -07:00
parent 8bf0124241
commit 4a49388d64

View file

@ -1,5 +1,6 @@
# Extension namespace # Extension namespace
module Middleman::Extensions module Middleman
module Extensions
# Relative Assets extension # Relative Assets extension
module RelativeAssets module RelativeAssets
@ -40,10 +41,11 @@ module Middleman::Extensions
path path
else else
path = File.join(prefix, path) if prefix.length > 0 path = File.join(prefix, path) if prefix.length > 0
request_path = @request_path.dup request_path = @request_path.dup
request_path << index_file if path.match(%r{/$}) request_path << index_file if path.match(%r{/$})
request_path.gsub!(%r{^/}, '')
parts = request_path.split('/') parts = request_path.gsub(%r{^/}, '').split('/')
if parts.length > 1 if parts.length > 1
arry = [] arry = []
@ -57,7 +59,5 @@ module Middleman::Extensions
end end
end end
end end
end
# Register extension
# register :relative_assets, RelativeAssets
end end