Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit e9bd6a17f65df9e634b175f12e8155fccdd2a8da @jmettraux committed Feb 29, 2012
Showing with 133 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .rvmrc
  3. +5 −0 Gemfile
  4. +50 −0 Gemfile.lock
  5. +31 −0 README.md
  6. +28 −0 lib/launcher.rb
  7. +17 −0 lib/runner.rb
@@ -0,0 +1 @@
+.bundle/
1 .rvmrc
@@ -0,0 +1 @@
+rvm use 1.9.2-p290
@@ -0,0 +1,5 @@
+
+source :rubygems
+
+gem 'ruote', :git => 'git://github.com/jmettraux/ruote.git'
+
@@ -0,0 +1,50 @@
+GIT
+ remote: git://github.com/jmettraux/ruote.git
+ revision: d3a19ab0a650234c56e9a1f6cfac2e5f9d9ef05a
+ specs:
+ ruote (2.3.0)
+ parslet (= 1.2.3)
+ rufus-cloche (>= 1.0.2)
+ rufus-dollar (>= 1.0.4)
+ rufus-json (>= 1.0.1)
+ rufus-mnemo (>= 1.2.2)
+ rufus-scheduler (>= 2.0.16)
+ rufus-treechecker (>= 1.0.8)
+ sourcify (= 0.5.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ blankslate (2.1.2.4)
+ file-tail (1.0.8)
+ tins (~> 0.3)
+ parslet (1.2.3)
+ blankslate (~> 2.0)
+ ruby2ruby (1.3.1)
+ ruby_parser (~> 2.0)
+ sexp_processor (~> 3.0)
+ ruby_parser (2.3.1)
+ sexp_processor (~> 3.0)
+ rufus-cloche (1.0.2)
+ rufus-json (>= 1.0.1)
+ rufus-dollar (1.0.4)
+ rufus-json (1.0.1)
+ rufus-mnemo (1.2.2)
+ rufus-scheduler (2.0.16)
+ tzinfo (>= 0.3.23)
+ rufus-treechecker (1.0.8)
+ ruby_parser (>= 2.0.5)
+ sexp_processor (3.0.10)
+ sourcify (0.5.0)
+ file-tail (>= 1.0.5)
+ ruby2ruby (>= 1.2.5)
+ ruby_parser (>= 2.0.5)
+ sexp_processor (>= 3.0.5)
+ tins (0.3.9)
+ tzinfo (0.3.31)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ ruote!
@@ -0,0 +1,31 @@
+
+# for_nicola
+
+This repository is a reply to the ruote discussion thread at:
+
+https://groups.google.com/d/topic/openwferu-users/jXP6Lsy56XI/discussion
+
+
+## install
+
+ cd for_nicola
+ bundle install --path .bundle
+
+
+## usage
+
+In a first terminal do:
+
+ ruby lib/runner.rb
+
+In a second terminal do:
+
+ ruby lib/launcher.rb
+
+The ruote process will get executed in the first terminal window (although it was launched in the second one).
+
+
+## license
+
+This "answer" is released under the MIT license.
+
@@ -0,0 +1,28 @@
+
+# script 1
+
+require 'rubygems'
+require 'bundler/setup'
+
+require 'rufus-json/automatic'
+require 'ruote'
+require 'ruote/storage/fs_storage'
+
+
+engine = Ruote::Engine.new(Ruote::FsStorage.new('ruote_test'))
+
+engine.register_participant '.+' do |workitem|
+ puts workitem.params['msg']
+end
+
+pdef = Ruote.process_definition do
+ sequence do
+ participant :alpha, :msg => 'Running alpha'
+ participant :beta, :msg => 'Running beta'
+ end
+end
+
+wfid = engine.launch(pdef)
+
+puts "script 1: launched #{wfid}..."
+
@@ -0,0 +1,17 @@
+
+# script 2
+
+require 'rubygems'
+require 'bundler/setup'
+
+require 'rufus-json/automatic'
+require 'ruote'
+require 'ruote/storage/fs_storage'
+
+
+storage = Ruote::FsStorage.new('ruote_test')
+worker = Ruote::Worker.new(storage)
+worker.context.logger.noisy = true
+puts "script 2: running worker..."
+worker.run
+

0 comments on commit e9bd6a1

Please sign in to comment.