Class: Datafile::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/sportdb/formats/datafile_package.rb

Overview

use a shared base class for DirPackage, ZipPackage, etc.

Direct Known Subclasses

DirPackage, ZipPackage

Constant Summary collapse

EXCLUDE_RE =

exclude pattern

for now exclude all files in directories starting with a dot (e.g. .git/ or .github/ or .build/ etc.)
todo/check: rename to EXCLUDE_DOT_DIRS_RE - why? why not?
%r{  (?: ^|/ )               # beginning (^) or beginning of path (/)
   \.[a-zA-Z0-9_-]+  ## (almost) any name BUT must start with dot e.g.  .git, .build, etc.
   /
}x

Class Method Summary collapse

Class Method Details

.match_exclude(path, pattern: EXCLUDE_RE) ⇒ Object Also known as: match_exclude?, exclude?



13
# File 'lib/sportdb/formats/datafile_package.rb', line 13

def self.match_exclude( path, pattern: EXCLUDE_RE ) pattern.match( path ); end