Module: Zip::ZipFind
- Defined in:
- lib/hotplate/gems/rubyzip-1.1.7/samples/zipfind.rb
Class Method Summary collapse
- .find(path, zipFilePattern = /\.zip$/i) ⇒ Object
- .find_file(path, fileNamePattern, zipFilePattern = /\.zip$/i) ⇒ Object
Class Method Details
.find(path, zipFilePattern = /\.zip$/i) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/hotplate/gems/rubyzip-1.1.7/samples/zipfind.rb', line 12 def self.find(path, zipFilePattern = /\.zip$/i) Find.find(path) { |fileName| yield(fileName) if zipFilePattern.match(fileName) && File.file?(fileName) begin Zip::File.foreach(fileName) { |zipEntry| yield(fileName + File::SEPARATOR + zipEntry.to_s) } rescue Errno::EACCES => ex puts ex end end } end |
.find_file(path, fileNamePattern, zipFilePattern = /\.zip$/i) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/hotplate/gems/rubyzip-1.1.7/samples/zipfind.rb', line 29 def self.find_file(path, fileNamePattern, zipFilePattern = /\.zip$/i) self.find(path, zipFilePattern) { |fileName| yield(fileName) if fileNamePattern.match(fileName) } end |