def target_files_in_dir(base_dir = Dir.pwd)
      # Support Windows: Backslashes from command-line -> forward slashes
      if File::ALT_SEPARATOR
        base_dir = base_dir.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
      end
      all_files = find_files(base_dir, File::FNM_DOTMATCH)
      hidden_files = Set.new(all_files - find_files(base_dir, 0))
      base_dir_config = @config_store.for(base_dir)

      target_files = all_files.select do |file|
        to_inspect?(file, hidden_files, base_dir_config)
      end

      # Most recently modified file first.
      target_files.sort_by! { |path| -Integer(File.mtime(path)) } if fail_fast?

      target_files
    end
def target_files_in_dir(base_dir = Dir.pwd)
      # Support Windows: Backslashes from command-line -> forward slashes
      if File::ALT_SEPARATOR
        base_dir = base_dir.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
      end
      all_files = find_files(base_dir, File::FNM_DOTMATCH)
      hidden_files = Set.new(all_files - find_files(base_dir, 0))
      base_dir_config = @config_store.for(base_dir)

      target_files = all_files.select do |file|
        to_inspect?(file, hidden_files, base_dir_config)
      end

      # Most recently modified file first.
      target_files.sort_by! { |path| -Integer(File.mtime(path)) } if fail_fast?

      target_files
    end
Finds all Ruby source files under the current or other supplied
 directory. A Ruby source file is defined as a file with the `.rb`
 extension or a file with no extension that has a ruby shebang line
 as its first line.
 It is possible to specify includes and excludes using the config file,
 so you can include other Ruby files like Rakefiles and gemspecs.
 @param base_dir Root directory under which to search for
   ruby source files
 @return [Array] Array of filenames