# Gibbler 0.5

**URL:** <https://www.ruby-forum.com/t/gibbler-0-5/171685>\
**Category:** Ruby\
**Created:** [July 7, 2009, 6:06pm UTC](https://www.ruby-forum.com/t/gibbler-0-5/171685 "2009-07-07T18:06:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delano\_Mandelbaum](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d26b3c/32.png) [@Delano\_Mandelbaum](https://www.ruby-forum.com/u/Delano_Mandelbaum)\
**Post date:** [July 7, 2009, 6:06pm UTC](https://www.ruby-forum.com/t/gibbler-0-5/171685/1 "2009-07-07T18:06:03Z")

</div>

Gibbler 0.5 ALPHA

Git-like hashes and history for Ruby objects.

Installation:  
$ gem install gibbler

Examples:  
require ‘gibbler’

```
"kimmy".gibbler # => c8027100
:kimmy.gibbler # => 52be7494

config = {}
config.gibbler # => 4fdcadc6
config.gibbled? # => false

config[:server] = {
  :users => [:dave, :ali],
  :ports => [22, 80, 443]
}
config.gibbled? # => true
config.gibbler # => ef23d605

config[:server][:users] << :yanni

config.gibbler # => 4c558a56

config.gibbler.short # => 4c558a56

```

Gibbler can also keep track of the history of changes to an object. By  
default Gibbler supports history for Hash, Array, and String objects.  
The gibbler\_commit method creates a clone of the current object and  
stores it in an instance variable using the current hash digest as the  
key.

```
require 'gibbler'
require 'gibbler/history'

a = { :magic => :original }
a.gibbler_commit # => d7049916

a[:magic] = :updated
a.gibbler_commit # => b668098e

a[:magic] = :changed
a.gibbler_commit # => 0b11c377

a.gibbler_history # => d7049916, b668098e, 0b11c377

a.gibbler_revert! 'd7049916' # Return to a specific commit
a.gibbler # => d7049916
a # => { :magic => :original }

a.delete :magic

a.gibbler_revert! # Return to the previous commit
a.gibbler # => 0b11c377
a # => { :magic => :changed }

a.gibbler_object 'b668098e' # => { :magic => :updated }
a.gibbler_stamp # => 2009-07-01 18:56:52 -0400

```

Codes: [GitHub - delano/gibbler: Implementation-agnostic git-like hashes and history for Ruby objects](http://github.com/delano/gibbler/)  
RDocs: [http://delano.github.com/gibbler/](http://delano.github.com/gibbler/)
