lib/caramelize/output_wiki/gollum.rb in caramelize-0.4.0 vs lib/caramelize/output_wiki/gollum.rb in caramelize-1.0.0

- old
+ new

@@ -1,6 +1,5 @@ -require 'caramelize/ext' module Caramelize module OutputWiki class Gollum attr_reader :wiki_path @@ -25,10 +24,15 @@ else gollum.write_page(page.title, markup, page.body, build_commit(page)) end end + def rename_page(page_title, rename) + gollum_page = gollum.page(page_title) + gollum.rename_page(gollum_page, rename, { message: 'Rename home page' }) + end + # Commit all revisions of the given history into this gollum-wiki-repository. def commit_history(revisions, options = {}, &block) revisions.each_with_index do |page, index| # call debug output from outside block.call(page, index) if block_given? @@ -45,29 +49,30 @@ end def build_commit(page) { message: page.commit_message, - name: page.author_name, - email: page.author_email, - authored_date: page.time, - committed_date: page.time + name: page.author.name, + email: page.author.email, + time: page.time } end private def build_namespace_overview(namespaces) ::Caramelize::Services::PageBuilder.build_namespace_overview(namespaces) end def gollum - @gollum ||= ::Gollum::Wiki.new(wiki_path) + @gollum ||= ::Gollum::Wiki.new(wiki_path, {repo_is_bare: true}) end def initialize_repository return if File.exists?(wiki_path) - Grit::Repo.init(wiki_path) + Dir.mkdir(wiki_path) + #::Gollum::Git::Repo.new(wiki_path, { is_bare: true }) + ::Gollum::Git::Repo.init(wiki_path) end end end end