engineyard-serverside 1.5.21 → 1.5.23.ruby19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/engineyard-serverside/cli.rb +39 -45
- data/lib/engineyard-serverside/configuration.rb +28 -4
- data/lib/engineyard-serverside/deploy.rb +5 -4
- data/lib/engineyard-serverside/logged_output.rb +3 -5
- data/lib/engineyard-serverside/server.rb +26 -2
- data/lib/engineyard-serverside/task.rb +2 -4
- data/lib/engineyard-serverside/version.rb +1 -1
- data/lib/engineyard-serverside.rb +8 -20
- data/spec/basic_deploy_spec.rb +1 -1
- data/spec/bundler_deploy_spec.rb +1 -1
- data/spec/nodejs_deploy_spec.rb +1 -1
- data/spec/rails31_deploy_spec.rb +1 -1
- data/spec/services_deploy_spec.rb +1 -1
- metadata +80 -233
- data/lib/vendor/dataflow/HISTORY +0 -52
- data/lib/vendor/dataflow/LICENSE +0 -19
- data/lib/vendor/dataflow/README.textile +0 -290
- data/lib/vendor/dataflow/Rakefile +0 -36
- data/lib/vendor/dataflow/dataflow/actor.rb +0 -22
- data/lib/vendor/dataflow/dataflow/equality.rb +0 -44
- data/lib/vendor/dataflow/dataflow/future_queue.rb +0 -24
- data/lib/vendor/dataflow/dataflow/port.rb +0 -54
- data/lib/vendor/dataflow/dataflow.rb +0 -124
- data/lib/vendor/dataflow/examples/barrier.rb +0 -9
- data/lib/vendor/dataflow/examples/data_driven.rb +0 -17
- data/lib/vendor/dataflow/examples/dataflow_http_gets.rb +0 -13
- data/lib/vendor/dataflow/examples/flow.rb +0 -20
- data/lib/vendor/dataflow/examples/future_http_gets.rb +0 -12
- data/lib/vendor/dataflow/examples/future_queue.rb +0 -11
- data/lib/vendor/dataflow/examples/instance_variables.rb +0 -15
- data/lib/vendor/dataflow/examples/laziness.rb +0 -9
- data/lib/vendor/dataflow/examples/local_variables.rb +0 -11
- data/lib/vendor/dataflow/examples/messages.rb +0 -26
- data/lib/vendor/dataflow/examples/port_http_gets.rb +0 -13
- data/lib/vendor/dataflow/examples/port_send.rb +0 -10
- data/lib/vendor/dataflow/examples/ring.rb +0 -21
- data/lib/vendor/dataflow/spec/actor_spec.rb +0 -28
- data/lib/vendor/dataflow/spec/anonymous_variables_spec.rb +0 -21
- data/lib/vendor/dataflow/spec/barrier_spec.rb +0 -25
- data/lib/vendor/dataflow/spec/by_need_spec.rb +0 -55
- data/lib/vendor/dataflow/spec/dataflow_spec.rb +0 -151
- data/lib/vendor/dataflow/spec/equality_spec.rb +0 -40
- data/lib/vendor/dataflow/spec/flow_spec.rb +0 -25
- data/lib/vendor/dataflow/spec/forker_spec.rb +0 -28
- data/lib/vendor/dataflow/spec/future_queue_spec.rb +0 -31
- data/lib/vendor/dataflow/spec/inspect_spec.rb +0 -19
- data/lib/vendor/dataflow/spec/need_later_spec.rb +0 -12
- data/lib/vendor/dataflow/spec/port_spec.rb +0 -26
- data/lib/vendor/dataflow/spec/spec.opts +0 -1
- data/lib/vendor/dataflow/spec/spec_helper.rb +0 -10
- data/lib/vendor/escape/Readme +0 -21
- data/lib/vendor/escape/doc_include/template/qualitysmith.rb +0 -631
- data/lib/vendor/json_pure/CHANGES +0 -166
- data/lib/vendor/json_pure/COPYING +0 -58
- data/lib/vendor/json_pure/GPL +0 -340
- data/lib/vendor/json_pure/README +0 -358
- data/lib/vendor/json_pure/Rakefile +0 -292
- data/lib/vendor/json_pure/TODO +0 -1
- data/lib/vendor/json_pure/VERSION +0 -1
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +0 -52
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +0 -900
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +0 -901
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +0 -261
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +0 -262
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +0 -34
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +0 -900
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +0 -901
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +0 -81
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +0 -82
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +0 -1000
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +0 -1001
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +0 -82
- data/lib/vendor/json_pure/benchmarks/generator2_benchmark.rb +0 -222
- data/lib/vendor/json_pure/benchmarks/generator_benchmark.rb +0 -224
- data/lib/vendor/json_pure/benchmarks/ohai.json +0 -1216
- data/lib/vendor/json_pure/benchmarks/ohai.ruby +0 -1
- data/lib/vendor/json_pure/benchmarks/parser2_benchmark.rb +0 -251
- data/lib/vendor/json_pure/benchmarks/parser_benchmark.rb +0 -259
- data/lib/vendor/json_pure/bin/edit_json.rb +0 -9
- data/lib/vendor/json_pure/bin/prettify_json.rb +0 -75
- data/lib/vendor/json_pure/data/example.json +0 -1
- data/lib/vendor/json_pure/data/index.html +0 -38
- data/lib/vendor/json_pure/data/prototype.js +0 -4184
- data/lib/vendor/json_pure/ext/json/ext/generator/extconf.rb +0 -16
- data/lib/vendor/json_pure/ext/json/ext/generator/generator.c +0 -1323
- data/lib/vendor/json_pure/ext/json/ext/generator/generator.h +0 -170
- data/lib/vendor/json_pure/ext/json/ext/parser/extconf.rb +0 -15
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.c +0 -1935
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.h +0 -71
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.rl +0 -792
- data/lib/vendor/json_pure/install.rb +0 -26
- data/lib/vendor/json_pure/tests/fixtures/fail1.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail10.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail11.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail12.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail13.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail14.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail18.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail19.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail2.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail20.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail21.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail22.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail23.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail24.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail25.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail27.json +0 -2
- data/lib/vendor/json_pure/tests/fixtures/fail28.json +0 -2
- data/lib/vendor/json_pure/tests/fixtures/fail3.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail4.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail5.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail6.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail7.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail8.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/fail9.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass1.json +0 -56
- data/lib/vendor/json_pure/tests/fixtures/pass15.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass16.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass17.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass2.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass26.json +0 -1
- data/lib/vendor/json_pure/tests/fixtures/pass3.json +0 -6
- data/lib/vendor/json_pure/tests/test_json.rb +0 -361
- data/lib/vendor/json_pure/tests/test_json_addition.rb +0 -162
- data/lib/vendor/json_pure/tests/test_json_encoding.rb +0 -68
- data/lib/vendor/json_pure/tests/test_json_fixtures.rb +0 -34
- data/lib/vendor/json_pure/tests/test_json_generate.rb +0 -122
- data/lib/vendor/json_pure/tests/test_json_rails.rb +0 -144
- data/lib/vendor/json_pure/tests/test_json_unicode.rb +0 -76
- data/lib/vendor/json_pure/tools/fuzz.rb +0 -139
- data/lib/vendor/json_pure/tools/server.rb +0 -61
- data/lib/vendor/open4/lib/open4.rb +0 -403
- data/lib/vendor/thor/CHANGELOG.rdoc +0 -89
- data/lib/vendor/thor/LICENSE +0 -20
- data/lib/vendor/thor/README.rdoc +0 -297
- data/lib/vendor/thor/Thorfile +0 -69
- data/lib/vendor/thor/bin/rake2thor +0 -86
- data/lib/vendor/thor/bin/thor +0 -6
- data/lib/vendor/thor/lib/thor/actions/create_file.rb +0 -103
- data/lib/vendor/thor/lib/thor/actions/directory.rb +0 -91
- data/lib/vendor/thor/lib/thor/actions/empty_directory.rb +0 -134
- data/lib/vendor/thor/lib/thor/actions/file_manipulation.rb +0 -223
- data/lib/vendor/thor/lib/thor/actions/inject_into_file.rb +0 -104
- data/lib/vendor/thor/lib/thor/actions.rb +0 -275
- data/lib/vendor/thor/lib/thor/base.rb +0 -540
- data/lib/vendor/thor/lib/thor/core_ext/file_binary_read.rb +0 -9
- data/lib/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +0 -75
- data/lib/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -100
- data/lib/vendor/thor/lib/thor/error.rb +0 -30
- data/lib/vendor/thor/lib/thor/group.rb +0 -271
- data/lib/vendor/thor/lib/thor/invocation.rb +0 -180
- data/lib/vendor/thor/lib/thor/parser/argument.rb +0 -67
- data/lib/vendor/thor/lib/thor/parser/arguments.rb +0 -150
- data/lib/vendor/thor/lib/thor/parser/option.rb +0 -128
- data/lib/vendor/thor/lib/thor/parser/options.rb +0 -169
- data/lib/vendor/thor/lib/thor/parser.rb +0 -4
- data/lib/vendor/thor/lib/thor/rake_compat.rb +0 -66
- data/lib/vendor/thor/lib/thor/runner.rb +0 -314
- data/lib/vendor/thor/lib/thor/shell/basic.rb +0 -239
- data/lib/vendor/thor/lib/thor/shell/color.rb +0 -108
- data/lib/vendor/thor/lib/thor/shell.rb +0 -83
- data/lib/vendor/thor/lib/thor/task.rb +0 -102
- data/lib/vendor/thor/lib/thor/util.rb +0 -230
- data/lib/vendor/thor/lib/thor/version.rb +0 -3
- data/lib/vendor/thor/lib/thor.rb +0 -244
- data/lib/vendor/thor/thor.gemspec +0 -120
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../dataflow"
|
|
2
|
-
include Dataflow
|
|
3
|
-
|
|
4
|
-
Ping = Actor.new {
|
|
5
|
-
3.times {
|
|
6
|
-
case receive
|
|
7
|
-
when "Ping"
|
|
8
|
-
puts "Ping"
|
|
9
|
-
Pong.send "Pong"
|
|
10
|
-
end
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
Pong = Actor.new {
|
|
15
|
-
3.times {
|
|
16
|
-
case receive
|
|
17
|
-
when "Pong"
|
|
18
|
-
puts "Pong"
|
|
19
|
-
Ping.send "Ping"
|
|
20
|
-
end
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Ping.send "Ping"
|
|
25
|
-
Ping.join
|
|
26
|
-
Pong.join
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../dataflow"
|
|
2
|
-
require 'net/http'
|
|
3
|
-
include Dataflow
|
|
4
|
-
|
|
5
|
-
# Be gentle running this one
|
|
6
|
-
Thread.abort_on_exception = true
|
|
7
|
-
local do |port, stream, branding_occurences, number_of_mentions|
|
|
8
|
-
unify port, Dataflow::Port.new(stream)
|
|
9
|
-
10.times { Thread.new(port) {|p| p.send Net::HTTP.get_response(URI.parse("http://www.cuil.com/search?q=#{rand(1000)}")).body } }
|
|
10
|
-
Thread.new { unify branding_occurences, stream.take(10).map {|http_body| http_body.scan /cuil/ } }
|
|
11
|
-
Thread.new { unify number_of_mentions, branding_occurences.map {|occurences| occurences.length } }
|
|
12
|
-
puts number_of_mentions.inspect
|
|
13
|
-
end
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../dataflow"
|
|
2
|
-
include Dataflow
|
|
3
|
-
|
|
4
|
-
local do |port, stream|
|
|
5
|
-
unify port, Dataflow::Port.new(stream)
|
|
6
|
-
Thread.new {port.send 2}
|
|
7
|
-
Thread.new {port.send 8}
|
|
8
|
-
Thread.new {port.send 1024}
|
|
9
|
-
puts stream.take(3).sort.inspect
|
|
10
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../dataflow"
|
|
2
|
-
include Dataflow
|
|
3
|
-
|
|
4
|
-
# Send M messages each along a ring of N nodes
|
|
5
|
-
N = 4
|
|
6
|
-
M = 2
|
|
7
|
-
actors = Array.new(N) { Dataflow::Variable.new }
|
|
8
|
-
|
|
9
|
-
N.times do |n|
|
|
10
|
-
unify actors[n], Actor.new {
|
|
11
|
-
M.times do |m|
|
|
12
|
-
receive
|
|
13
|
-
puts "[#{n} #{m}]"
|
|
14
|
-
actors[(n+1) % N].send :msg
|
|
15
|
-
end
|
|
16
|
-
puts "[#{n}] done"
|
|
17
|
-
}
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
actors.first.send :msg
|
|
21
|
-
actors.each { |x| x.join }
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'Syncronously sending to an Actor' do
|
|
4
|
-
it 'passes in each message received and preserves order' do
|
|
5
|
-
local do |port, stream, actor|
|
|
6
|
-
unify port, Dataflow::Port.new(stream)
|
|
7
|
-
unify actor, Dataflow::Actor.new { 3.times { port.send receive } }
|
|
8
|
-
actor.send 1
|
|
9
|
-
actor.send 2
|
|
10
|
-
stream.take(2).should == [1, 2]
|
|
11
|
-
actor.send 3
|
|
12
|
-
stream.take(3).should == [1, 2, 3]
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe 'Asyncronously sending to an Actor' do
|
|
18
|
-
it 'passes in each message received and preserves order' do
|
|
19
|
-
local do |port, stream, actor|
|
|
20
|
-
unify port, Dataflow::Port.new(stream)
|
|
21
|
-
unify actor, Dataflow::Actor.new { 3.times { port.send receive } }
|
|
22
|
-
Thread.new {actor.send 2}
|
|
23
|
-
Thread.new {actor.send 8}
|
|
24
|
-
Thread.new {actor.send 1024}
|
|
25
|
-
stream.take(3).sort.should == [2, 8, 1024]
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'Using an anonymous variable' do
|
|
4
|
-
it 'works with Variable instances' do
|
|
5
|
-
container = [Dataflow::Variable.new]
|
|
6
|
-
unify container.first, 1337
|
|
7
|
-
container.first.should == 1337
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
it 'works with Dataflow.local' do
|
|
11
|
-
container = [Dataflow.local]
|
|
12
|
-
unify container.first, 1337
|
|
13
|
-
container.first.should == 1337
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it 'works with #local' do
|
|
17
|
-
container = [local]
|
|
18
|
-
unify container.first, 1337
|
|
19
|
-
container.first.should == 1337
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'A barrier' do
|
|
4
|
-
it 'waits for variables to be bound before continuing' do
|
|
5
|
-
local do |x, y, barrier_broken|
|
|
6
|
-
Thread.new do
|
|
7
|
-
barrier x, y
|
|
8
|
-
unify barrier_broken, true
|
|
9
|
-
end
|
|
10
|
-
Thread.new { unify x, :x }
|
|
11
|
-
Thread.new { unify y, :y }
|
|
12
|
-
barrier_broken.should be_true
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it 'continues for variables that are already bound' do
|
|
17
|
-
local do |x, y, barrier_broken|
|
|
18
|
-
unify x, :x
|
|
19
|
-
unify y, :y
|
|
20
|
-
barrier x, y
|
|
21
|
-
unify barrier_broken, true
|
|
22
|
-
barrier_broken.should be_true
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'A by_need expression' do
|
|
4
|
-
describe 'when a method is called on it' do
|
|
5
|
-
it 'binds its variable' do
|
|
6
|
-
local do |x, y, z|
|
|
7
|
-
Thread.new { unify y, by_need { 4 } }
|
|
8
|
-
Thread.new { unify z, x + y }
|
|
9
|
-
Thread.new { unify x, by_need { 3 } }
|
|
10
|
-
z.should == 7
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
describe 'when a bound variable is unified to it' do
|
|
16
|
-
it 'passes unififcation for equal values' do
|
|
17
|
-
local do |x|
|
|
18
|
-
unify x, by_need { 1 }
|
|
19
|
-
unify x, 1
|
|
20
|
-
x.should == 1
|
|
21
|
-
|
|
22
|
-
y = by_need { 1 }
|
|
23
|
-
unify y, 1
|
|
24
|
-
y.should == 1
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it 'fails unififcation for unequal values' do
|
|
29
|
-
local do |x|
|
|
30
|
-
unify x, by_need { 1 }
|
|
31
|
-
lambda { unify x, 2 }.should raise_error(Dataflow::UnificationError)
|
|
32
|
-
|
|
33
|
-
y = by_need { 1 }
|
|
34
|
-
lambda { unify y, 2 }.should raise_error(Dataflow::UnificationError)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
describe 'when it is unified to a bound variable' do
|
|
39
|
-
it 'passes unififcation for equal values' do
|
|
40
|
-
local do |x|
|
|
41
|
-
unify x, 1
|
|
42
|
-
unify x, by_need { 1 }
|
|
43
|
-
x.should == 1
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
it 'fails unification for unequal values' do
|
|
48
|
-
local do |x|
|
|
49
|
-
unify x, 1
|
|
50
|
-
lambda { unify x, by_need { 2 } }.should raise_error(Dataflow::UnificationError)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
context 'Using "local" for local variables' do
|
|
4
|
-
describe 'An unbound Variable' do
|
|
5
|
-
it 'suspends if an unbound variable has a method called on it until it is bound' do
|
|
6
|
-
local do |big_cat, small_cat|
|
|
7
|
-
Thread.new { unify big_cat, small_cat.upcase }
|
|
8
|
-
unify small_cat, 'cat'
|
|
9
|
-
big_cat.should == 'CAT'
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it 'suspends if an unbound variable has a method called on it until it is bound with nil' do
|
|
14
|
-
local do |is_nil, var_nil|
|
|
15
|
-
Thread.new { unify is_nil, var_nil.nil? }
|
|
16
|
-
unify var_nil, nil
|
|
17
|
-
is_nil.should be_true
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it 'suspends if an unbound variable has a method called on it until it is bound (with nested local variables)' do
|
|
22
|
-
local do |small_cat|
|
|
23
|
-
local do |big_cat|
|
|
24
|
-
Thread.new { unify big_cat, small_cat.upcase }
|
|
25
|
-
unify small_cat, 'cat'
|
|
26
|
-
big_cat.should == 'CAT'
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it 'performs order-determining concurrency' do
|
|
32
|
-
local do |x, y, z|
|
|
33
|
-
Thread.new { unify y, x + 2 }
|
|
34
|
-
Thread.new { unify z, y + 3 }
|
|
35
|
-
Thread.new { unify x, 1 }
|
|
36
|
-
z.should == 6
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
it 'binds on unification' do
|
|
41
|
-
local do |animal|
|
|
42
|
-
unify animal, 'cat'
|
|
43
|
-
animal.should == 'cat'
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
describe 'A bound Variable' do
|
|
50
|
-
it 'does not complain when unifying with an equal object' do
|
|
51
|
-
lambda do
|
|
52
|
-
local do |animal|
|
|
53
|
-
unify animal, 'cat'
|
|
54
|
-
unify animal, 'cat'
|
|
55
|
-
end
|
|
56
|
-
end.should_not raise_error
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
it 'does not complain when unifying with an unequal object when shadowing' do
|
|
60
|
-
lambda do
|
|
61
|
-
local do |animal|
|
|
62
|
-
unify animal, 'cat'
|
|
63
|
-
local do |animal|
|
|
64
|
-
unify animal, 'dog'
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end.should_not raise_error
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
it 'complains when unifying with an unequal object' do
|
|
71
|
-
lambda do
|
|
72
|
-
local do |animal|
|
|
73
|
-
unify animal, 'cat'
|
|
74
|
-
unify animal, 'dog'
|
|
75
|
-
end
|
|
76
|
-
end.should raise_error(Dataflow::UnificationError)
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
context 'Using "declare" for object-specific read-only attributes' do
|
|
81
|
-
class Store
|
|
82
|
-
include Dataflow
|
|
83
|
-
declare :animal, :big_cat, :small_cat, :x, :y, :z, :is_nil, :var_nil
|
|
84
|
-
end
|
|
85
|
-
before { @store = Store.new }
|
|
86
|
-
|
|
87
|
-
describe 'An unbound Variable' do
|
|
88
|
-
it 'suspends if an unbound variable has a method called on it until it is bound' do
|
|
89
|
-
Thread.new { unify @store.big_cat, @store.small_cat.upcase }
|
|
90
|
-
unify @store.small_cat, 'cat'
|
|
91
|
-
@store.big_cat.should == 'CAT'
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it 'suspends if an unbound variable has a method called on it until it is bound with nil' do
|
|
95
|
-
Thread.new { unify @store.is_nil, @store.var_nil.nil? }
|
|
96
|
-
unify @store.var_nil, nil
|
|
97
|
-
@store.is_nil.should be_true
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
it 'performs order-determining concurrency' do
|
|
101
|
-
Thread.new { unify @store.y, @store.x + 2 }
|
|
102
|
-
Thread.new { unify @store.z, @store.y + 3 }
|
|
103
|
-
Thread.new { unify @store.x, 1 }
|
|
104
|
-
@store.z.should == 6
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
it 'binds on unification' do
|
|
108
|
-
unify @store.animal, 'cat'
|
|
109
|
-
@store.animal.should == 'cat'
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
describe 'A bound Variable' do
|
|
114
|
-
it 'does not complain when unifying with an equal object' do
|
|
115
|
-
lambda do
|
|
116
|
-
unify @store.animal, 'cat'
|
|
117
|
-
unify @store.animal, 'cat'
|
|
118
|
-
end.should_not raise_error
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
it 'complains when unifying with an unequal object' do
|
|
122
|
-
lambda do
|
|
123
|
-
unify @store.animal, 'cat'
|
|
124
|
-
unify @store.animal, 'dog'
|
|
125
|
-
end.should raise_error(Dataflow::UnificationError)
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
describe 'Binding a variable that proxies through another' do
|
|
131
|
-
it 'binds through successfully' do
|
|
132
|
-
local do |x, y|
|
|
133
|
-
lambda do
|
|
134
|
-
unify x, y
|
|
135
|
-
unify x, 1337
|
|
136
|
-
x.should == 1337
|
|
137
|
-
y.should == 1337
|
|
138
|
-
end.should_not raise_error
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
describe 'Using static/module method' do
|
|
144
|
-
it 'works like the mixin versions' do
|
|
145
|
-
Dataflow.local do |big_cat, small_cat|
|
|
146
|
-
Thread.new { Dataflow.unify big_cat, small_cat.upcase }
|
|
147
|
-
Dataflow.unify small_cat, 'cat'
|
|
148
|
-
big_cat.should == 'CAT'
|
|
149
|
-
end
|
|
150
|
-
end
|
|
151
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'Unifying a bound value' do
|
|
4
|
-
[nil, true, false,
|
|
5
|
-
:sym, "str", /regex/,
|
|
6
|
-
3, 2.0,
|
|
7
|
-
Object.new, Class.new.new,
|
|
8
|
-
[], {}].each do |type|
|
|
9
|
-
describe "for #{type.class} instances" do
|
|
10
|
-
it 'passes unification for an object of equal value' do
|
|
11
|
-
local do |var, var2|
|
|
12
|
-
unify var, type
|
|
13
|
-
var.should == type
|
|
14
|
-
type.should == var
|
|
15
|
-
lambda {unify var, type}.should_not raise_error
|
|
16
|
-
|
|
17
|
-
unify var2, type
|
|
18
|
-
var.should == var2
|
|
19
|
-
var2.should == var
|
|
20
|
-
lambda {unify var, var2}.should_not raise_error
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it 'fails unification for an object of inequal value' do
|
|
25
|
-
different = Object.new
|
|
26
|
-
local do |var, var2|
|
|
27
|
-
unify var, type
|
|
28
|
-
var.should_not == different
|
|
29
|
-
different.should_not == var
|
|
30
|
-
lambda {unify var, different}.should raise_error(Dataflow::UnificationError)
|
|
31
|
-
|
|
32
|
-
unify var2, different
|
|
33
|
-
var.should_not == var2
|
|
34
|
-
var2.should_not == var
|
|
35
|
-
lambda {unify var, different}.should raise_error(Dataflow::UnificationError)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'Using flow without a parameter' do
|
|
4
|
-
it 'works like normal threads' do
|
|
5
|
-
local do |big_cat, small_cat|
|
|
6
|
-
flow { unify big_cat, small_cat.upcase }
|
|
7
|
-
unify small_cat, 'cat'
|
|
8
|
-
big_cat.should == 'CAT'
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
describe 'Using flow with a parameter' do
|
|
14
|
-
it 'binds the parameter to the last line of the block' do
|
|
15
|
-
local do |big_cat, small_cat, output|
|
|
16
|
-
flow(output) do
|
|
17
|
-
unify big_cat, small_cat.upcase
|
|
18
|
-
'returned'
|
|
19
|
-
end
|
|
20
|
-
unify small_cat, 'cat'
|
|
21
|
-
big_cat.should == 'CAT'
|
|
22
|
-
output.should == 'returned'
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'Setting a customer forker' do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@original_forker = Dataflow.forker
|
|
6
|
-
Dataflow.forker = Class.new do
|
|
7
|
-
def self.synchronous_forker(&block)
|
|
8
|
-
block.call
|
|
9
|
-
end
|
|
10
|
-
end.method(:synchronous_forker)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
after(:all) do
|
|
14
|
-
Dataflow.forker = @original_forker
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it 'uses the custom forker in #flow' do
|
|
18
|
-
local do |my_var|
|
|
19
|
-
flow(my_var) { 1337 }
|
|
20
|
-
my_var.should == 1337
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it 'uses the custom forker in #need_later' do
|
|
25
|
-
my_var = need_later { 1337 }
|
|
26
|
-
my_var.should == 1337
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'A future queue' do
|
|
4
|
-
it 'accepts synchronous pushes and pops' do
|
|
5
|
-
local do |queue, first, second, third|
|
|
6
|
-
unify queue, Dataflow::FutureQueue.new
|
|
7
|
-
queue.pop first
|
|
8
|
-
queue.pop second
|
|
9
|
-
queue.push 1
|
|
10
|
-
queue.push 2
|
|
11
|
-
queue.push 3
|
|
12
|
-
queue.pop third
|
|
13
|
-
|
|
14
|
-
[first, second, third].should == [1, 2, 3]
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'accepts asynchronous pushes and pops' do
|
|
19
|
-
local do |queue, first, second, third|
|
|
20
|
-
unify queue, Dataflow::FutureQueue.new
|
|
21
|
-
Thread.new { queue.pop first }
|
|
22
|
-
Thread.new { queue.pop second }
|
|
23
|
-
Thread.new { queue.push 1 }
|
|
24
|
-
Thread.new { queue.push 2 }
|
|
25
|
-
Thread.new { queue.push 3 }
|
|
26
|
-
Thread.new { queue.pop third }
|
|
27
|
-
|
|
28
|
-
[first, second, third].sort.should == [1, 2, 3]
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe "An unbound variable" do
|
|
4
|
-
it "should be inspectable for debugging purposes" do
|
|
5
|
-
local do |unbound|
|
|
6
|
-
unbound.inspect.should =~ /#<Dataflow::Variable:[0-9]+ unbound>/
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
describe "An bound variable" do
|
|
12
|
-
it "should proxy inspect" do
|
|
13
|
-
local do |bound|
|
|
14
|
-
bound.inspect
|
|
15
|
-
unify bound, "str"
|
|
16
|
-
bound.should == "str"
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'A need_later expression' do
|
|
4
|
-
it 'returns a future to be calculated later' do
|
|
5
|
-
local do |x, y, z|
|
|
6
|
-
unify y, need_later { 4 }
|
|
7
|
-
unify z, need_later { x + y }
|
|
8
|
-
unify x, need_later { 3 }
|
|
9
|
-
z.should == 7
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
|
2
|
-
|
|
3
|
-
describe 'Syncronously sending to a Port' do
|
|
4
|
-
it 'extends the length of the stream and preserves order' do
|
|
5
|
-
local do |port, stream|
|
|
6
|
-
unify port, Dataflow::Port.new(stream)
|
|
7
|
-
port.send 1
|
|
8
|
-
port.send 2
|
|
9
|
-
stream.take(2).should == [1, 2]
|
|
10
|
-
port.send 3
|
|
11
|
-
stream.take(3).should == [1, 2, 3]
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
describe 'Asyncronously sending to a Port' do
|
|
17
|
-
it 'extends the length of the stream and does not preserve order' do
|
|
18
|
-
local do |port, stream|
|
|
19
|
-
unify port, Dataflow::Port.new(stream)
|
|
20
|
-
Thread.new {port.send 2}
|
|
21
|
-
Thread.new {port.send 8}
|
|
22
|
-
Thread.new {port.send 1024}
|
|
23
|
-
stream.take(3).sort.should == [2, 8, 1024]
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--color
|
data/lib/vendor/escape/Readme
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
= Escape
|
|
2
|
-
|
|
3
|
-
[<b>Home page</b>:] http://__.rubyforge.org/
|
|
4
|
-
[<b>Project site</b>:] http://rubyforge.org/projects/__
|
|
5
|
-
[<b>Gem install</b>:] <tt>gem install escape</tt>
|
|
6
|
-
[<b>Wiki</b>:] http://wiki.qualitysmith.com/__
|
|
7
|
-
[<b>Author</b>:] Your name
|
|
8
|
-
[<b>Copyright</b>:] 2007 QualitySmith, Inc.
|
|
9
|
-
[<b>License</b>:] {GNU General Public License}[http://www.gnu.org/copyleft/gpl.html]
|
|
10
|
-
|
|
11
|
-
== Introduction
|
|
12
|
-
|
|
13
|
-
...
|
|
14
|
-
|
|
15
|
-
== Installation
|
|
16
|
-
|
|
17
|
-
...
|
|
18
|
-
|
|
19
|
-
== Usage
|
|
20
|
-
|
|
21
|
-
...
|