From 7f89bcad8d5cae1905e33905e75b5756ba2144eb Mon Sep 17 00:00:00 2001 From: Jared Grippe Date: Fri, 8 Jan 2010 15:35:08 -0800 Subject: [PATCH] [Sass] Fixed a bug in Plugin.update_stylesheets when a template_location has a trailing slash. --- doc-src/SASS_CHANGELOG.md | 4 ++++ lib/sass/plugin.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index 690d4921dc..4be70f8979 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -19,6 +19,10 @@ * `nil` values for Sass options are now ignored, rather than raising errors. +* Fix a bug that appears when Plugin template locations + have multiple trailing slashes. + Thanks to [Jared Grippe](http://jaredgrippe.com/). + ### Must Read! * When `@import` is given a filename without an extension, diff --git a/lib/sass/plugin.rb b/lib/sass/plugin.rb index 1bfaf342ea..5339e7f9e0 100644 --- a/lib/sass/plugin.rb +++ b/lib/sass/plugin.rb @@ -76,7 +76,7 @@ def update_stylesheets Dir.glob(File.join(template_location, "**", "*.sass")).each do |file| # Get the relative path to the file with no extension - name = file.sub(template_location + "/", "")[0...-5] + name = file.sub(template_location.sub(/\/*$/, '/'), "")[0...-5] if !forbid_update?(name) && (options[:always_update] || stylesheet_needs_update?(name, template_location, css_location)) update_stylesheet(name, template_location, css_location)