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