# Subject: jig 0.1.2 Released

**URL:** <https://www.ruby-forum.com/t/subject-jig-0-1-2-released/130525>\
**Category:** Ruby\
**Created:** [February 29, 2008, 12:53am UTC](https://www.ruby-forum.com/t/subject-jig-0-1-2-released/130525 "2008-02-29T00:53:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfharlock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f04885/32.png) [@pfharlock](https://www.ruby-forum.com/u/pfharlock)\
**Post date:** [February 29, 2008, 12:53am UTC](https://www.ruby-forum.com/t/subject-jig-0-1-2-released/130525/1 "2008-02-29T00:53:05Z")

</div>

jig version 0.1.2 has been released!

- [http://jig.rubyforge.org](http://jig.rubyforge.org)

A jig is an ordered sequence of objects (usually strings) and named  
_gaps_. When rendered as a string by Jig#to\_s, the objects are  
rendered calling #to\_s on each object in order. The gaps are skipped.

A new jig may be constructed from an existing jig by ‘plugging’ one  
or more of the named gaps. The new jig shares the objects and their  
ordering from the original jig but with the named gap replaced with  
the ‘plug’. Gaps may be plugged by any object or sequence of  
objects. When a gap is plugged with another jig, the contents  
(including gaps) are incorporated into the new jig.

Several subclasses (Jig::XML, Jig::XHTML, Jig::CSS) are defined to  
help in the construction of XML, XHTML, and CSS documents.

This is a jig with a single gap named :alpha.

Jig.new(:alpha) # =\> \<#Jig: [:alpha]\>

This is a jig with two objects, ‘before’ and ‘after’ separated by  
a gap named :middle.

j = Jig.new(‘before’, :middle, 'after) # =\> #\<Jig:  
[“before”, :middle, “after”]\>

The plug operation derives a new jig from the old jig.

j.plug(:middle, “, during, and”) # =\> #\<Jig: [“before”, ",  
during, and ", “after”]\>

This operation doesn’t change j. It can be used again:

j.plug(:middle, " and ") # =\> #\<Jig: [“before”, "  
and ", “after”]\>

There is a destructive version of plug that modifies  
the jig in place:

j.plug!(:middle, “filled”) # =\> #\<Jig: [“before”,  
“filled”, “after”]\>  
j # =\> #\<Jig: [“before”,  
“filled”, “after”]\>

There are a number of ways to construct a Jig and many of  
them insert an implicit gap into the Jig. This gap is  
identified as :\_\_\_ and is used as the default gap  
for plug operations when one isn’t provided:

Changes:

## 0.1.1 / 2008-02-28

- Jig#syntax to help with jig comparison

- Jig#terse\_inspect to help with nested inspect and gaps with processing

- testing of Jig#parse

- to\_yaml of jigs with procs

- Callable objects are now rendered to strings via to\_yaml

- Attribute gaps have their own class now instead of being adhoc gap  
filters.

- Gap#== checks classes

- Gap with filter was being replaced by a plain gap.  
Ignore filling if filling is the same gap.

- Jig#parse correction

- cleanup up some documentation typos

- reimplemented Jig.parse with StringScanner, fixed bugs

- [http://jig.rubyforge.org](http://jig.rubyforge.org)
