add_release (RubyForge)

    # File lib/rubyforge.rb, line 261
      def add_release(group_id, package_id, release_name, *files)
        userfile = files.shift
        page = "/frs/admin/qrs.php"

        group_id        = lookup "group", group_id
        package_id      = lookup "package", package_id
        userfile        = open userfile, 'rb'
        release_date    = @userconfig["release_date"]
        type_id         = @userconfig["type_id"]
        processor_id    = @userconfig["processor_id"]
        release_notes   = @userconfig["release_notes"]
        release_changes = @userconfig["release_changes"]
        preformatted    = @userconfig["preformatted"]

        release_date ||= Time.now.strftime("%Y-%m-%d %H:%M")

        type_id ||= userfile.path[%r|\.[^\./]+$|]
        type_id = (lookup "type", type_id rescue lookup "type", ".oth")

        processor_id ||= "Any"
        processor_id = lookup "processor", processor_id

        release_notes = IO::read(release_notes) if
          test(?e, release_notes) if release_notes

        release_changes = IO::read(release_changes) if
          test(?e, release_changes) if release_changes

        preformatted = preformatted ? 1 : 0

        form = {
          "group_id"        => group_id,
          "package_id"      => package_id,
          "release_name"    => release_name,
          "release_date"    => release_date,
          "type_id"         => type_id,
          "processor_id"    => processor_id,
          "release_notes"   => release_notes,
          "release_changes" => release_changes,
          "preformatted"    => preformatted,
          "userfile"        => userfile,
          "submit"          => "Release File"
        }

        boundary = Array::new(8){ "%2.2d" % rand(42) }.join('__')
        boundary = "multipart/form-data; boundary=___#{ boundary }___"

        html = run(page, form, 'content-type' => boundary)
        raise "Invalid package_id #{package_id}" if html[/Invalid package_id/]
        raise "You have already released this version." if html[/That filename already exists in this project/]

        release_id = html[/release_id=\d+/][/\d+/].to_i rescue nil

        unless release_id then
          puts html if $DEBUG
          raise "Couldn't get release_id, upload failed\?"
        end

        puts "RELEASE ID = #{release_id}" if $DEBUG

        files.each do |file|
          add_file(group_id, package_id, release_id, file)
        end

        package_name = @autoconfig["package_ids"].invert[package_id]
        raise "unknown package name for #{package_id}" if package_name.nil?
        @autoconfig["release_ids"][package_name] ||= {}
        @autoconfig["release_ids"][package_name][release_name] = release_id
        save_autoconfig

        release_id
      end