engineyard-serverside 1.5.21 → 1.5.23.ruby19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. data/lib/engineyard-serverside/cli.rb +39 -45
  2. data/lib/engineyard-serverside/configuration.rb +28 -4
  3. data/lib/engineyard-serverside/deploy.rb +5 -4
  4. data/lib/engineyard-serverside/logged_output.rb +3 -5
  5. data/lib/engineyard-serverside/server.rb +26 -2
  6. data/lib/engineyard-serverside/task.rb +2 -4
  7. data/lib/engineyard-serverside/version.rb +1 -1
  8. data/lib/engineyard-serverside.rb +8 -20
  9. data/spec/basic_deploy_spec.rb +1 -1
  10. data/spec/bundler_deploy_spec.rb +1 -1
  11. data/spec/nodejs_deploy_spec.rb +1 -1
  12. data/spec/rails31_deploy_spec.rb +1 -1
  13. data/spec/services_deploy_spec.rb +1 -1
  14. metadata +80 -233
  15. data/lib/vendor/dataflow/HISTORY +0 -52
  16. data/lib/vendor/dataflow/LICENSE +0 -19
  17. data/lib/vendor/dataflow/README.textile +0 -290
  18. data/lib/vendor/dataflow/Rakefile +0 -36
  19. data/lib/vendor/dataflow/dataflow/actor.rb +0 -22
  20. data/lib/vendor/dataflow/dataflow/equality.rb +0 -44
  21. data/lib/vendor/dataflow/dataflow/future_queue.rb +0 -24
  22. data/lib/vendor/dataflow/dataflow/port.rb +0 -54
  23. data/lib/vendor/dataflow/dataflow.rb +0 -124
  24. data/lib/vendor/dataflow/examples/barrier.rb +0 -9
  25. data/lib/vendor/dataflow/examples/data_driven.rb +0 -17
  26. data/lib/vendor/dataflow/examples/dataflow_http_gets.rb +0 -13
  27. data/lib/vendor/dataflow/examples/flow.rb +0 -20
  28. data/lib/vendor/dataflow/examples/future_http_gets.rb +0 -12
  29. data/lib/vendor/dataflow/examples/future_queue.rb +0 -11
  30. data/lib/vendor/dataflow/examples/instance_variables.rb +0 -15
  31. data/lib/vendor/dataflow/examples/laziness.rb +0 -9
  32. data/lib/vendor/dataflow/examples/local_variables.rb +0 -11
  33. data/lib/vendor/dataflow/examples/messages.rb +0 -26
  34. data/lib/vendor/dataflow/examples/port_http_gets.rb +0 -13
  35. data/lib/vendor/dataflow/examples/port_send.rb +0 -10
  36. data/lib/vendor/dataflow/examples/ring.rb +0 -21
  37. data/lib/vendor/dataflow/spec/actor_spec.rb +0 -28
  38. data/lib/vendor/dataflow/spec/anonymous_variables_spec.rb +0 -21
  39. data/lib/vendor/dataflow/spec/barrier_spec.rb +0 -25
  40. data/lib/vendor/dataflow/spec/by_need_spec.rb +0 -55
  41. data/lib/vendor/dataflow/spec/dataflow_spec.rb +0 -151
  42. data/lib/vendor/dataflow/spec/equality_spec.rb +0 -40
  43. data/lib/vendor/dataflow/spec/flow_spec.rb +0 -25
  44. data/lib/vendor/dataflow/spec/forker_spec.rb +0 -28
  45. data/lib/vendor/dataflow/spec/future_queue_spec.rb +0 -31
  46. data/lib/vendor/dataflow/spec/inspect_spec.rb +0 -19
  47. data/lib/vendor/dataflow/spec/need_later_spec.rb +0 -12
  48. data/lib/vendor/dataflow/spec/port_spec.rb +0 -26
  49. data/lib/vendor/dataflow/spec/spec.opts +0 -1
  50. data/lib/vendor/dataflow/spec/spec_helper.rb +0 -10
  51. data/lib/vendor/escape/Readme +0 -21
  52. data/lib/vendor/escape/doc_include/template/qualitysmith.rb +0 -631
  53. data/lib/vendor/json_pure/CHANGES +0 -166
  54. data/lib/vendor/json_pure/COPYING +0 -58
  55. data/lib/vendor/json_pure/GPL +0 -340
  56. data/lib/vendor/json_pure/README +0 -358
  57. data/lib/vendor/json_pure/Rakefile +0 -292
  58. data/lib/vendor/json_pure/TODO +0 -1
  59. data/lib/vendor/json_pure/VERSION +0 -1
  60. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +0 -52
  61. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +0 -1000
  62. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +0 -1001
  63. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +0 -900
  64. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +0 -901
  65. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +0 -1000
  66. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +0 -1001
  67. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +0 -261
  68. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +0 -1000
  69. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +0 -1001
  70. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +0 -1000
  71. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +0 -1001
  72. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +0 -1000
  73. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +0 -1001
  74. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +0 -262
  75. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +0 -1000
  76. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +0 -1001
  77. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +0 -82
  78. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +0 -34
  79. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +0 -900
  80. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +0 -901
  81. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +0 -81
  82. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +0 -1000
  83. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +0 -1001
  84. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +0 -82
  85. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +0 -1000
  86. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +0 -1001
  87. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +0 -82
  88. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +0 -1000
  89. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +0 -1001
  90. data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +0 -82
  91. data/lib/vendor/json_pure/benchmarks/generator2_benchmark.rb +0 -222
  92. data/lib/vendor/json_pure/benchmarks/generator_benchmark.rb +0 -224
  93. data/lib/vendor/json_pure/benchmarks/ohai.json +0 -1216
  94. data/lib/vendor/json_pure/benchmarks/ohai.ruby +0 -1
  95. data/lib/vendor/json_pure/benchmarks/parser2_benchmark.rb +0 -251
  96. data/lib/vendor/json_pure/benchmarks/parser_benchmark.rb +0 -259
  97. data/lib/vendor/json_pure/bin/edit_json.rb +0 -9
  98. data/lib/vendor/json_pure/bin/prettify_json.rb +0 -75
  99. data/lib/vendor/json_pure/data/example.json +0 -1
  100. data/lib/vendor/json_pure/data/index.html +0 -38
  101. data/lib/vendor/json_pure/data/prototype.js +0 -4184
  102. data/lib/vendor/json_pure/ext/json/ext/generator/extconf.rb +0 -16
  103. data/lib/vendor/json_pure/ext/json/ext/generator/generator.c +0 -1323
  104. data/lib/vendor/json_pure/ext/json/ext/generator/generator.h +0 -170
  105. data/lib/vendor/json_pure/ext/json/ext/parser/extconf.rb +0 -15
  106. data/lib/vendor/json_pure/ext/json/ext/parser/parser.c +0 -1935
  107. data/lib/vendor/json_pure/ext/json/ext/parser/parser.h +0 -71
  108. data/lib/vendor/json_pure/ext/json/ext/parser/parser.rl +0 -792
  109. data/lib/vendor/json_pure/install.rb +0 -26
  110. data/lib/vendor/json_pure/tests/fixtures/fail1.json +0 -1
  111. data/lib/vendor/json_pure/tests/fixtures/fail10.json +0 -1
  112. data/lib/vendor/json_pure/tests/fixtures/fail11.json +0 -1
  113. data/lib/vendor/json_pure/tests/fixtures/fail12.json +0 -1
  114. data/lib/vendor/json_pure/tests/fixtures/fail13.json +0 -1
  115. data/lib/vendor/json_pure/tests/fixtures/fail14.json +0 -1
  116. data/lib/vendor/json_pure/tests/fixtures/fail18.json +0 -1
  117. data/lib/vendor/json_pure/tests/fixtures/fail19.json +0 -1
  118. data/lib/vendor/json_pure/tests/fixtures/fail2.json +0 -1
  119. data/lib/vendor/json_pure/tests/fixtures/fail20.json +0 -1
  120. data/lib/vendor/json_pure/tests/fixtures/fail21.json +0 -1
  121. data/lib/vendor/json_pure/tests/fixtures/fail22.json +0 -1
  122. data/lib/vendor/json_pure/tests/fixtures/fail23.json +0 -1
  123. data/lib/vendor/json_pure/tests/fixtures/fail24.json +0 -1
  124. data/lib/vendor/json_pure/tests/fixtures/fail25.json +0 -1
  125. data/lib/vendor/json_pure/tests/fixtures/fail27.json +0 -2
  126. data/lib/vendor/json_pure/tests/fixtures/fail28.json +0 -2
  127. data/lib/vendor/json_pure/tests/fixtures/fail3.json +0 -1
  128. data/lib/vendor/json_pure/tests/fixtures/fail4.json +0 -1
  129. data/lib/vendor/json_pure/tests/fixtures/fail5.json +0 -1
  130. data/lib/vendor/json_pure/tests/fixtures/fail6.json +0 -1
  131. data/lib/vendor/json_pure/tests/fixtures/fail7.json +0 -1
  132. data/lib/vendor/json_pure/tests/fixtures/fail8.json +0 -1
  133. data/lib/vendor/json_pure/tests/fixtures/fail9.json +0 -1
  134. data/lib/vendor/json_pure/tests/fixtures/pass1.json +0 -56
  135. data/lib/vendor/json_pure/tests/fixtures/pass15.json +0 -1
  136. data/lib/vendor/json_pure/tests/fixtures/pass16.json +0 -1
  137. data/lib/vendor/json_pure/tests/fixtures/pass17.json +0 -1
  138. data/lib/vendor/json_pure/tests/fixtures/pass2.json +0 -1
  139. data/lib/vendor/json_pure/tests/fixtures/pass26.json +0 -1
  140. data/lib/vendor/json_pure/tests/fixtures/pass3.json +0 -6
  141. data/lib/vendor/json_pure/tests/test_json.rb +0 -361
  142. data/lib/vendor/json_pure/tests/test_json_addition.rb +0 -162
  143. data/lib/vendor/json_pure/tests/test_json_encoding.rb +0 -68
  144. data/lib/vendor/json_pure/tests/test_json_fixtures.rb +0 -34
  145. data/lib/vendor/json_pure/tests/test_json_generate.rb +0 -122
  146. data/lib/vendor/json_pure/tests/test_json_rails.rb +0 -144
  147. data/lib/vendor/json_pure/tests/test_json_unicode.rb +0 -76
  148. data/lib/vendor/json_pure/tools/fuzz.rb +0 -139
  149. data/lib/vendor/json_pure/tools/server.rb +0 -61
  150. data/lib/vendor/open4/lib/open4.rb +0 -403
  151. data/lib/vendor/thor/CHANGELOG.rdoc +0 -89
  152. data/lib/vendor/thor/LICENSE +0 -20
  153. data/lib/vendor/thor/README.rdoc +0 -297
  154. data/lib/vendor/thor/Thorfile +0 -69
  155. data/lib/vendor/thor/bin/rake2thor +0 -86
  156. data/lib/vendor/thor/bin/thor +0 -6
  157. data/lib/vendor/thor/lib/thor/actions/create_file.rb +0 -103
  158. data/lib/vendor/thor/lib/thor/actions/directory.rb +0 -91
  159. data/lib/vendor/thor/lib/thor/actions/empty_directory.rb +0 -134
  160. data/lib/vendor/thor/lib/thor/actions/file_manipulation.rb +0 -223
  161. data/lib/vendor/thor/lib/thor/actions/inject_into_file.rb +0 -104
  162. data/lib/vendor/thor/lib/thor/actions.rb +0 -275
  163. data/lib/vendor/thor/lib/thor/base.rb +0 -540
  164. data/lib/vendor/thor/lib/thor/core_ext/file_binary_read.rb +0 -9
  165. data/lib/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +0 -75
  166. data/lib/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -100
  167. data/lib/vendor/thor/lib/thor/error.rb +0 -30
  168. data/lib/vendor/thor/lib/thor/group.rb +0 -271
  169. data/lib/vendor/thor/lib/thor/invocation.rb +0 -180
  170. data/lib/vendor/thor/lib/thor/parser/argument.rb +0 -67
  171. data/lib/vendor/thor/lib/thor/parser/arguments.rb +0 -150
  172. data/lib/vendor/thor/lib/thor/parser/option.rb +0 -128
  173. data/lib/vendor/thor/lib/thor/parser/options.rb +0 -169
  174. data/lib/vendor/thor/lib/thor/parser.rb +0 -4
  175. data/lib/vendor/thor/lib/thor/rake_compat.rb +0 -66
  176. data/lib/vendor/thor/lib/thor/runner.rb +0 -314
  177. data/lib/vendor/thor/lib/thor/shell/basic.rb +0 -239
  178. data/lib/vendor/thor/lib/thor/shell/color.rb +0 -108
  179. data/lib/vendor/thor/lib/thor/shell.rb +0 -83
  180. data/lib/vendor/thor/lib/thor/task.rb +0 -102
  181. data/lib/vendor/thor/lib/thor/util.rb +0 -230
  182. data/lib/vendor/thor/lib/thor/version.rb +0 -3
  183. data/lib/vendor/thor/lib/thor.rb +0 -244
  184. data/lib/vendor/thor/thor.gemspec +0 -120
@@ -1,9 +0,0 @@
1
- require "#{File.dirname(__FILE__)}/../dataflow"
2
- include Dataflow
3
-
4
- local do |x, y, z|
5
- Thread.new { unify y, by_need { 4 } }
6
- Thread.new { unify z, x + y }
7
- Thread.new { unify x, by_need { 3 } }
8
- puts z
9
- end
@@ -1,11 +0,0 @@
1
- require "#{File.dirname(__FILE__)}/../dataflow"
2
- include Dataflow
3
-
4
- local do |x, y, z|
5
- # notice how the order automatically gets resolved
6
- Thread.new { unify y, x + 2 }
7
- Thread.new { unify z, y + 3 }
8
- Thread.new { unify x, 1 }
9
- puts z
10
- end
11
-
@@ -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
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- require 'spec'
3
- require "#{File.dirname(__FILE__)}/../dataflow"
4
- require "#{File.dirname(__FILE__)}/../dataflow/equality"
5
-
6
- Thread.abort_on_exception = true
7
-
8
- Spec::Runner.configure do |config|
9
- config.include Dataflow
10
- end
@@ -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
- ...