Whether the given file should be treated as a Haml file.

 @param file [String]
 @return [Boolean]
162318
def haml_file?(file)
      return false unless ::FileTest.file?(file)

      VALID_EXTENSIONS.include?(::File.extname(file))
    end
1172581
def loadfile
      valid_existing_file?(@file)

      results = Threshold::Parser.new(@file)
      @stored_hash= results.filehash
      #puts stored_hash
      results.caps.each do |result|
        builder = Threshold::Builder.new(result)
        self << builder.build
      end

    end
767019
function(file) {
    var filePath = path.resolve(file);

    if (filePath) {
      if (!fs.existsSync(filePath)) {
        fse.ensureFileSync(filePath);
      }
      return filePath;
    }

    return false;
  }
705989
public boolean filterFile(File file)
    {
        String strName = file.getName();
        if (!strName.endsWith(".java"))
            return false;
        return super.filterFile(file);
    }
699408
def is_file?(string)
      return false if string.is_a?(StringIO)
      !File.directory?(string) && File.exists?(File.expand_path(string))
    rescue
      false
    end
927098
def flush
      begin
        valid_existing_file?(@file)
        raise ReadOnlyThresholdsFile if @readonly
        hash = current_hash
        file = File.open(@file, 'w+')
        raise ThresholdAtomicLockFailure, 'The @file state/hash changed before we could flush the file' unless stored_hash == hash
        file.write self.sort.to_s
        file.close

      rescue NonExistantThresholdFile
        raise ReadOnlyThresholdsFile if @readonly
        file = File.open(@file, 'w')
        file.write self.sort.to_s
        file.close
      end

      stored_hash=current_hash
      return true
    end
1322433
def find_gem_file(rubygem, file)
      begin gem(rubygem); rescue Exception; end
      (dir = $:.find {|e| File.exist?(File.join(e, file)) }) && File.join(dir, file)
    end
64122
def parse_file path, matcher
      File.open(path) do |f|
        f.each do |line|
          if m = matcher.call(line)
            return m
          end
        end
      end

      raise "#{path}: found no matching lines."
    end
389673
def validate_config_file(configfile = location)
      @log.debug "validating config file"
      unless File.file?(configfile)
        @log.error "configuration file not found at: #{configfile}"
        raise Autosign::Exceptions::NotFound
      end

      # check if file is world-readable
      if File.world_readable?(configfile) or File.world_writable?(configfile)
        @log.error "configuration file #{configfile} is world-readable or world-writable, which is a security risk"
        raise Autosign::Exceptions::Permissions
      end

      configfile
    end
1159189
def from_file(filename, encoding='utf-8')
      mode = "rb:#{encoding}"
      mode = "rb" if RUBY_VERSION < '1.9'
      input = File.open(filename, mode) {|f| f.read() }
      compile(parse(input), filename, 1)
      return self
    end
401338
def parse_gemfile
      gemfile = File.join(Rails.root, 'Gemfile')
      @gem_lines = IO.readlines(gemfile).select{|line| line =~ /\A\s*gem/ }
    end
1308709
function isIgnoredFile(file) {
    if (options.ignore !== undefined) {
      var result = false;

      options.ignore.forEach(function(pattern) {
        if (minimatch(file, pattern)) {
          result = true;
          return false;
        }
      });

      return result;
    }

    return false;
  }
577309
def has_open_file(self, file_object):
        
        return (file_object in [wrappers[0].get_object()
                                for wrappers in self.open_files if wrappers])
13172
def load(file)
      if File.exist? file
        symbolize_keys(YAML.load_file(File.expand_path('.', file)))
      else
        {}
      end
    end
61900
def excluded_file?(file)
      full_path = File.expand_path(file)
      options.fetch(:excluded_files) { [] }.any? do |file_to_exclude|
        File.fnmatch(file_to_exclude, full_path)
      end
    end
815323
private boolean isArchive(Path file) {
        String n = StringUtils.toLowerCase(file.getFileName().toString());
        return fsInfo.isFile(file)
                && (n.endsWith(".jar") || n.endsWith(".zip"));
    }
374182
def is_binary_file(file):
    

    file_handle = open(file, "rb")
    try:
        chunk_size = 1024
        while True:
            chunk = file_handle.read(chunk_size)
            if chr(0) in chunk:
                return True
            if len(chunk) < chunk_size:
                break
    finally:
        file_handle.close()
    return False