lib/sprite/builder.rb in sprite-0.2.6 vs lib/sprite/builder.rb in sprite-0.2.7

- old
+ new

@@ -143,11 +143,11 @@ end end # if no image configs are detected, set some intelligent defaults def default_images - sprites_path = image_source_path("sprites") + sprites_path = File.expand_path(image_source_path("sprites")) collection = [] if File.exists?(sprites_path) Dir.glob(File.join(sprites_path, "*")) do |dir| next unless File.directory?(dir) @@ -163,19 +163,20 @@ File.join("sprites", source_name, "*.jpeg"), ] } end end + collection end # expands out sources, taking the Glob paths and turning them into separate entries in the array def expand_image_paths # cycle through image sources and expand out globs @images.each do |image| # expand out all the globs image['sources'] = image['sources'].to_a.map{ |source| - Dir.glob(image_source_path(source)) + Dir.glob(File.expand_path(image_source_path(source))) }.flatten.compact end end # get the disk path for an image source file