You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: builder.rb
    path of file: ./repos/powerstation/powerstation/lib/compiled-jruby/lib/ruby/stdlib/rubygems/ext
    
    the code of the file until where you have to start completion: #--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and othe
    
  def build_extension extension, dest_path # :nodoc:
    results = []

    extension ||= '' # I wish I knew why this line existed
    extension_dir =
      File.expand_path File.join @gem_dir, File.dirname(extension)
    lib_dir = File.join @spec.full_gem_path, @spec.raw_require_paths.first

    builder = builder_for extension

    begin
      FileUtils.mkdir_p dest_path

      CHDIR_MUTEX.synchronize do
        Dir.chdir extension_dir do
          results = builder.build(extension, @gem_dir, dest_path,
                                  results, @build_args, lib_dir)

          verbose { results.join("\n") }
        end
      end

      write_gem_make_out results.join "\n"
    rescue => e
      results << e.message
      build_error extension_dir, results.join("\n"), $@
    end