Ruby StashPermanently save your Ruby objectsOverviewSerializes your ruby objects and writes them as files to disk.
Easily load stashed object.
Gzips all files for you to save space (can be turned off).
InstallationRubyforge project.
gem install object-stashor
sudo gem install object-stashExample# Here's our theory of everything - make it heavy theory_of_everything = { :question => "Life, Universe & Everything", :answer => 42 } 1000.times {|i| theory_of_everything[i] = "rubbish#{i}" }
Stash it ObjectStash.store theory_of_everything, './theory_of_everything.stash'
Let's see what it did File.stat('./theory_of_everything.stash').size # => 4206
Reload it loaded_theory_of_everything = ObjectStash.load 'theory_of_everything.stash' question = loaded_theory_of_everything[:question] answer = loaded_theory_of_everything[:answer] puts "The answer to #{question} is #{answer}" # => The answer to Life, Universe & Everything is 42