Class Trac::Wiki
In: lib/wiki.rb
Parent: Object

Methods

Public Class methods

[Source]

    # File lib/wiki.rb, line 28
28:     def initialize trac
29:       @trac = trac
30:     end

Public Instance methods

returns a list of all attachments of a page

[Source]

    # File lib/wiki.rb, line 64
64:     def attachments page
65:       @trac.query("wiki.listAttachments",page)
66:     end

deletes page with given name, returning true on success.

[Source]

    # File lib/wiki.rb, line 59
59:     def delete name
60:       @trac.query('wiki.deletePage',name)
61:     end

deletes attachment with given `path‘

[Source]

    # File lib/wiki.rb, line 82
82:     def delete_attachment path
83:       @trac.query("wiki.deleteAttachment",path)
84:     end

returns the content of an attachment

[Source]

    # File lib/wiki.rb, line 69
69:     def get_attachment path
70:       @trac.query("wiki.getAttachment",path)
71:     end

returns a whole page in HTML

[Source]

    # File lib/wiki.rb, line 43
43:     def get_html name
44:       @trac.query('wiki.getPageHTML',name)
45:     end

returns a whole page in raw format

[Source]

    # File lib/wiki.rb, line 48
48:     def get_raw name
49:       @trac.query('wiki.getPage',name)
50:     end

returns a list of all pages

[Source]

    # File lib/wiki.rb, line 33
33:     def list
34:       @trac.query('wiki.getAllPages')
35:     end

sends a page. if the page doesn‘t exist yet it is created otherwise it will be overwritten with the new content.

[Source]

    # File lib/wiki.rb, line 54
54:     def put name,content,attributes={ }
55:       @trac.query('wiki.putPage',name,content,attributes)
56:     end

uploads given `data’ as an attachment to given `page’. returns true on success. unlike the XMLRPC-Call this method defaults `replace’ to false as we don‘t want to destroy anything.

[Source]

    # File lib/wiki.rb, line 77
77:     def put_attachment page,filename,description,data,replace=false
78:       @trac.query("wiki.putAttachmentEx",page,filename,description,data,replace)
79:     end

convert a raw page to html (e.g. for preview)

[Source]

    # File lib/wiki.rb, line 38
38:     def raw_to_html content
39:       @trac.query('wiki.wikiToHtml',content)
40:     end

[Validate]