Uses given args to list the feature files to run. It will find a single
 feature, features in a folder and subfolders or every feature file in the
 feature path.

 @return [Array]
   An array with the feature file names.

 @api public
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
271754
def find(path)
      results = []
      Find.find(path) do |fpath|
        if FileTest.directory?(fpath)
          next unless ignores

          ignores.each do |ignore|
            next unless fpath.include?(ignore.realpath.to_s)

            puts "Ignoring Directory: #{fpath}" if options[:verbose]
            Find.prune
          end
        end
        results << fpath if yield fpath
      end
      results
    end
216777
def which(prog, path = ENV['PATH'])
      path.split(File::PATH_SEPARATOR).each do |dir|
        file = File.join(dir, prog)
        return file if File.executable?(file) && !File.directory?(file)
      end

      nil
    end
396153
def css
      css_files = []
      @assets.each do |type, path|
        case type
          when :folder
            # Don't import any css/scss files that start with an underscore, so scss partials
            # aren't imported by default:
            #  http://sass-lang.com/guide
            base_path = base(path)
            css_files += Dir["#{path}/**/[^_]*.{css,scss,sass}"].sort.map do |folder|
              local_path = folder[path.size..-1].gsub(/[.](scss|sass)$/, '')
              css_path = @app_url + '/' + base_path + local_path
              css_path += '.css' unless css_path =~ /[.]css$/
              css_path
            end
          when :css_file
            css_files << path
        end
      end

      css_files.uniq
    end
396159
def default_load_paths
      paths = []

      # Check for Rails config path
      paths << "#{::Rails.root}/config" if rails?

      # Check for defined constants
      paths << CONFIG_ROOT if defined?(CONFIG_ROOT) && Dir.exists?(CONFIG_ROOT)
      paths << CONFIG_PATH if defined?(CONFIG_PATH) && Dir.exists?(CONFIG_PATH)

      # Check for config directory in app root
      config_dir = File.join(app_root, 'config')
      paths << config_dir if Dir.exists?(config_dir)

      paths
    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
736859
def include_all_subfiles(*args):
    
    file_list = []
    for path_included in args:
        local_path = path.join(HERE, path_included)

        for file in listdir(local_path):
            file_abspath = path.join(local_path, file)
            if path.isdir(file_abspath):    #do not include sub folders
                continue
            file_list.append(path_included + '/' + file)

    return file_list
642377
def watchable_args #:nodoc:
      files, dirs = config.watchable_files.dup, config.watchable_dirs.dup

      ActiveSupport::Dependencies.autoload_paths.each do |path|
        dirs[path.to_s] = [:rb]
      end

      [files, dirs]
    end
600560
def generate
      Dir["app/models/*.rb"].each do |path|
        result = File.basename(path).scan(/^(.+)\.rb/)[0][0]
        model = eval(ActiveSupport::Inflector.camelize(result))
        next if model.respond_to?(:abstract_class) && model.abstract_class
        next unless model < ActiveRecord::Base
        @annotations[model] = generate_annotation(model) unless @annotations.keys.include?(model)
      end
    end
446782
def root_folders
        @root_folders ||= Dir.glob("#{Dir.pwd}/*", File::FNM_DOTMATCH).collect do |f|
          File.basename(f) if File.directory?(f)
        end.reject { |dir| %w(. ..).include?(dir) }.compact!
      end
234589
def asset_folders
      folders = []
      app_folders do |app_folder|
        Dir["#{app_folder}/*/assets"].sort.each do |asset_folder|
          folders << yield(asset_folder)
        end
      end

      folders.flatten
    end
677996
def each
      dirs = ["pairtree_root"]
      excludes = []
      for dir in dirs
        Find.find(dir) do |path|
          if FileTest.directory?(path)
            if excludes.include?(File.basename(path))
              Find.prune       # Don't look any further into this directory.
            else
              next
            end
          else
            p path
          end
        end
      end   
    end
304039
def step_definition_files
      Dir.glob(
        File.expand_path File.join(step_definitions_path, '**', '*.rb')
      ).sort{|a,b| [b.count(File::SEPARATOR), a] <=> [a.count(File::SEPARATOR), b]}
    end
260940
def get_files
        return @dir.values.map do |dir|
          next get_files_recursively_from dir
        end .reject { |x| !x } .flatten
      end
689992
def find_features
    @features = if params[ :only ]
      params[ :only ].to_s.split( "," ).collect( &:to_sym ).uniq

    elsif skip = params[ :skip ] || params[ :exclude ]
      monitored_features.keys - skip.to_s.split( "," ).collect( &:to_sym )

    else
      monitored_features.keys
    end
  end
124267
private String findPathToGems() throws FileNotFoundException {
        String[] commandParams = cli.getCommandParams(GEM, ENVIRONMENT);
        List<String> lines = cli.runCmd(rootDirectory, commandParams);
        String path = null;
        if (!lines.isEmpty()) {
            path = lines.get(0) + fileSeparator + CACHE;
            if (new File(path).isDirectory() == false) {
                throw new FileNotFoundException();
            }
        }
        return path;
    }
1033439
def find_file(filenames)
      return nil if filenames.nil?

      filenames.each_value do |value|
        if value.is_a? Array
          value.each do |file|
            file_path = Utils.lookup_file file
            return file_path unless file_path.nil?
          end
        else
          file_path = Utils.lookup_file value
          return file_path unless file_path.nil?
        end
      end

      nil
    end