Class: CC::Analyzer::PathPatterns

Inherits:
Object
  • Object
show all
Defined in:
lib/cc/analyzer/path_patterns.rb

Instance Method Summary collapse

Constructor Details

#initialize(patterns, root = Dir.pwd) ⇒ PathPatterns

Returns a new instance of PathPatterns.



4
5
6
7
# File 'lib/cc/analyzer/path_patterns.rb', line 4

def initialize(patterns, root = Dir.pwd)
  @patterns = patterns
  @root = root
end

Instance Method Details

#expandedObject



13
14
15
# File 'lib/cc/analyzer/path_patterns.rb', line 13

def expanded
  @expanded ||= expand
end

#match?(path) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/cc/analyzer/path_patterns.rb', line 9

def match?(path)
  expanded.include?(path)
end