Class: Caramelize::InputWiki::WikkaWiki
- Includes:
- DatabaseConnector
- Defined in:
- lib/caramelize/input_wiki/wikka_wiki.rb
Constant Summary collapse
- SQL_PAGES =
'SELECT id, tag, body, time, latest, user, note FROM wikka_pages ORDER BY time;'- SQL_AUTHORS =
'SELECT name, email FROM wikka_users;'- FUNCTION_PAGES =
%w[AdminBadWords AdminPages AdminUsers AdminSpamLog CategoryAdmin CategoryCategory CategoryWiki DatabaseInfo FormattingRules HighScores InterWiki MyChanges MyPages OrphanedPages OwnedPages PageIndex PasswordForgotten RecentChanges RecentlyCommented Sandbox SysInfo TableMarkup TableMarkupReference TextSearch TextSearchExpanded UserSettings WantedPages WikiCategory WikkaInstaller WikkaConfig WikkaDocumentation WikkaMenulets WikkaReleaseNotes].freeze
Instance Attribute Summary
Attributes inherited from Wiki
#description, #namespaces, #options, #revisions, #titles, #wiki_title
Instance Method Summary collapse
- #excluded_pages ⇒ Object
-
#initialize(options = {}) ⇒ WikkaWiki
constructor
A new instance of WikkaWiki.
- #read_authors ⇒ Object
-
#read_pages ⇒ Object
after calling this action, titles and @revisions are expected to be filled.
Methods included from DatabaseConnector
Methods inherited from Wiki
#authors, #convert_markup?, #filters, #latest_revisions, #markup, #revisions_by_title
Constructor Details
#initialize(options = {}) ⇒ WikkaWiki
Returns a new instance of WikkaWiki.
16 17 18 19 20 21 22 |
# File 'lib/caramelize/input_wiki/wikka_wiki.rb', line 16 def initialize( = {}) super() [:markup] = :wikka [:filters] << ::Caramelize::AddNewlineToPageEnd [:filters] << ::Caramelize::WikkaToMarkdown [:filters] << ::Caramelize::CamelCaseToWikiLinks end |
Instance Method Details
#excluded_pages ⇒ Object
41 42 43 |
# File 'lib/caramelize/input_wiki/wikka_wiki.rb', line 41 def excluded_pages FUNCTION_PAGES end |
#read_authors ⇒ Object
34 35 36 37 38 39 |
# File 'lib/caramelize/input_wiki/wikka_wiki.rb', line 34 def results = database.query() results.each do |row| [row['name']] = { name: row['name'], email: row['email'] } end end |
#read_pages ⇒ Object
after calling this action, titles and @revisions are expected to be filled
25 26 27 28 29 30 31 32 |
# File 'lib/caramelize/input_wiki/wikka_wiki.rb', line 25 def read_pages pages.each do |row| titles << row['tag'] revisions << Page.new(build_properties(row)) end titles.uniq! revisions end |