Module: MetaProject::Patois

Defined in:
lib/meta_project/patois/parser.rb

Overview

Patois is a domain specific language (DSL) for configuration and release management. It was first implemented by <a href=“projects.edgewall.com/trac/browser/trunk/contrib/trac-post-commit-hook”>Trac</a> and this class is a Ruby port of that Python code.

A similar idea was created by the DamageControl team in <a href=“jira.codehaus.org/browse/DC-159”>DC-159</a> before it was implemented in Trac, but the Trac team beat the DamageControl to implement it.

Anyhow, by giving this mini DSL a name and some better profiling we hope its adoption will increase. Patois means:

  • a dialect other than the standard or literary dialect

  • uneducated or provincial speech

  • the characteristic special language of an occupational or social group

Patois’ intended usage is in SCM commit messages. A patois-aware system can parse the commit messages and try to recognise patois expressions and take appropriate actions.

Here is a little taste of what you can say and do with Patois.

General form

command #1
command #1, #2
command #1 & #2
command #1 and #2    # == Closing issues in an issue tracker

You can have more than one command in a message. The following commands are supported. There is more than one spelling for each command, to make this as user-friendly as possible.

close, closed, closes, fix, fixed, fixes
  The specified issues are closed with the contents of the
  commit message being added to it.

addresses, re, ref, references, refs, see
  The specified issues are left in their current status, but
  the contents of the commit message are added to their notes.

A fairly complicated example of what you can do is with a commit message of:

Changed blah and foo to do this or that. Fixes #10 and #12, and refs #12.

This will close #10 and #12, and add a note to #12

Defined Under Namespace

Classes: Parser