画像ファイルリスト
画像だけリストする
code:help_imagefiles.rb
def imagefiles(argv=ARGV)
list = ls -1.split(/\n/)
matched = {}
list.each { |file|
if file =~ /\.(jpg|jpeg|png|gif)$/i
if argv.length == 0
else
# args(argv).each { |arg|
argv0.split(/\s/).each { |arg| matchedfile = true if file =~ /#{arg}/i }
end
end
}
files = matched.keys
"(" + files.join("|") + ")"
end