Class: CC::Analyzer::PathEntries

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

Instance Method Summary collapse

Constructor Details

#initialize(initial_path) ⇒ PathEntries

Returns a new instance of PathEntries.



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

def initialize(initial_path)
  @initial_path = initial_path.gsub(%r{/$}, "")
end

Instance Method Details

#entriesObject



8
9
10
11
12
13
14
15
16
# File 'lib/cc/analyzer/path_entries.rb', line 8

def entries
  if File.directory?(initial_path)
    all_entries.reject do |path|
      path.end_with?("/.") || path.start_with?(".git/")
    end
  else
    initial_path
  end
end