test/console

0 views
Skip to first unread message

Oleg Andreev

unread,
Feb 14, 2008, 5:35:12 PM2/14/08
to stro...@googlegroups.com
We've done 502 commits already and celebrated it with one significant
bugfix (won't tell you, see git-log :-P) and a very nice playground:
test/console.

Usage:

$ test/console
$ test/console --prompt xmp (recommended)

Features:

* memstore and file-based by default.
* include StrokeDB (to save typing)
* Doc = Document (for the same reason)
* save! syncs memstore to filestore
* clear! removes test filestore
* find(uuid, version) lets you find previously saved document

So now everyone can easily play with a database for all night long.
Have fun!

PS. Credits: oleg — for idea, yurii — for implementation :-)


Oleg Andreev

unread,
Feb 14, 2008, 5:53:49 PM2/14/08
to StrokeDB
I think, i have to post some trivial example:

$ test/console --prompt xmp

Page = Meta.new
article = Page.new :title => "Hello, world!", :text => "Oh, yes"
article.save!
article.uuid
==> "3fae0cfc-0de1-4326-beb5-17185b215b48"
save! # save to disk.

Ctrl+C

$ test/console --prompt xmp

find "3fae0cfc-0de1-4326-beb5-17185b215b48"
==>#<{Page} title: "Hello, world!", text: "Oh, yes", __version__:
3c5a... >



Yurii Rashkovskii

unread,
Feb 14, 2008, 5:56:56 PM2/14/08
to stro...@googlegroups.com

And even better, instead of this 'find', you can use something like
this:

Page.find(:title => "Hello, world!")
==>[#<{Page} text: "Oh, yes", title: "Hello, world!",
__version__: 319f...>]

Adrian Madrid

unread,
Feb 14, 2008, 6:17:17 PM2/14/08
to stro...@googlegroups.com
Great! this should make things easier to play around.

AEM
--
Adrian Esteban Madrid
Lead Developer, Prefab Markets
http://www.prefabmarkets.com
Reply all
Reply to author
Forward
0 new messages