Don't return a trailing slash from templatize or targetize.

This commit is contained in:
Chris Eppstein 2009-02-08 01:20:12 -08:00
parent c0c422c373
commit 6c4759278e
3 changed files with 8 additions and 6 deletions

View File

@ -33,7 +33,7 @@ module Compass
msg = "#{basename(dir)} already exists and is not a directory."
raise Compass::FilesystemConflict.new(msg)
else
logger.record :directory, basename(dir)
logger.record :directory, separate("#{basename(dir)}/")
FileUtils.mkdir_p(dir) unless options[:dry_run]
end
end
@ -94,5 +94,10 @@ module Compass
path.gsub(%r{/}, File::SEPARATOR)
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

View File

@ -69,9 +69,6 @@ module Compass
path.index(File::SEPARATOR) == 0
end
def strip_trailing_separator(path)
(path[-1..-1] == File::SEPARATOR) ? path[0..-2] : path
end
end
end
end

View File

@ -107,13 +107,13 @@ module Compass
# 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.
def targetize(path)
File.join(target_path, separate(path))
strip_trailing_separator File.join(target_path, separate(path))
end
# 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.
def templatize(path)
File.join(template_path, separate(path))
strip_trailing_separator File.join(template_path, separate(path))
end
def stylesheet_links