Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 rake_tasks
Octocat-spinner-32 spec
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 GPL_LICENSE
Octocat-spinner-32 MIT_LICENSE
Octocat-spinner-32 PLAN
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 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.