Class: WikiAvro::MediaWiki::WikiWriter
- Inherits:
-
Object
- Object
- WikiAvro::MediaWiki::WikiWriter
- Defined in:
- lib/wikiavro/mediawiki.rb
Instance Method Summary collapse
- #done ⇒ Object
-
#initialize(writers) ⇒ WikiWriter
constructor
A new instance of WikiWriter.
- #lqt(threadSubject, threadParent, threadAncestor, threadPage, threadID, threadSummaryPage, threadAuthor, threadEditStatus, threadType, threadSignature) ⇒ Object
- #namespace(key, casetype, name) ⇒ Object
- #page(ns, id, title, redirect, sha1) ⇒ Object
- #revision(id, page_id, n, timestamp, contributor, minor, comment, text_deleted, bytes, textid, text) ⇒ Object
- #skipped(name) ⇒ Object
Constructor Details
#initialize(writers) ⇒ WikiWriter
Returns a new instance of WikiWriter.
56 57 58 59 60 61 62 63 |
# File 'lib/wikiavro/mediawiki.rb', line 56 def initialize(writers) null_writer = NullWriter.new @namespace = (writers[:namespace] or NamespacePrinter.new) @logger = (writers[:logger] or NoProgress.new) @page = (writers[:page] or NullWriter.new) @revision = (writers[:revision] or NullWriter.new) @lqt = (writers[:lqt] or NullWriter.new) end |
Instance Method Details
#done ⇒ Object
91 92 93 |
# File 'lib/wikiavro/mediawiki.rb', line 91 def done @logger.report_done end |
#lqt(threadSubject, threadParent, threadAncestor, threadPage, threadID, threadSummaryPage, threadAuthor, threadEditStatus, threadType, threadSignature) ⇒ Object
81 82 83 84 85 86 87 88 89 |
# File 'lib/wikiavro/mediawiki.rb', line 81 def lqt(threadSubject, threadParent, threadAncestor, threadPage, threadID, threadSummaryPage, threadAuthor, threadEditStatus, threadType, threadSignature) @lqt.write(threadSubject, threadParent, threadAncestor, threadPage, threadID, threadSummaryPage, threadAuthor, threadEditStatus, threadType, threadSignature) end |
#namespace(key, casetype, name) ⇒ Object
65 66 67 |
# File 'lib/wikiavro/mediawiki.rb', line 65 def namespace(key, casetype, name) @namespace.write(key, casetype, name) end |
#page(ns, id, title, redirect, sha1) ⇒ Object
69 70 71 72 |
# File 'lib/wikiavro/mediawiki.rb', line 69 def page(ns, id, title, redirect, sha1) @logger.report_pages(1) @page.write(ns, id, title, redirect, sha1) end |
#revision(id, page_id, n, timestamp, contributor, minor, comment, text_deleted, bytes, textid, text) ⇒ Object
74 75 76 77 78 79 |
# File 'lib/wikiavro/mediawiki.rb', line 74 def revision(id, page_id, n, , contributor, minor, comment, text_deleted, bytes, textid, text) @logger.report_revisions(1) @revision.write(id, page_id, n, , contributor, minor, comment, text_deleted, bytes, textid, text) end |
#skipped(name) ⇒ Object
95 96 97 98 99 |
# File 'lib/wikiavro/mediawiki.rb', line 95 def skipped(name) # puts "wikiwriter: skipped element #{name}" # raise 'what?' @logger.report_skipped_element(name) end |