Generate a list of target files by expanding globbing patterns
 (if any). If args is empty, recursively find all Ruby source
 files under the current directory
 @return [Array] array of file paths
176857
def find(args)
      return target_files_in_dir if args.empty?

      files = []

      args.uniq.each do |arg|
        files += if File.directory?(arg)
                   target_files_in_dir(arg.chomp(File::SEPARATOR))
                 else
                   process_explicit_path(arg)
                 end
      end

      files.map { |f| File.expand_path(f) }.uniq
    end
343281
def feature_files
      files_to_run = []

      @args.each do |arg|
        if arg.match(/\.feature/)
          if File.exists? arg.gsub(/:\d*/, '')
            files_to_run << arg
          else
            fail! "#{arg} could not be found"
          end
        elsif File.directory?(arg)
          files_to_run << Dir.glob(File.join(arg, '**', '*.feature'))
        elsif arg != "{}"
          fail! "invalid argument - #{arg}"
        end
      end

      if !files_to_run.empty?
        files_to_run.flatten
      else
        Dir.glob(File.join(Spinach.config[:features_path], '**', '*.feature'))
      end
    end
81975
def target_dir( f = nil )
      if File.exists?( config_file_path )
        form_file_name( target_dir_from_config, f )
      else
        form_file_name( File.join( ::Rails.root.to_s, 'public/docs' ), f )
      end
    end
1178392
def get_files_recursively_from directory
        dir = Pathname.new directory
        return nil  unless (dir.directory?)
        return dir.each_child.map do |file|
          next file.realpath.to_path            if (file.file?)
          next get_files_recursively_from file  if (file.directory?)
        end .flatten
      end
137070
def glob_all(path=nil)
        Dir.chdir path || '.' do
          Pathname.glob("**/*", context.include_hidden_files? ? File::FNM_DOTMATCH : 0).sort.reject do |p|
            %w(. ..).include?(p.basename.to_s)
          end
        end
      end
1141548
def load(pattern=nil)
      tests = []

      # Find all tests in the tests directory
      Find.find @@conf.test_root do |path|
        # recurse into all subdirectories
        next if File.directory? path

        # filter tests by pattern if present
        if pattern
          next unless rel_path(path).match(pattern)
        end

        # ignore dotfiles
        next if File.basename(path).match(/^\..*/)

        # ignore files in ignore filter
        next if ignored?(path)

        tests << Test.new(path)
      end

      return tests
    end
872305
def build(self, targets: Iterable[str]) -> Iterable[str]:
        
        return generate_source_directories(
            targets, build=self._build, prompt=self._prompt
        )
1068865
def each_file(&bl)
      unpack do |dir|
        Pathname.new(dir).find do |path|
          next if path.to_s == dir.to_s
          pathstr = path.to_s.gsub("#{dir}/", '')
          bl.call pathstr unless pathstr.blank?
        end
      end
    end
1233942
def _get_files_recursively(rootdir):
    
    output = []
    for root, dirs, files in os.walk(rootdir):
        for filename in files:
            output.append(os.path.join(root, filename))

    return output
920614
def pattern_with_glob_pattern(*pattern, **options)
      options[:uri_decode]    ||= false
      pattern                   = Mustermann.new(*pattern.flatten, **options)
      @glob_patterns          ||= {}
      @glob_patterns[pattern] ||= GlobPattern.generate(pattern)
      [pattern, @glob_patterns[pattern]]
    end
207406
def files
      cli_arguments.each_with_index do |filename, index|
        if Dir.exist?(filename)
          cli_arguments[index] = Dir["#{filename}/**/*.md"]
        end
      end
      cli_arguments.flatten!
      cli_arguments
    end
256246
def list_files(dir_path, recursive=True):
    

    for root, dirs, files in os.walk(dir_path):
        file_list = [os.path.join(root, f) for f in files]
        if recursive:
            for dir in dirs:
                dir = os.path.join(root, dir)
                file_list.extend(list_files(dir, recursive=True))
        return file_list
1004403
def directory_to_filenames(file_or_directory)
      directory = Dir.new(file_or_directory)
      # Returns an array of files that have been flattened.
      directory.map { |file| flatten_files(directory.path,file) }
    end
1048814
def image_files
      return [] if input.nil?
      valid_extensions = library::VALID_EXTENSIONS
      expansions = Array(valid_extensions).map{|ext| File.join(input, "**", "#{config[:glob]}.#{ext}")}
      files = SpriteFactory.find_files(*expansions)
      files = files.reject{ |file| exclude?(file) }
      files
    end
734221
function (files) {
    if (!_.isArray(files)) files = [files];
    return _.chain(files).map(fss.target).map(function (f) {
        if (!fss.directoryExists(f)) return f;
        return fss.allTargetFilePaths(f);
    }).flatten().uniq().reject(fss.isDotFile).map(pathSuffix).value();
}
444384
def files(self):
        
        # If no files but a recursion option ==> use the current directory
        if not self.args.files and self.recursive:
            return ['.']
        else:
            return self.args.files
104394
def createListRecursively(self,args):
        
        resultList = []
        dirDict = self.getDirectoryDictionary(args)
        for key in dirDict:
            for path,dirs,files in os.walk(key):    # Walk through the directory to find al	l input
                for d in dirs:
                    resultList.append(os.path.join(path,d))
                for f in files:    # Append the file if 'ALL' are allowed or the extension is allowed
                        pattern = dirDict[key].split(',')
                        if 'ALL' in pattern or os.path.splitext(f)[1] in pattern:
                            resultList.append(os.path.join(path,f))
        return list(set(resultList))