Skip to content
No description or website provided.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
lib
rake_tasks
spec
vendor
.gitignore
.gitmodules
GPL_LICENSE
MIT_LICENSE
PLAN
README.rdoc
Rakefile
VERSION

README.rdoc

ODB

The ruby object database

Notes:

This stuff is still in pre-alpha. Don't expect it to work for anything useful just quite yet.

Installation

./bin/odb-install

Usage

Process 1

# Set up ODB
require 'lib/odb'
Odb.path = "."

# Load your classes, data
class Foo
  attr_accessor :bar
end

f = Foo.new
f.bar = "a_value"
a = [1, "bar", f]

# store your data
Odb::Object.write(a) #=> 4 (the object_id)

Process 2

# Set up ODB
require 'lib/odb'
Odb.path = "."

# Load your classes
class Foo
  attr_accessor :bar
end

# Read + Write your data
>> a = Odb::Object.read(4)
=> [object_id:0, object_id:1, object_id:3]
>> a[0]
=> 1
>> a[1]
=> "bar"
>> a[2]
=> #<Foo:0x10115d018 @bar="a_value">

Bugs

  • User written C classes not supported

  • Any class which doesn't return the class name with “to_s” won't be loadable.

  • No support for anything Marshal doesn't support: Classes, Procs, Lambdas, Methods, UnboundMethods

Something went wrong with that request. Please try again.