Class: Gitenv::FilesMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/gitenv/files/matcher.rb

Direct Known Subclasses

AllFiles, OneFile

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ FilesMatcher

Returns a new instance of FilesMatcher.



3
4
5
6
# File 'lib/gitenv/files/matcher.rb', line 3

def initialize options = {}
  @options = options
  @ignores = options[:ignores] ? [ options[:ignores] ].flatten : []
end

Instance Method Details

#except(*args) ⇒ Object



12
13
14
15
# File 'lib/gitenv/files/matcher.rb', line 12

def except *args
  @ignores.concat args
  self
end

#files(path) ⇒ Object



8
9
10
# File 'lib/gitenv/files/matcher.rb', line 8

def files path
  ignore Dir.entries(path)
end