Don't return a trailing slash from templatize or targetize.
This commit is contained in:
parent
c0c422c373
commit
6c4759278e
@ -33,7 +33,7 @@ module Compass
|
|||||||
msg = "#{basename(dir)} already exists and is not a directory."
|
msg = "#{basename(dir)} already exists and is not a directory."
|
||||||
raise Compass::FilesystemConflict.new(msg)
|
raise Compass::FilesystemConflict.new(msg)
|
||||||
else
|
else
|
||||||
logger.record :directory, basename(dir)
|
logger.record :directory, separate("#{basename(dir)}/")
|
||||||
FileUtils.mkdir_p(dir) unless options[:dry_run]
|
FileUtils.mkdir_p(dir) unless options[:dry_run]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -94,5 +94,10 @@ module Compass
|
|||||||
path.gsub(%r{/}, File::SEPARATOR)
|
path.gsub(%r{/}, File::SEPARATOR)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Removes the trailing separator, if any, from a path.
|
||||||
|
def strip_trailing_separator(path)
|
||||||
|
(path[-1..-1] == File::SEPARATOR) ? path[0..-2] : path
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
@ -69,9 +69,6 @@ module Compass
|
|||||||
path.index(File::SEPARATOR) == 0
|
path.index(File::SEPARATOR) == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def strip_trailing_separator(path)
|
|
||||||
(path[-1..-1] == File::SEPARATOR) ? path[0..-2] : path
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
@ -107,13 +107,13 @@ module Compass
|
|||||||
# returns an absolute path given a path relative to the current installation target.
|
# returns an absolute path given a path relative to the current installation target.
|
||||||
# Paths can use unix style "/" and will be corrected for the current platform.
|
# Paths can use unix style "/" and will be corrected for the current platform.
|
||||||
def targetize(path)
|
def targetize(path)
|
||||||
File.join(target_path, separate(path))
|
strip_trailing_separator File.join(target_path, separate(path))
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns an absolute path given a path relative to the current template.
|
# returns an absolute path given a path relative to the current template.
|
||||||
# Paths can use unix style "/" and will be corrected for the current platform.
|
# Paths can use unix style "/" and will be corrected for the current platform.
|
||||||
def templatize(path)
|
def templatize(path)
|
||||||
File.join(template_path, separate(path))
|
strip_trailing_separator File.join(template_path, separate(path))
|
||||||
end
|
end
|
||||||
|
|
||||||
def stylesheet_links
|
def stylesheet_links
|
||||||
|
Loading…
Reference in New Issue
Block a user