class Gem::Specification

def self.load file

def self.load file
  return unless file
  _spec = LOAD_CACHE[file]
  return _spec if _spec
  file = file.dup.untaint
  return unless File.file?(file)
  code = if defined? Encoding
           File.read file, :mode => 'r:UTF-8:-'
         else
           File.read file
         end
  code.untaint
  begin
    _spec = eval code, binding, file
    if Gem::Specification === _spec
      _spec.loaded_from = File.expand_path file.to_s
      LOAD_CACHE[file] = _spec
      return _spec
    end
    warn "[#{file}] isn't a Gem::Specification (#{_spec.class} instead)."
  rescue SignalException, SystemExit
    raise
  rescue SyntaxError, Exception => e
    warn "Invalid gemspec in [#{file}]: #{e}"
  end
  nil
end