-
-
Save deathwishdave/ff4a5c814e1d4545b87c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
patterns = [] | |
patterns << ".pdf" | |
puts patterns | |
matches = [] | |
Find.find('./') do |match| | |
patterns.each do |pattern| | |
matches << match if match =~ /.*\.pdf$/ | |
end | |
end | |
puts matches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
patterns = [] | |
patterns << ".pdf" | |
puts patterns | |
matches = [] | |
Find.find('./') do |match| | |
patterns.each do |pattern| | |
matches << match if match =~ /.*\#{pattern}$/ # /.*\.pdf$/ | |
end | |
end | |
puts matches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment