summaryrefslogtreecommitdiff
path: root/jni/ruby/sample/pstore.rb
blob: 38c230551683641489bd958d160dd820b6e23e0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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