Skip to content

Commit

Permalink
Merged amiller's changes.
Browse files Browse the repository at this point in the history
Reorganized lib.
Added port_spec.
  • Loading branch information
Larry Diehl committed Apr 27, 2009
1 parent 7c1946d commit fa4441d
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 36 deletions.
3 changes: 3 additions & 0 deletions dataflow.rb
Expand Up @@ -58,3 +58,6 @@ def method_missing(name, *args, &block)

UnificationError = Class.new StandardError
end

require "#{File.dirname(__FILE__)}/lib/port"
require "#{File.dirname(__FILE__)}/lib/actor"
12 changes: 0 additions & 12 deletions examples/local_variables2.rb

This file was deleted.

2 changes: 1 addition & 1 deletion examples/messages.rb
@@ -1,4 +1,4 @@
require "#{File.dirname(__FILE__)}/../actor"
require "#{File.dirname(__FILE__)}/../dataflow"
include Dataflow

Ping = Actor.new {
Expand Down
2 changes: 1 addition & 1 deletion examples/portsend.rb
@@ -1,4 +1,4 @@
require "#{File.dirname(__FILE__)}/../port"
require "#{File.dirname(__FILE__)}/../dataflow"
include Dataflow

local do |p, x|
Expand Down
8 changes: 4 additions & 4 deletions examples/ring.rb
@@ -1,9 +1,9 @@
require "#{File.dirname(__FILE__)}/../actor"
require "#{File.dirname(__FILE__)}/../dataflow"
include Dataflow

# Send M messages each along a ring of N nodes
N = 40
M = 20
N = 4
M = 2

actors = []
N.times do |n|
Expand All @@ -22,4 +22,4 @@
end

actors[0].send :msg
actors.each { |x| x.join }
actors.each { |x| x.join }
2 changes: 0 additions & 2 deletions actor.rb → lib/actor.rb
@@ -1,5 +1,3 @@
require 'port'

module Dataflow
class Actor < Thread
include Dataflow
Expand Down
1 change: 0 additions & 1 deletion port.rb → lib/port.rb
@@ -1,4 +1,3 @@
require 'dataflow'
require 'thread'

module Dataflow
Expand Down
8 changes: 1 addition & 7 deletions dataflow_spec.rb → spec/dataflow_spec.rb
@@ -1,10 +1,4 @@
require 'rubygems'
require 'spec'
require 'dataflow'

Spec::Runner.configure do |config|
config.include Dataflow
end
require "#{File.dirname(__FILE__)}/spec_helper"

context 'Using "local" for local variables' do
describe 'An unbound Variable' do
Expand Down
9 changes: 1 addition & 8 deletions port_spec.rb → spec/port_spec.rb
@@ -1,11 +1,4 @@
require 'rubygems'
require 'spec'
require 'dataflow'
require 'port'

Spec::Runner.configure do |config|
config.include Dataflow
end
require "#{File.dirname(__FILE__)}/spec_helper"

describe 'Syncronously sending to a Port' do
it 'extends the length of the stream and preserves order' do
Expand Down
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,7 @@
require 'rubygems'
require 'spec'
require 'dataflow'

Spec::Runner.configure do |config|
config.include Dataflow
end

0 comments on commit fa4441d

Please sign in to comment.