1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/sample/pstore.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
263 B
Ruby
Raw Normal View History

require 'pstore'
db = PStore.new("/tmp/foo")
db.transaction do
p db.roots
ary = db["root"] = [1,2,3,4]
ary[1] = [1,1.5]
end
1000.times do
db.transaction do
db["root"][0] += 1
p db["root"][0]
end
end
db.transaction(true) do
p db["root"]
end