    # File lib/rubygems/installer.rb, line 441
      def extract_files
        expand_and_validate_gem_dir

        raise ArgumentError, "format required to extract from" if @format.nil?

        @format.file_entries.each do |entry, file_data|
          path = entry['path'].untaint

          if path =~ /\A\// then # for extra sanity
            raise Gem::InstallError,
                  "attempt to install file into #{entry['path'].inspect}"
          end

          path = File.expand_path File.join(@gem_dir, path)

          if path !~ /\A#{Regexp.escape @gem_dir}/ then
            msg = "attempt to install file into %p under %p" %
                    [entry['path'], @gem_dir]
            raise Gem::InstallError, msg
          end

          FileUtils.mkdir_p File.dirname(path)

          File.open(path, "wb") do |out|
            out.write file_data
          end

          FileUtils.chmod entry['mode'], path

          say path if Gem.configuration.really_verbose
        end
      end