updated the regex to support nested files and refactored some unclear functions
This commit is contained in:
parent
753ad37df7
commit
fdd639efaf
@ -25,7 +25,7 @@ module Compass
|
||||
|
||||
# Returns the Glob of image files for this sprite
|
||||
def files
|
||||
@files ||= Dir[File.join(Compass.configuration.images_path, uri).gsub('/*', '/**/*')].sort
|
||||
@files ||= Dir[File.join(Compass.configuration.images_path, uri)].sort
|
||||
end
|
||||
|
||||
# Returns an Array of image names without the file extension
|
||||
|
@ -3,8 +3,8 @@ module Compass
|
||||
attr_accessor :name, :path
|
||||
|
||||
def self.path_and_name(uri)
|
||||
if uri =~ %r{((.+/)?(.+))/(.+?)\.png}
|
||||
[$1, $3, $4]
|
||||
if uri =~ %r{((.+/)?([^\*.]+))/(.+?)\.png}
|
||||
[$1, $3]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -590,7 +590,7 @@ class SpritesTest < Test::Unit::TestCase
|
||||
|
||||
it "should generate a sprite from nested folders" do
|
||||
css = render <<-SCSS
|
||||
@import "nested/*.png";
|
||||
@import "nested/**/*.png";
|
||||
@include all-nested-sprites;
|
||||
SCSS
|
||||
assert_correct css, <<-CSS
|
||||
|
Loading…
Reference in New Issue
Block a user