def write_page(name, format, data, commit = {}, dir = '')
      # spaces must be dashes
      sanitized_name = name.gsub(' ', '-')
      sanitized_dir  = dir.gsub(' ', '-')
      sanitized_dir  = ::File.join([@page_file_dir, sanitized_dir].compact)

      multi_commit = !!commit[:committer]
      committer    = multi_commit ? commit[:committer] : Committer.new(self, commit)

      filename = Gollum::Page.cname(sanitized_name)

      committer.add_to_index(sanitized_dir, filename, format, data)

      committer.after_commit do |index, _sha|
        @access.refresh
        index.update_working_dir(sanitized_dir, filename, format)
      end

      multi_commit ? committer : committer.commit
    end
def write_page(name, format, data, commit = {}, dir = '')
      # spaces must be dashes
      sanitized_name = name.gsub(' ', '-')
      sanitized_dir  = dir.gsub(' ', '-')
      sanitized_dir  = ::File.join([@page_file_dir, sanitized_dir].compact)

      multi_commit = !!commit[:committer]
      committer    = multi_commit ? commit[:committer] : Committer.new(self, commit)

      filename = Gollum::Page.cname(sanitized_name)

      committer.add_to_index(sanitized_dir, filename, format, data)

      committer.after_commit do |index, _sha|
        @access.refresh
        index.update_working_dir(sanitized_dir, filename, format)
      end

      multi_commit ? committer : committer.commit
    end
Public: Write a new version of a page to the Gollum repo root.

 name   - The String name of the page.
 format - The Symbol format of the page.
 data   - The new String contents of the page.
 commit - The commit Hash details:
          :message   - The String commit message.
          :name      - The String author full name.
          :email     - The String email address.
          :parent    - Optional Gollum::Git::Commit parent to this update.
          :tree      - Optional String SHA of the tree to create the
                       index from.
          :committer - Optional Gollum::Committer instance.  If provided,
                       assume that this operation is part of batch of
                       updates and the commit happens later.
 dir    - The String subdirectory of the Gollum::Page without any
          prefix or suffix slashes (e.g. "foo/bar").
 Returns the String SHA1 of the newly written version, or the
 Gollum::Committer instance if this is part of a batch update.