Class: Treebis::DirAsHash::Blacklist::GlobNodeMatcherDeep

Inherits:
GlobNodeMatcher show all
Defined in:
lib/treebis.rb

Instance Method Summary collapse

Methods inherited from GlobNodeMatcher

get, #head_include?

Methods included from MatcherFactory

#create_matcher

Methods inherited from MatcherWithTail

#tail=

Constructor Details

#initialize(globtoken, tail) ⇒ GlobNodeMatcherDeep

Returns a new instance of GlobNodeMatcherDeep.



292
293
294
295
296
# File 'lib/treebis.rb', line 292

def initialize globtoken, tail
  /\*\*/ =~ globtoken or fail("not deep: #{globtoken.inspect}")
  tail or fail("for now deep globs must look like \"**/*.bar\"")
  self.tail = tail
end

Instance Method Details

#include?(str) ⇒ Boolean

Returns:

  • (Boolean)


298
299
300
# File 'lib/treebis.rb', line 298

def include? str
  @tail.include? str
end

#submatcher(str) ⇒ Object



301
302
303
# File 'lib/treebis.rb', line 301

def submatcher str
  self # you just keep travelling down the tree when you're '**'
end