Sha256: 3f366ae33654679c9173ec05840488bc06100e6cac9de05818f639c847b58842
Contents?: true
Size: 1.57 KB
Versions: 1
Compression:
Stored size: 1.57 KB
Contents
#Encoding: UTF-8 require 'gollum' require 'grit' module Caramelize autoload :Wiki, 'caramelize/wiki' autoload :WikkaWiki, 'caramelize/wikkawiki' autoload :RedmineWiki, 'caramelize/redmine_wiki' autoload :GollumOutput, 'caramelize/gollum_output' autoload :Wikka2MarkdownConverter, 'wikka2markdown_converter' autoload :Author, 'caramelize/author' autoload :Page, 'caramelize/page' # Controller for the content migration class ContentTransferer # Execute the content migration def self.execute original_wiki, options={} # read page revisions from wiki # store page revisions original_wiki.read_authors @revisions = original_wiki.read_pages # initiate new wiki output_wiki = GollumOutput.new('wiki.git') # commit page revisions to new wiki output_wiki.commit_history @revisions # if wiki needs to convert sytax, do so if original_wiki.convert_syntax? puts "latest revisions:" # take each latest revision for rev in original_wiki.latest_revisions puts "Updated syntax: #{rev.title} #{rev.time}" # parse markup & convert to new syntax body_new = original_wiki.convert2markdown rev.body unless body_new == rev.body rev.body = body_new rev.author_name = "Caramelize" rev.time = Time.now rev.author = nil # commit as latest page revision output_wiki.commit_revision rev end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
caramelize-0.0.3 | lib/caramelize/content_transferer.rb |