Subject: [ANN] jig 0.1.2 Released

G

Gary Wright

jig version 0.1.2 has been released!

* <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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top