Class: RubyCritic::SourceLocator

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/source_locator.rb

Constant Summary collapse

RUBY_EXTENSION =
'.rb'.freeze
RUBY_FILES =
File.join('**', "*#{RUBY_EXTENSION}")
RUBY_SHEBANG =
'#!/usr/bin/env ruby'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ SourceLocator

Returns a new instance of SourceLocator.



12
13
14
# File 'lib/rubycritic/source_locator.rb', line 12

def initialize(paths)
  @initial_paths = Array(paths)
end

Instance Method Details

#pathnamesObject



20
21
22
# File 'lib/rubycritic/source_locator.rb', line 20

def pathnames
  @pathnames ||= expand_paths
end

#pathsObject



16
17
18
# File 'lib/rubycritic/source_locator.rb', line 16

def paths
  @paths ||= pathnames.map(&:to_s)
end