class Rubycritic::SourceLocator
def expand_paths
def expand_paths @initial_paths.map do |path| if File.directory?(path) Pathname.glob(File.join(path, RUBY_FILES)) elsif File.exists?(path) && File.extname(path) == RUBY_EXTENSION Pathname.new(path) end end.flatten.compact.map(&:cleanpath).sort end
def initialize(paths)
def initialize(paths) @initial_paths = paths end
def pathnames
def pathnames @pathnames ||= expand_paths end
def paths
def paths @paths ||= pathnames.map(&:to_s) end