------art_21131_8959253.1207073907736
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I was thinking that maybe the OP could use something like KirbyBase.
I've used it before, and it allows the code to stay very portable because
kirbybase is just ruby code.

You can locate it here:
http://rubyforge.org/projects/kirbybase

/Shawn

On Tue, Apr 1, 2008 at 11:11 AM, Joel VanderWerf <vjoel / path.berkeley.edu>
wrote:

> James Dinkel wrote:
> > I need to store some information with my ruby program and I am not sure
> > on what would be the best method.  I'm mostly concerned about what would
> > be the most efficient use of cpu resources.
>
> One option is FSDB[1] (file-system database), with one file per
> "category", and each file stored as YAML. This scales as well as your
> file system scales, is always human-readable, and should be fairly
> efficient. (It's thread and process safe too, not that it matters for
> your app.)
>
> For example:
>
>   require 'fsdb'
>   require 'yaml'
>
>   db  SDB::Database.new "~/tmp/my_data"
>   db.formats  FSDB::YAML_FORMAT] + db.formats
>
>   3.times do |i|
>     db["Cat#{i}.yml"]  w{
>       name1
>       name2
>       name3
>     }
>   end
>
>   path  Cat1.yml"
>
>   puts "Here's the object:"
>   puts ""
>   p db[path]
>   puts ""
>   puts
>
>   puts "Here's the file:"
>   puts ""
>   puts File.read(File.join(db.dir, path))
>   puts ""
>   puts
>
> and this is the output:
>
> Here's the object:
> 
> ["name1", "name2", "name3"]
> 
>
> Here's the file:
> 
> ---
> - name1
> - name2
> - name3
> 
>
>
> The dir structure looks like this:
>
> [~/tmp] ls my_data
> Cat0.yml  Cat1.yml  Cat2.yml
>
>
> [1] http://redshift.sourceforge.net/fsdb
>
> --
>       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
>
>

------art_21131_8959253.1207073907736--