FTB-Gamepedia / MediaWiki-Butt-Ruby

A Ruby library for the MediaWiki API
https://rubygems.org/gems/mediawiki-butt
MIT License
9 stars 2 forks source link

Implement patrol API support #76

Closed elifoster closed 4 years ago

elifoster commented 5 years ago

New #patrol method in the Edit module, with respective PatrolError.

Patrolling is done by providing a rcid or a revid in an options hash.

Example usages:

@mw.patrol(rcid: 12742)
# => "Test Page"

@mw.patrol(revid: 134191)
# => "Test Page 2"

@mw.patrol(rcid: -2391823)
# => PatrolError: nosuchrcid

@mw.patrol(revid: 134191, tags: ['Tag 1', 'Tag 2', 'Tag 3'])
# => "Test Page 2"

@mw.patrol(rcid: 12742, tags: 'Tag 1|Tag 2|Tag 3')
# => "Test Page"