Class: CC::Analyzer::IncludePathsBuilder

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

Defined Under Namespace

Classes: Directory

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cc_exclude_paths) ⇒ IncludePathsBuilder

Returns a new instance of IncludePathsBuilder.



12
13
14
# File 'lib/cc/analyzer/include_paths_builder.rb', line 12

def initialize(cc_exclude_paths)
  @cc_exclude_paths = cc_exclude_paths
end

Class Method Details

.relevant_entries(path) ⇒ Object



6
7
8
9
10
# File 'lib/cc/analyzer/include_paths_builder.rb', line 6

def self.relevant_entries(path)
  Dir.entries(path).reject do |e|
    %w(. .. .git).include?(e)
  end
end

Instance Method Details

#buildObject



16
17
18
19
20
21
22
# File 'lib/cc/analyzer/include_paths_builder.rb', line 16

def build
  root = Directory.new('.', ignored_files)
  paths = root.included_paths
  paths.each do |path|
    raise_on_unreadable_files(path)
  end
end