# File lib/rubygems/format.rb, line 35
    def self.from_file_by_path(file_path, security_policy = nil)
      unless File.exist?(file_path)
        raise Gem::Exception, "Cannot load gem at [#{file_path}]"
      end
      require 'fileutils'
      # check for old version gem
      if File.read(file_path, 20).include?("MD5SUM =")
        #alert_warning "Gem #{file_path} is in old format."
        require 'rubygems/old_format'
        return OldFormat.from_file_by_path(file_path)
      else
        f = File.open(file_path, 'rb')
        return from_io(f, file_path, security_policy)
      end
    end