Skip to content

Commit

Permalink
Hack to allow defined ordering of files (still ugly)
Browse files Browse the repository at this point in the history
  • Loading branch information
crystalneth committed Jan 5, 2011
1 parent 8e49264 commit ffedd18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/asset_resource/middleware.rb
Expand Up @@ -68,8 +68,12 @@ def base_path
end

def files_for(type)
Dir.glob(File.expand_path(File.join(base_path, type, "**", "*"))).select do |file|
File.exist?(file) && File.basename(file)[0..0] != "_"
if filenames = options[:handlers][:files]
filenames.map{|filename| File.join(base_path, type, filename)}.select{|file| File.exists?(file)}
else
Dir.glob(File.expand_path(File.join(base_path, type, "**", "*"))).select do |file|
File.exist?(file) && File.basename(file)[0..0] != "_"
end
end
end

Expand Down

0 comments on commit ffedd18

Please sign in to comment.