Skip to content
Sequel-based storage implementation for ruote (a Ruby workflow engine)
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
CHANGELOG.txt
CREDITS.txt
LICENSE.txt
README.rdoc
Rakefile
TODO.txt
ruote-sequel.gemspec

README.rdoc

ruote-sequel

Sequel storage implementation for ruote >= 2.2.0

usage

This is how a ruote engine is setup with a ruote-sequel storage (postgres) and a worker :

require 'rubygems'
require 'json' # gem install json
require 'ruote'
require 'ruote-sequel' # gem install ruote-sequel

sequel = Sequel.connect('postgres://localhost/ruote_test')
#sequel = Sequel.connect('mysql://root:root@localhost/ruote_test')
#sequel = Sequel.connect(
#  :adapter => 'mysql2',
#  :user => 'root',
#  :password => 'root',
#  :socket=> '/tmp/mysql.sock',
#  :database => 'foo_development')

engine = Ruote::Engine.new(
  Ruote::Worker.new(
    Ruote::Sequel::Storage.new(sequel)))

# ...

To create the table in the database :

Ruote::Sequel.create_table($sequel, true)

Tested with sequel 3.20.0, with the postgresql (pg 0.10.1) adapter.

To learn more about connecting Sequel to a database :

sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html

A single 'documents' table is used. To change this name :

opts = { 'table_name' => 'ruote_docs' }

engine = Ruote::Engine.new(
  Ruote::Worker.new(
    Ruote::Sequel::Storage.new(sequel, opts)))

running tests

assuming you have

ruote/
ruote-sequel/
  • unit tests :

get into ruote/ and do

ruby test/unit/storage.rb -- --sequel
  • functional tests :

get into ruote/ and do

ruby test/functional/test.rb -- --sequel

known issues

none

license

MIT

links

sequel.rubyforge.org/

ruote.rubyforge.org/ github.com/jmettraux/ruote-sequel

feedback

mailing list : groups.google.com/group/openwferu-users irc : irc.freenode.net #ruote

Something went wrong with that request. Please try again.