Method: CampfireExport::Transcript#export_html

Defined in:
lib/campfire_export.rb

#export_htmlObject



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/campfire_export.rb', line 265

def export_html
  begin
    transcript_html = get(transcript_path)

    # Make the upload links in the transcript clickable from the exported 
    # directory layout.
    transcript_html.gsub!(%Q{href="/room/#{room.id}/uploads/},
                          %Q{href="uploads/})
    # Likewise, make the image thumbnails embeddable from the exported
    # directory layout.
    transcript_html.gsub!(%Q{src="/room/#{room.id}/thumb/},
                          %Q{src="thumbs/})
    
    export_file(transcript_html, 'transcript.html')
    verify_export('transcript.html', transcript_html.length)
  rescue Exception => e
    log(:error, "HTML transcript export for #{export_dir} failed", e)
  end
end