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.



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

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

Instance Method Details

#except(*args) ⇒ Object



15
16
17
18
# File 'lib/gitenv/files/matcher.rb', line 15

def except *args
  @ignores.concat args
  self
end

#files(path) ⇒ Object



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

def files path
  ignore Dir.entries(path)
end