Gaga
Gaga is a Git-backed key/value store written in Ruby. Built with Grit, it supports SET, GET, KEYS, and DELETE operations. And since it's Git, we can easily enhance it to include other awesome Git features such as branches, diffs, reverting, and more!
Usage
@gaga = Gaga.new(:repo => File.('..', __FILE__))
# SET
@gaga['lady'] = "gaga"
# GET
@gaga['lady'] #=> "gaga"
# KEYS
@gaga.keys #=> ['lady']
# DELETE
@gaga.delete('lady') #=> 'gaga'
# Remove all items from the store
@gaga.clear
Branches
You can always store key/values in separate branches. Just specify the branch
option parameter:
@gaga = Gaga.new(:repo => path_to_repo, :branch => 'config')
Though not recommended, Gaga can store the identical key in different branches.
Logs
Gaga keeps a history of key/value saves.
@gaga.log('key')
Returns an array of commit messages along with meta data about each key/value save.
[
{"message"=>"all clear","committer"=>{"name"=>"Matt Sears", "email"=>"[email protected]"}, "committed_date"=>"2011-09-05..."},
{"message"=>"set 'lady' ", "committer"=>{"name"=>"Matt Sears", "email"=>"[email protected]"}, "committed_date"=>"2011-09-05..."}
{"message"=>"delete 'lady' ", "committer"=>{"name"=>"Matt Sears", "email"=>"[email protected]"}, "committed_date"=>"2011-09-05..."}
]
Installing Gaga
$ gem install gaga
Contributing
Once you've made your great commits:
- Fork Gaga
- Create a topic branch - git checkout -b my_branch
- Push to your branch - git push origin my_branch
- Create a Pull Request from your branch
- That's it!
Author
Matt Sears :: @mattsears