def util_build_gem(spec)
    dir = spec.gem_dir
    FileUtils.mkdir_p dir

    Dir.chdir dir do
      spec.files.each do |file|
        next if File.exist? file
        FileUtils.mkdir_p File.dirname(file)
        File.open file, 'w' do |fp| fp.puts "# #{file}" end
      end

      use_ui Gem::MockGemUi.new do
        Gem::Builder.new(spec).build
      end

      cache = spec.cache_file
      FileUtils.mv File.basename(cache), cache
    end
  end
#
Builds a gem from +spec+ and places it in <tt>File.join @gemhome,
'cache'</tt>.  Automatically creates files based on +spec.files+