Module: Omnizip::Extraction
- Defined in:
- lib/omnizip/extraction.rb,
lib/omnizip/extraction/filter_chain.rb,
lib/omnizip/extraction/glob_pattern.rb,
lib/omnizip/extraction/regex_pattern.rb,
lib/omnizip/extraction/pattern_matcher.rb,
lib/omnizip/extraction/predicate_pattern.rb,
lib/omnizip/extraction/selective_extractor.rb
Overview
Provides selective extraction capabilities for archives
Supports extracting files matching glob patterns, regex patterns, or custom predicates without extracting the entire archive.
Defined Under Namespace
Classes: FilterChain, GlobPattern, PatternMatcher, PredicatePattern, RegexPattern, SelectiveExtractor
Class Method Summary collapse
-
.count_matching(archive, pattern) ⇒ Integer
Count files matching a pattern.
-
.extract_matching(archive, pattern, dest, options = {}) ⇒ Array<String>
Extract files matching a pattern from an archive.
-
.extract_to_memory_matching(archive, pattern) ⇒ Hash<String, String>
Extract files matching a pattern to memory.
-
.extract_with_filter(archive, filter, dest, options = {}) ⇒ Array<String>
Extract with a filter chain.
-
.list_matching(archive, pattern) ⇒ Array
List files matching a pattern without extracting.
-
.match_result(archive, pattern) ⇒ Models::MatchResult
Get match result with statistics.
Class Method Details
.count_matching(archive, pattern) ⇒ Integer
Count files matching a pattern
64 65 66 67 68 |
# File 'lib/omnizip/extraction.rb', line 64 def count_matching(archive, pattern) filter = build_filter(pattern) extractor = SelectiveExtractor.new(archive, filter) extractor.count_matches end |
.extract_matching(archive, pattern, dest, options = {}) ⇒ Array<String>
Extract files matching a pattern from an archive
31 32 33 34 35 |
# File 'lib/omnizip/extraction.rb', line 31 def extract_matching(archive, pattern, dest, = {}) filter = build_filter(pattern) extractor = SelectiveExtractor.new(archive, filter) extractor.extract(dest, ) end |
.extract_to_memory_matching(archive, pattern) ⇒ Hash<String, String>
Extract files matching a pattern to memory
42 43 44 45 46 |
# File 'lib/omnizip/extraction.rb', line 42 def extract_to_memory_matching(archive, pattern) filter = build_filter(pattern) extractor = SelectiveExtractor.new(archive, filter) extractor.extract_to_memory end |
.extract_with_filter(archive, filter, dest, options = {}) ⇒ Array<String>
Extract with a filter chain
77 78 79 80 |
# File 'lib/omnizip/extraction.rb', line 77 def extract_with_filter(archive, filter, dest, = {}) extractor = SelectiveExtractor.new(archive, filter) extractor.extract(dest, ) end |
.list_matching(archive, pattern) ⇒ Array
List files matching a pattern without extracting
53 54 55 56 57 |
# File 'lib/omnizip/extraction.rb', line 53 def list_matching(archive, pattern) filter = build_filter(pattern) extractor = SelectiveExtractor.new(archive, filter) extractor.list_matches end |
.match_result(archive, pattern) ⇒ Models::MatchResult
Get match result with statistics
87 88 89 90 91 |
# File 'lib/omnizip/extraction.rb', line 87 def match_result(archive, pattern) filter = build_filter(pattern) extractor = SelectiveExtractor.new(archive, filter) extractor.match_result end |