Class: CC::Analyzer::IncludePathsBuilder::Directory

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

Instance Method Summary collapse

Constructor Details

#initialize(path, excluded_files) ⇒ Directory

Returns a new instance of Directory.



74
75
76
77
# File 'lib/cc/analyzer/include_paths_builder.rb', line 74

def initialize(path, excluded_files)
  @path = path
  @excluded_files = ensure_hashified(excluded_files)
end

Instance Method Details

#all_included?Boolean

Returns:

  • (Boolean)


79
80
81
82
83
# File 'lib/cc/analyzer/include_paths_builder.rb', line 79

def all_included?
  readable_by_all? &&
    files_all_included? &&
    subdirectories_all_included?
end

#included_pathsObject



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/cc/analyzer/include_paths_builder.rb', line 85

def included_paths
  if all_included?
    [@path + "/"]
  elsif readable_by_all?
    result = []
    result += included_file_entries
    result += included_subdirectory_results
    result
  else
    []
  end
end