Class: Slimembedcop::PathFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/slimembedcop/path_finder.rb

Overview

Collect file paths from given path patterns.

Instance Method Summary collapse

Constructor Details

#initialize(options, config) ⇒ PathFinder

Returns a new instance of PathFinder.



9
10
11
12
13
# File 'lib/slimembedcop/path_finder.rb', line 9

def initialize(options, config)
  @default_patterns = options.default_path_patterns
  @exclude_patterns = config.for_all_cops['Exclude'] || []
  @path_patterns = options.args
end

Instance Method Details

#runObject



15
16
17
# File 'lib/slimembedcop/path_finder.rb', line 15

def run
  matching_paths(patterns) { |path| !excluded?(path) }.sort
end