# \[ANN\] lorax 0.1.0 Released

**URL:** <https://rubytalk.org/t/ann-lorax-0-1-0-released/57718>\
**Category:** ruby-talk\
**Created:** [10 March 2010 03:38 UTC](https://rubytalk.org/t/ann-lorax-0-1-0-released/57718 "2010-03-10T03:38:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Dalessio1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/mike_dalessio1/32/1903_2.png) [@Mike\_Dalessio1](https://rubytalk.org/u/Mike_Dalessio1)\
**Post date:** [10 March 2010 03:38 UTC](https://rubytalk.org/t/ann-lorax-0-1-0-released/57718/1 "2010-03-10T03:38:45Z")

</div>

lorax version 0.1.0 has been released!

\* \<[http://github.com/flavorjones/lorax](http://github.com/flavorjones/lorax)\>

The Lorax is a diff and patch library for XML/HTML documents, based on  
Nokogiri.

It can tell you whether two XML/HTML documents are identical, or if  
they're not, tell you what's different. In trivial cases, it can even  
apply the patch.

It's based loosely on Gregory Cobena's master's thesis paper, which  
generates deltas in less than O(n \* log n) time, accepting some  
tradeoffs in the size of the delta set. You can find his paper at  
[http://gregory.cobena.free.fr/www/Publications/thesis.html](http://gregory.cobena.free.fr/www/Publications/thesis.html).

This is an early alpha release, so please expect bugs. See the failing  
tests for more information.

"I am the Lorax, I speak for the trees."

Changes:

## 0.1.0 (2010-03-09)

\* Happy Birthday!  
\* Diffs and generates patches, and for trivial cases applies patches  
correctly.

---

<div class="post-metadata">

**Author:** ![Tony\_Arcieri6](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Tony\_Arcieri6](https://rubytalk.org/u/Tony_Arcieri6)\
**Post date:** [10 March 2010 03:54 UTC](https://rubytalk.org/t/ann-lorax-0-1-0-released/57718/2 "2010-03-10T03:54:00Z")

</div>

That's awesome, great name

> **···**
>
> On Tue, Mar 9, 2010 at 8:38 PM, Mike Dalessio \<mike.dalessio@gmail.com\>wrote:
> 
> > "I am the Lorax, I speak for the trees."
> 
> --  
> Tony Arcieri  
> Medioh! A Kudelski Brand

---

<div class="post-metadata">

**Author:** ![7rans](https://avatars.discourse-cdn.com/v4/letter/7/a8b319/32.png) [@7rans](https://rubytalk.org/u/7rans)\
**Post date:** [10 March 2010 11:09 UTC](https://rubytalk.org/t/ann-lorax-0-1-0-released/57718/3 "2010-03-10T11:09:35Z")

</div>

Why not in every case?

> **···**
>
> On Mar 9, 10:38 pm, Mike Dalessio \<mike.dales...@gmail.com\> wrote:
> 
> > lorax version 0.1.0 has been released!
> > 
> > \* \<[http://github.com/flavorjones/lorax&gt](http://github.com/flavorjones/lorax&gt);
> > 
> > The Lorax is a diff and patch library for XML/HTML documents, based on  
> > Nokogiri.
> > 
> > It can tell you whether two XML/HTML documents are identical, or if  
> > they're not, tell you what's different. In trivial cases, it can even  
> > apply the patch.

---

<div class="post-metadata">

**Author:** ![Mike\_Dalessio1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/mike_dalessio1/32/1903_2.png) [@Mike\_Dalessio1](https://rubytalk.org/u/Mike_Dalessio1)\
**Post date:** [10 March 2010 12:53 UTC](https://rubytalk.org/t/ann-lorax-0-1-0-released/57718/4 "2010-03-10T12:53:25Z")

</div>

Because there are still boogs! 😃

One example: the XPath pointing at the elements involved in the deltas  
doesn't take into consideration the fact that other sibling elements may  
have been inserted or removed as part of an earlier delta. Another example:  
there are edge cases where Lorax can get confused by many identical sibling  
nodes interleaved with changing elements (think whitespace in an HTML doc).

I'd like to note that the library uses dependency injection to allow a  
modular choice of algorithm. So people with better CS chops than me can take  
a whack at it by building their own delta-set generator for their favorite  
algorithm, while still taking using the fast subtree signatures.

If you're curious and interested, I'd love to have more eyes and hands on  
these issues. Both master and whitespace-fix branches have failing tests  
which can tell you where to dive in. The TODO has information on class  
responsibilities, algorithmic notes, missing integration tests and a list of  
needed features (like an rspec matcher).

> **···**
>
> On Wed, Mar 10, 2010 at 6:09 AM, Intransition \<transfire@gmail.com\> wrote:
> 
> > On Mar 9, 10:38 pm, Mike Dalessio \<mike.dales...@gmail.com\> wrote:  
> > \> lorax version 0.1.0 has been released!  
> > \>  
> > \> \* \<[http://github.com/flavorjones/lorax&gt](http://github.com/flavorjones/lorax&gt);  
> > \>  
> > \> The Lorax is a diff and patch library for XML/HTML documents, based on  
> > \> Nokogiri.  
> > \>  
> > \> It can tell you whether two XML/HTML documents are identical, or if  
> > \> they're not, tell you what's different. In trivial cases, it can even  
> > \> apply the patch.
> > 
> > Why not in every case?
