Extension:Katsa

MediaWiki extensions manual
OOjs UI icon advanced.svg
Katsa
Release status: experimental
'Beware of Spies' (cropped).jpg
Description Provides spies for Scribunto.
Author(s)
License GNU General Public License 2.0 or later
Download
README, LDoc
Translate the Katsa extension if it is available at translatewiki.net
Check usage and version matrix.

Katsa provides a framework for spies.

InstallationEdit

Katsa depends on modules from the Scribunto extension.

  • Download and place the file(s) in a directory called Katsa in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'Katsa' );
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

UsageEdit

The workflow for spies is to define a graph, and then call on that graph. The definition is done once, but the graph can be reused several times.

local spy = require 'spy'
local carp = spy.newCarp()
local cluck = spy.newCluck()
local croak = spy.newCroak()
local confess = spy.newConfess()

local h = {}

function h.carp()
	carp 'carp carp carp'             -- this will log a one-liner in the console
	cluck 'cluck cluck cluck'         -- this will log a full stack trace
	croak 'croak croak croak'         -- should just bug out and print a one-liner (but Scribuntos implementation of error() is weird)
	confess "confess confess confess" -- bug out and print a full stack trace
end

return h

For further help, see the generated LDoc documentation.

DevelopmentEdit

For recreating the Vagrant-based development environment, see Katsa: Topics/Vagrant.

See alsoEdit