Just decided to add more examples to StrokeDB and crafted one. Here
you are examples/todo.rb — an application to maintain simple todo
list.
Here is an example of its use.
$ ./examples/todo.rb Visit Prague
$ ./examples/todo.rb [StrokeDB] Add todo example
$ ./examples/todo.rb
StrokeDB:
[ ] Add todo example
Main:
[ ] Visit Prague
$ ./examples/todo.rb -d [StrokeDB] Add todo example
$ ./examples/todo.rb
StrokeDB:
[X] Add todo example
Main:
[ ] Visit Prague
P.S. Its implementation isn't really perfect — I just did it in a
matter of couple of minutes.
>
> StrokeDB.default_store.chunk_storage.sync_chained_storages!
>
> What does this line mean?
>
This syncs memory storage to file storage (this example uses default
chaining: mem -> fs). So, effectively, it makes changes persistent.
That is what save! command in test/console does.
Yurii.