make matching case insensitive
This commit is contained in:
parent
ec37f3b59f
commit
f933f9e674
|
@ -11,7 +11,7 @@ module Qwandry
|
|||
def scan(pattern)
|
||||
results = []
|
||||
all_paths.select do |path|
|
||||
if File.fnmatch?(pattern, File.basename(path))
|
||||
if File.fnmatch?(pattern, File.basename(path), File::FNM_CASEFOLD)
|
||||
results << package(File.basename(path), [path])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ module Qwandry
|
|||
results = Hash.new{|h,k| h[k] = package(k)}
|
||||
all_paths.select do |path|
|
||||
basename = File.basename(path)
|
||||
if File.fnmatch?(pattern, basename)
|
||||
if File.fnmatch?(pattern, basename, File::FNM_CASEFOLD)
|
||||
# strip any file extension
|
||||
basename.sub! /\.\w+$/,'' unless File.directory?(path)
|
||||
results[basename].paths << path
|
||||
|
|
Loading…
Reference in New Issue