Sha256: 5d10392905caf331e0442c15e4d01b402bed919b6ef490332cb1b30add960013
Contents?: true
Size: 676 Bytes
Versions: 71
Compression:
Stored size: 676 Bytes
Contents
module Jasmine class PathExpander def self.expand(base_directory, patterns, globber = Dir.method(:glob)) negative, positive = patterns.partition {|pattern| /^!/ =~ pattern} chosen, negated = [positive, negative].collect do |patterns| patterns.map do |path| files = globber.call(File.join(base_directory, path.gsub(/^!/, ''))) if files.empty? && !(path =~ /\*|^\!/) if path[0..3] == 'http' files << path else files = [File.join(base_directory, path)] end end files.sort end.flatten.uniq end chosen - negated end end end
Version data entries
71 entries across 56 versions & 2 rubygems