lib/reek/source/source_locator.rb in reek-1.3.8 vs lib/reek/source/source_locator.rb in reek-1.4.0
- old
+ new
@@ -1,36 +1,35 @@
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('/') }
+ @paths = paths.map { |path| path.chomp('/') }
end
def all_sources
- valid_paths.map {|path| File.new(path).to_reek_source }
+ valid_paths.map { |path| File.new(path).to_reek_source }
end
- private
+ private
def all_ruby_source_files(paths)
paths.map do |path|
- if test ?d, 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
+ if test 'f', path
true
else
$stderr.puts "Error: No such file - #{path}"
false
end