Sha256: 5667e99868051c98d27f13d01497e32b06532e08f20fced475dc00c93eaf21dd
Contents?: true
Size: 848 Bytes
Versions: 5
Compression:
Stored size: 848 Bytes
Contents
require 'reek/source/core_extras' module Reek module Source # # Finds Ruby source files in a filesystem. # class SourceLocator def initialize(paths) @paths = paths.map {|path| path.chomp('/') } end def all_sources valid_paths.map {|path| File.new(path).to_reek_source } end private def all_ruby_source_files(paths) paths.map do |path| if test ?d, path all_ruby_source_files(Dir["#{path}/**/*.rb"]) else path end end.flatten.sort end def valid_paths all_ruby_source_files(@paths).select do |path| if test ?f, path true else $stderr.puts "Error: No such file - #{path}" false end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems