engineyard-serverside 1.2.0
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/LICENSE +19 -0
- data/bin/engineyard-serverside +10 -0
- data/lib/engineyard-serverside.rb +49 -0
- data/lib/engineyard-serverside/bundle_installer.rb +4 -0
- data/lib/engineyard-serverside/cli.rb +146 -0
- data/lib/engineyard-serverside/configuration.rb +130 -0
- data/lib/engineyard-serverside/default_maintenance_page.html +29 -0
- data/lib/engineyard-serverside/deploy.rb +321 -0
- data/lib/engineyard-serverside/deploy_hook.rb +80 -0
- data/lib/engineyard-serverside/lockfile_parser.rb +55 -0
- data/lib/engineyard-serverside/logged_output.rb +78 -0
- data/lib/engineyard-serverside/server.rb +70 -0
- data/lib/engineyard-serverside/strategies/git.rb +136 -0
- data/lib/engineyard-serverside/task.rb +62 -0
- data/lib/engineyard-serverside/version.rb +3 -0
- data/lib/vendor/dataflow/HISTORY +52 -0
- data/lib/vendor/dataflow/LICENSE +19 -0
- data/lib/vendor/dataflow/README.textile +290 -0
- data/lib/vendor/dataflow/Rakefile +36 -0
- data/lib/vendor/dataflow/dataflow.rb +120 -0
- data/lib/vendor/dataflow/dataflow/actor.rb +22 -0
- data/lib/vendor/dataflow/dataflow/equality.rb +28 -0
- data/lib/vendor/dataflow/dataflow/future_queue.rb +24 -0
- data/lib/vendor/dataflow/dataflow/port.rb +54 -0
- data/lib/vendor/dataflow/examples/barrier.rb +9 -0
- data/lib/vendor/dataflow/examples/data_driven.rb +17 -0
- data/lib/vendor/dataflow/examples/dataflow_http_gets.rb +13 -0
- data/lib/vendor/dataflow/examples/flow.rb +20 -0
- data/lib/vendor/dataflow/examples/future_http_gets.rb +12 -0
- data/lib/vendor/dataflow/examples/future_queue.rb +11 -0
- data/lib/vendor/dataflow/examples/instance_variables.rb +15 -0
- data/lib/vendor/dataflow/examples/laziness.rb +9 -0
- data/lib/vendor/dataflow/examples/local_variables.rb +11 -0
- data/lib/vendor/dataflow/examples/messages.rb +26 -0
- data/lib/vendor/dataflow/examples/port_http_gets.rb +13 -0
- data/lib/vendor/dataflow/examples/port_send.rb +10 -0
- data/lib/vendor/dataflow/examples/ring.rb +21 -0
- data/lib/vendor/dataflow/spec/actor_spec.rb +28 -0
- data/lib/vendor/dataflow/spec/anonymous_variables_spec.rb +21 -0
- data/lib/vendor/dataflow/spec/barrier_spec.rb +25 -0
- data/lib/vendor/dataflow/spec/by_need_spec.rb +55 -0
- data/lib/vendor/dataflow/spec/dataflow_spec.rb +151 -0
- data/lib/vendor/dataflow/spec/equality_spec.rb +40 -0
- data/lib/vendor/dataflow/spec/flow_spec.rb +25 -0
- data/lib/vendor/dataflow/spec/forker_spec.rb +28 -0
- data/lib/vendor/dataflow/spec/future_queue_spec.rb +31 -0
- data/lib/vendor/dataflow/spec/inspect_spec.rb +19 -0
- data/lib/vendor/dataflow/spec/need_later_spec.rb +12 -0
- data/lib/vendor/dataflow/spec/port_spec.rb +26 -0
- data/lib/vendor/dataflow/spec/spec.opts +1 -0
- data/lib/vendor/dataflow/spec/spec_helper.rb +10 -0
- data/lib/vendor/escape/Readme +21 -0
- data/lib/vendor/escape/doc_include/template/qualitysmith.rb +631 -0
- data/lib/vendor/escape/lib/escape.rb +247 -0
- data/lib/vendor/json_pure/CHANGES +166 -0
- data/lib/vendor/json_pure/COPYING +58 -0
- data/lib/vendor/json_pure/GPL +340 -0
- data/lib/vendor/json_pure/README +358 -0
- data/lib/vendor/json_pure/Rakefile +292 -0
- data/lib/vendor/json_pure/TODO +1 -0
- data/lib/vendor/json_pure/VERSION +1 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
- data/lib/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
- data/lib/vendor/json_pure/benchmarks/generator2_benchmark.rb +222 -0
- data/lib/vendor/json_pure/benchmarks/generator_benchmark.rb +224 -0
- data/lib/vendor/json_pure/benchmarks/ohai.json +1216 -0
- data/lib/vendor/json_pure/benchmarks/ohai.ruby +1 -0
- data/lib/vendor/json_pure/benchmarks/parser2_benchmark.rb +251 -0
- data/lib/vendor/json_pure/benchmarks/parser_benchmark.rb +259 -0
- data/lib/vendor/json_pure/bin/edit_json.rb +9 -0
- data/lib/vendor/json_pure/bin/prettify_json.rb +75 -0
- data/lib/vendor/json_pure/data/example.json +1 -0
- data/lib/vendor/json_pure/data/index.html +38 -0
- data/lib/vendor/json_pure/data/prototype.js +4184 -0
- data/lib/vendor/json_pure/ext/json/ext/generator/extconf.rb +16 -0
- data/lib/vendor/json_pure/ext/json/ext/generator/generator.c +1323 -0
- data/lib/vendor/json_pure/ext/json/ext/generator/generator.h +170 -0
- data/lib/vendor/json_pure/ext/json/ext/parser/extconf.rb +15 -0
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.c +1935 -0
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.h +71 -0
- data/lib/vendor/json_pure/ext/json/ext/parser/parser.rl +792 -0
- data/lib/vendor/json_pure/install.rb +26 -0
- data/lib/vendor/json_pure/lib/json.rb +10 -0
- data/lib/vendor/json_pure/lib/json/Array.xpm +21 -0
- data/lib/vendor/json_pure/lib/json/FalseClass.xpm +21 -0
- data/lib/vendor/json_pure/lib/json/Hash.xpm +21 -0
- data/lib/vendor/json_pure/lib/json/Key.xpm +73 -0
- data/lib/vendor/json_pure/lib/json/NilClass.xpm +21 -0
- data/lib/vendor/json_pure/lib/json/Numeric.xpm +28 -0
- data/lib/vendor/json_pure/lib/json/String.xpm +96 -0
- data/lib/vendor/json_pure/lib/json/TrueClass.xpm +21 -0
- data/lib/vendor/json_pure/lib/json/add/core.rb +148 -0
- data/lib/vendor/json_pure/lib/json/add/rails.rb +58 -0
- data/lib/vendor/json_pure/lib/json/common.rb +397 -0
- data/lib/vendor/json_pure/lib/json/editor.rb +1371 -0
- data/lib/vendor/json_pure/lib/json/ext.rb +15 -0
- data/lib/vendor/json_pure/lib/json/json.xpm +1499 -0
- data/lib/vendor/json_pure/lib/json/pure.rb +77 -0
- data/lib/vendor/json_pure/lib/json/pure/generator.rb +452 -0
- data/lib/vendor/json_pure/lib/json/pure/parser.rb +307 -0
- data/lib/vendor/json_pure/lib/json/version.rb +8 -0
- data/lib/vendor/json_pure/tests/fixtures/fail1.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail10.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail11.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail12.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail13.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail14.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail18.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail19.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail2.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail20.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail21.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail22.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail23.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail24.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail25.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail27.json +2 -0
- data/lib/vendor/json_pure/tests/fixtures/fail28.json +2 -0
- data/lib/vendor/json_pure/tests/fixtures/fail3.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail4.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail5.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail6.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail7.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail8.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/fail9.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/pass1.json +56 -0
- data/lib/vendor/json_pure/tests/fixtures/pass15.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/pass16.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/pass17.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/pass2.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/pass26.json +1 -0
- data/lib/vendor/json_pure/tests/fixtures/pass3.json +6 -0
- data/lib/vendor/json_pure/tests/test_json.rb +361 -0
- data/lib/vendor/json_pure/tests/test_json_addition.rb +162 -0
- data/lib/vendor/json_pure/tests/test_json_encoding.rb +68 -0
- data/lib/vendor/json_pure/tests/test_json_fixtures.rb +34 -0
- data/lib/vendor/json_pure/tests/test_json_generate.rb +122 -0
- data/lib/vendor/json_pure/tests/test_json_rails.rb +144 -0
- data/lib/vendor/json_pure/tests/test_json_unicode.rb +76 -0
- data/lib/vendor/json_pure/tools/fuzz.rb +139 -0
- data/lib/vendor/json_pure/tools/server.rb +61 -0
- data/lib/vendor/open4/lib/open4.rb +403 -0
- data/lib/vendor/thor/CHANGELOG.rdoc +89 -0
- data/lib/vendor/thor/LICENSE +20 -0
- data/lib/vendor/thor/README.rdoc +297 -0
- data/lib/vendor/thor/Thorfile +69 -0
- data/lib/vendor/thor/bin/rake2thor +86 -0
- data/lib/vendor/thor/bin/thor +6 -0
- data/lib/vendor/thor/lib/thor.rb +244 -0
- data/lib/vendor/thor/lib/thor/actions.rb +275 -0
- data/lib/vendor/thor/lib/thor/actions/create_file.rb +103 -0
- data/lib/vendor/thor/lib/thor/actions/directory.rb +91 -0
- data/lib/vendor/thor/lib/thor/actions/empty_directory.rb +134 -0
- data/lib/vendor/thor/lib/thor/actions/file_manipulation.rb +223 -0
- data/lib/vendor/thor/lib/thor/actions/inject_into_file.rb +104 -0
- data/lib/vendor/thor/lib/thor/base.rb +540 -0
- data/lib/vendor/thor/lib/thor/core_ext/file_binary_read.rb +9 -0
- data/lib/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +75 -0
- data/lib/vendor/thor/lib/thor/core_ext/ordered_hash.rb +100 -0
- data/lib/vendor/thor/lib/thor/error.rb +30 -0
- data/lib/vendor/thor/lib/thor/group.rb +271 -0
- data/lib/vendor/thor/lib/thor/invocation.rb +180 -0
- data/lib/vendor/thor/lib/thor/parser.rb +4 -0
- data/lib/vendor/thor/lib/thor/parser/argument.rb +67 -0
- data/lib/vendor/thor/lib/thor/parser/arguments.rb +150 -0
- data/lib/vendor/thor/lib/thor/parser/option.rb +128 -0
- data/lib/vendor/thor/lib/thor/parser/options.rb +169 -0
- data/lib/vendor/thor/lib/thor/rake_compat.rb +66 -0
- data/lib/vendor/thor/lib/thor/runner.rb +314 -0
- data/lib/vendor/thor/lib/thor/shell.rb +83 -0
- data/lib/vendor/thor/lib/thor/shell/basic.rb +239 -0
- data/lib/vendor/thor/lib/thor/shell/color.rb +108 -0
- data/lib/vendor/thor/lib/thor/task.rb +102 -0
- data/lib/vendor/thor/lib/thor/util.rb +230 -0
- data/lib/vendor/thor/lib/thor/version.rb +3 -0
- data/lib/vendor/thor/thor.gemspec +120 -0
- data/spec/custom_deploy_spec.rb +95 -0
- data/spec/deploy_hook_spec.rb +211 -0
- data/spec/fixtures/gitrepo.tar.gz +0 -0
- data/spec/fixtures/gitrepo/foo +0 -0
- data/spec/fixtures/invalid_hook.rb +1 -0
- data/spec/fixtures/valid_hook.rb +1 -0
- data/spec/git_strategy_spec.rb +22 -0
- data/spec/lockfile_parser_spec.rb +30 -0
- data/spec/spec_helper.rb +37 -0
- data/spec/support/lockfiles/0.9-no-bundler +111 -0
- data/spec/support/lockfiles/0.9-with-bundler +117 -0
- data/spec/support/lockfiles/1.0-no-bundler +54 -0
- data/spec/support/lockfiles/1.0.0.rc.1-with-bundler +162 -0
- data/spec/support/lockfiles/not-a-lockfile +10 -0
- metadata +279 -0
|
@@ -0,0 +1,151 @@
|
|
|
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
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--color
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
...
|
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
module RDoc
|
|
2
|
+
module Page
|
|
3
|
+
|
|
4
|
+
FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif"
|
|
5
|
+
|
|
6
|
+
STYLE = <<CSS
|
|
7
|
+
a {
|
|
8
|
+
color: #00F;
|
|
9
|
+
text-decoration: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
a:hover {
|
|
13
|
+
color: #77F;
|
|
14
|
+
text-decoration: underline;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body, td, p {
|
|
18
|
+
font-family: %fonts%;
|
|
19
|
+
background: #FFF;
|
|
20
|
+
color: #000;
|
|
21
|
+
margin: 0px;
|
|
22
|
+
font-size: small;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#content {
|
|
26
|
+
margin: 2em;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#description p {
|
|
30
|
+
margin-bottom: 0.5em;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sectiontitle {
|
|
34
|
+
margin-top: 1em;
|
|
35
|
+
margin-bottom: 1em;
|
|
36
|
+
padding: 0.5em;
|
|
37
|
+
padding-left: 2em;
|
|
38
|
+
background: #005;
|
|
39
|
+
color: #FFF;
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
border: 1px dotted black;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.attr-rw {
|
|
45
|
+
padding-left: 1em;
|
|
46
|
+
padding-right: 1em;
|
|
47
|
+
text-align: center;
|
|
48
|
+
color: #055;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.attr-name {
|
|
52
|
+
font-weight: bold;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.attr-desc {
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.attr-value {
|
|
59
|
+
font-family: monospace;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.file-title-prefix {
|
|
63
|
+
font-size: large;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.file-title {
|
|
67
|
+
font-size: large;
|
|
68
|
+
font-weight: bold;
|
|
69
|
+
background: #005;
|
|
70
|
+
color: #FFF;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.banner {
|
|
74
|
+
background: #005;
|
|
75
|
+
color: #FFF;
|
|
76
|
+
border: 1px solid black;
|
|
77
|
+
padding: 1em;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.banner td {
|
|
81
|
+
background: transparent;
|
|
82
|
+
color: #FFF;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
h1 a, h2 a, .sectiontitle a, .banner a {
|
|
86
|
+
color: #FF0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover {
|
|
90
|
+
color: #FF7;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.dyn-source {
|
|
94
|
+
display: none;
|
|
95
|
+
background: #FFE;
|
|
96
|
+
color: #000;
|
|
97
|
+
border: 1px dotted black;
|
|
98
|
+
margin: 0.5em 2em 0.5em 2em;
|
|
99
|
+
padding: 0.5em;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dyn-source .cmt {
|
|
103
|
+
color: #00F;
|
|
104
|
+
font-style: italic;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.dyn-source .kw {
|
|
108
|
+
color: #070;
|
|
109
|
+
font-weight: bold;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.method {
|
|
113
|
+
margin-left: 1em;
|
|
114
|
+
margin-right: 1em;
|
|
115
|
+
margin-bottom: 1em;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.description pre {
|
|
119
|
+
padding: 0.5em;
|
|
120
|
+
border: 1px dotted black;
|
|
121
|
+
background: #FFE;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.method .title {
|
|
125
|
+
font-family: monospace;
|
|
126
|
+
font-size: large;
|
|
127
|
+
border-bottom: 1px dashed black;
|
|
128
|
+
margin-bottom: 0.3em;
|
|
129
|
+
padding-bottom: 0.1em;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.method .description, .method .sourcecode {
|
|
133
|
+
margin-left: 1em;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.description p, .sourcecode p {
|
|
137
|
+
margin-bottom: 0.5em;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.method .sourcecode p.source-link {
|
|
141
|
+
text-indent: 0em;
|
|
142
|
+
margin-top: 0.5em;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.method .aka {
|
|
146
|
+
margin-top: 0.3em;
|
|
147
|
+
margin-left: 1em;
|
|
148
|
+
font-style: italic;
|
|
149
|
+
text-indent: 2em;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
h1 {
|
|
153
|
+
padding: 1em;
|
|
154
|
+
border: 1px solid black;
|
|
155
|
+
font-size: x-large;
|
|
156
|
+
font-weight: bold;
|
|
157
|
+
color: #FFF;
|
|
158
|
+
background: #007;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
h2 {
|
|
162
|
+
padding: 0.5em 1em 0.5em 1em;
|
|
163
|
+
border: 1px solid black;
|
|
164
|
+
font-size: large;
|
|
165
|
+
font-weight: bold;
|
|
166
|
+
color: #FFF;
|
|
167
|
+
background: #009;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
h3, h4, h5, h6 {
|
|
171
|
+
padding: 0.2em 1em 0.2em 1em;
|
|
172
|
+
border: 1px dashed black;
|
|
173
|
+
color: #000;
|
|
174
|
+
background: #AAF;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.sourcecode > pre {
|
|
178
|
+
padding: 0.5em;
|
|
179
|
+
border: 1px dotted black;
|
|
180
|
+
background: #FFE;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
CSS
|
|
184
|
+
|
|
185
|
+
XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
|
|
186
|
+
<!DOCTYPE html
|
|
187
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
188
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
HEADER = XHTML_PREAMBLE + <<ENDHEADER
|
|
192
|
+
<html>
|
|
193
|
+
<head>
|
|
194
|
+
<title>%title%</title>
|
|
195
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
|
196
|
+
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
|
|
197
|
+
|
|
198
|
+
<script language="JavaScript" type="text/javascript">
|
|
199
|
+
// <![CDATA[
|
|
200
|
+
|
|
201
|
+
function toggleSource( id )
|
|
202
|
+
{
|
|
203
|
+
var elem
|
|
204
|
+
var link
|
|
205
|
+
|
|
206
|
+
if( document.getElementById )
|
|
207
|
+
{
|
|
208
|
+
elem = document.getElementById( id )
|
|
209
|
+
link = document.getElementById( "l_" + id )
|
|
210
|
+
}
|
|
211
|
+
else if ( document.all )
|
|
212
|
+
{
|
|
213
|
+
elem = eval( "document.all." + id )
|
|
214
|
+
link = eval( "document.all.l_" + id )
|
|
215
|
+
}
|
|
216
|
+
else
|
|
217
|
+
return false;
|
|
218
|
+
|
|
219
|
+
if( elem.style.display == "block" )
|
|
220
|
+
{
|
|
221
|
+
elem.style.display = "none"
|
|
222
|
+
link.innerHTML = "show source"
|
|
223
|
+
}
|
|
224
|
+
else
|
|
225
|
+
{
|
|
226
|
+
elem.style.display = "block"
|
|
227
|
+
link.innerHTML = "hide source"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function openCode( url )
|
|
232
|
+
{
|
|
233
|
+
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
|
234
|
+
}
|
|
235
|
+
// ]]>
|
|
236
|
+
</script>
|
|
237
|
+
</head>
|
|
238
|
+
|
|
239
|
+
<body>
|
|
240
|
+
ENDHEADER
|
|
241
|
+
|
|
242
|
+
FILE_PAGE = <<HTML
|
|
243
|
+
<table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
|
|
244
|
+
<tr><td>
|
|
245
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0'><tr>
|
|
246
|
+
<td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td>
|
|
247
|
+
<td align="right">
|
|
248
|
+
<table border='0' cellspacing="0" cellpadding="2">
|
|
249
|
+
<tr>
|
|
250
|
+
<td>Path:</td>
|
|
251
|
+
<td>%full_path%
|
|
252
|
+
IF:cvsurl
|
|
253
|
+
(<a href="%cvsurl%">CVS</a>)
|
|
254
|
+
ENDIF:cvsurl
|
|
255
|
+
</td>
|
|
256
|
+
</tr>
|
|
257
|
+
<tr>
|
|
258
|
+
<td>Modified:</td>
|
|
259
|
+
<td>%dtm_modified%</td>
|
|
260
|
+
</tr>
|
|
261
|
+
</table>
|
|
262
|
+
</td></tr>
|
|
263
|
+
</table>
|
|
264
|
+
</td></tr>
|
|
265
|
+
</table><br>
|
|
266
|
+
HTML
|
|
267
|
+
|
|
268
|
+
###################################################################
|
|
269
|
+
|
|
270
|
+
CLASS_PAGE = <<HTML
|
|
271
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
|
272
|
+
<td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td>
|
|
273
|
+
<td align="right">
|
|
274
|
+
<table cellspacing=0 cellpadding=2>
|
|
275
|
+
<tr valign="top">
|
|
276
|
+
<td>In:</td>
|
|
277
|
+
<td>
|
|
278
|
+
START:infiles
|
|
279
|
+
HREF:full_path_url:full_path:
|
|
280
|
+
IF:cvsurl
|
|
281
|
+
(<a href="%cvsurl%">CVS</a>)
|
|
282
|
+
ENDIF:cvsurl
|
|
283
|
+
END:infiles
|
|
284
|
+
</td>
|
|
285
|
+
</tr>
|
|
286
|
+
IF:parent
|
|
287
|
+
<tr>
|
|
288
|
+
<td>Parent:</td>
|
|
289
|
+
<td>
|
|
290
|
+
IF:par_url
|
|
291
|
+
<a href="%par_url%">
|
|
292
|
+
ENDIF:par_url
|
|
293
|
+
%parent%
|
|
294
|
+
IF:par_url
|
|
295
|
+
</a>
|
|
296
|
+
ENDIF:par_url
|
|
297
|
+
</td>
|
|
298
|
+
</tr>
|
|
299
|
+
ENDIF:parent
|
|
300
|
+
</table>
|
|
301
|
+
</td>
|
|
302
|
+
</tr>
|
|
303
|
+
</table>
|
|
304
|
+
HTML
|
|
305
|
+
|
|
306
|
+
###################################################################
|
|
307
|
+
|
|
308
|
+
METHOD_LIST = <<HTML
|
|
309
|
+
<div id="content">
|
|
310
|
+
IF:diagram
|
|
311
|
+
<table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center">
|
|
312
|
+
%diagram%
|
|
313
|
+
</td></tr></table>
|
|
314
|
+
ENDIF:diagram
|
|
315
|
+
|
|
316
|
+
IF:description
|
|
317
|
+
<div class="description">%description%</div>
|
|
318
|
+
ENDIF:description
|
|
319
|
+
|
|
320
|
+
IF:requires
|
|
321
|
+
<div class="sectiontitle">Required Files</div>
|
|
322
|
+
<ul>
|
|
323
|
+
START:requires
|
|
324
|
+
<li>HREF:aref:name:</li>
|
|
325
|
+
END:requires
|
|
326
|
+
</ul>
|
|
327
|
+
ENDIF:requires
|
|
328
|
+
|
|
329
|
+
IF:toc
|
|
330
|
+
<div class="sectiontitle">Contents</div>
|
|
331
|
+
<ul>
|
|
332
|
+
START:toc
|
|
333
|
+
<li><a href="#%href%">%secname%</a></li>
|
|
334
|
+
END:toc
|
|
335
|
+
</ul>
|
|
336
|
+
ENDIF:toc
|
|
337
|
+
|
|
338
|
+
IF:methods
|
|
339
|
+
<div class="sectiontitle">Methods</div>
|
|
340
|
+
<ul>
|
|
341
|
+
START:methods
|
|
342
|
+
<li>HREF:aref:name:</li>
|
|
343
|
+
END:methods
|
|
344
|
+
</ul>
|
|
345
|
+
ENDIF:methods
|
|
346
|
+
|
|
347
|
+
IF:includes
|
|
348
|
+
<div class="sectiontitle">Included Modules</div>
|
|
349
|
+
<ul>
|
|
350
|
+
START:includes
|
|
351
|
+
<li>HREF:aref:name:</li>
|
|
352
|
+
END:includes
|
|
353
|
+
</ul>
|
|
354
|
+
ENDIF:includes
|
|
355
|
+
|
|
356
|
+
START:sections
|
|
357
|
+
IF:sectitle
|
|
358
|
+
<div class="sectiontitle"><a name="%secsequence%">%sectitle%</a></div>
|
|
359
|
+
IF:seccomment
|
|
360
|
+
<div class="description">
|
|
361
|
+
%seccomment%
|
|
362
|
+
</div>
|
|
363
|
+
ENDIF:seccomment
|
|
364
|
+
ENDIF:sectitle
|
|
365
|
+
|
|
366
|
+
IF:classlist
|
|
367
|
+
<div class="sectiontitle">Classes and Modules</div>
|
|
368
|
+
%classlist%
|
|
369
|
+
ENDIF:classlist
|
|
370
|
+
|
|
371
|
+
IF:constants
|
|
372
|
+
<div class="sectiontitle">Constants</div>
|
|
373
|
+
<table border='0' cellpadding='5'>
|
|
374
|
+
START:constants
|
|
375
|
+
<tr valign='top'>
|
|
376
|
+
<td class="attr-name">%name%</td>
|
|
377
|
+
<td>=</td>
|
|
378
|
+
<td class="attr-value">%value%</td>
|
|
379
|
+
</tr>
|
|
380
|
+
IF:desc
|
|
381
|
+
<tr valign='top'>
|
|
382
|
+
<td> </td>
|
|
383
|
+
<td colspan="2" class="attr-desc">%desc%</td>
|
|
384
|
+
</tr>
|
|
385
|
+
ENDIF:desc
|
|
386
|
+
END:constants
|
|
387
|
+
</table>
|
|
388
|
+
ENDIF:constants
|
|
389
|
+
|
|
390
|
+
IF:attributes
|
|
391
|
+
<div class="sectiontitle">Attributes</div>
|
|
392
|
+
<table border='0' cellpadding='5'>
|
|
393
|
+
START:attributes
|
|
394
|
+
<tr valign='top'>
|
|
395
|
+
<td class='attr-rw'>
|
|
396
|
+
IF:rw
|
|
397
|
+
[%rw%]
|
|
398
|
+
ENDIF:rw
|
|
399
|
+
</td>
|
|
400
|
+
<td class='attr-name'>%name%</td>
|
|
401
|
+
<td class='attr-desc'>%a_desc%</td>
|
|
402
|
+
</tr>
|
|
403
|
+
END:attributes
|
|
404
|
+
</table>
|
|
405
|
+
ENDIF:attributes
|
|
406
|
+
|
|
407
|
+
IF:method_list
|
|
408
|
+
START:method_list
|
|
409
|
+
IF:methods
|
|
410
|
+
<div class="sectiontitle">%type% %category% methods</div>
|
|
411
|
+
START:methods
|
|
412
|
+
<div class="method">
|
|
413
|
+
<div class="title">
|
|
414
|
+
IF:callseq
|
|
415
|
+
<a name="%aref%"></a><b>%callseq%</b>
|
|
416
|
+
ENDIF:callseq
|
|
417
|
+
IFNOT:callseq
|
|
418
|
+
<a name="%aref%"></a><b>%name%</b>%params%
|
|
419
|
+
ENDIF:callseq
|
|
420
|
+
IF:codeurl
|
|
421
|
+
[ <a href="javascript:openCode('%codeurl%')">source</a> ]
|
|
422
|
+
ENDIF:codeurl
|
|
423
|
+
</div>
|
|
424
|
+
IF:m_desc
|
|
425
|
+
<div class="description">
|
|
426
|
+
%m_desc%
|
|
427
|
+
</div>
|
|
428
|
+
ENDIF:m_desc
|
|
429
|
+
IF:aka
|
|
430
|
+
<div class="aka">
|
|
431
|
+
This method is also aliased as
|
|
432
|
+
START:aka
|
|
433
|
+
<a href="%aref%">%name%</a>
|
|
434
|
+
END:aka
|
|
435
|
+
</div>
|
|
436
|
+
ENDIF:aka
|
|
437
|
+
IF:sourcecode
|
|
438
|
+
<div class="sourcecode">
|
|
439
|
+
<p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p>
|
|
440
|
+
<div id="%aref%_source" class="dyn-source">
|
|
441
|
+
<pre>
|
|
442
|
+
%sourcecode%
|
|
443
|
+
</pre>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
446
|
+
ENDIF:sourcecode
|
|
447
|
+
</div>
|
|
448
|
+
END:methods
|
|
449
|
+
ENDIF:methods
|
|
450
|
+
END:method_list
|
|
451
|
+
ENDIF:method_list
|
|
452
|
+
END:sections
|
|
453
|
+
</div>
|
|
454
|
+
HTML
|
|
455
|
+
|
|
456
|
+
FOOTER = <<ENDFOOTER
|
|
457
|
+
</body>
|
|
458
|
+
</html>
|
|
459
|
+
ENDFOOTER
|
|
460
|
+
|
|
461
|
+
BODY = HEADER + <<ENDBODY
|
|
462
|
+
!INCLUDE! <!-- banner header -->
|
|
463
|
+
|
|
464
|
+
<div id="bodyContent">
|
|
465
|
+
#{METHOD_LIST}
|
|
466
|
+
</div>
|
|
467
|
+
|
|
468
|
+
#{FOOTER}
|
|
469
|
+
ENDBODY
|
|
470
|
+
|
|
471
|
+
########################## Source code ##########################
|
|
472
|
+
|
|
473
|
+
SRC_PAGE = XHTML_PREAMBLE + <<HTML
|
|
474
|
+
<html>
|
|
475
|
+
<head><title>%title%</title>
|
|
476
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
|
477
|
+
<style>
|
|
478
|
+
.ruby-comment { color: green; font-style: italic }
|
|
479
|
+
.ruby-constant { color: #4433aa; font-weight: bold; }
|
|
480
|
+
.ruby-identifier { color: #222222; }
|
|
481
|
+
.ruby-ivar { color: #2233dd; }
|
|
482
|
+
.ruby-keyword { color: #3333FF; font-weight: bold }
|
|
483
|
+
.ruby-node { color: #777777; }
|
|
484
|
+
.ruby-operator { color: #111111; }
|
|
485
|
+
.ruby-regexp { color: #662222; }
|
|
486
|
+
.ruby-value { color: #662222; font-style: italic }
|
|
487
|
+
.kw { color: #3333FF; font-weight: bold }
|
|
488
|
+
.cmt { color: green; font-style: italic }
|
|
489
|
+
.str { color: #662222; font-style: italic }
|
|
490
|
+
.re { color: #662222; }
|
|
491
|
+
</style>
|
|
492
|
+
</head>
|
|
493
|
+
<body bgcolor="white">
|
|
494
|
+
<pre>%code%</pre>
|
|
495
|
+
</body>
|
|
496
|
+
</html>
|
|
497
|
+
HTML
|
|
498
|
+
|
|
499
|
+
########################## Index ################################
|
|
500
|
+
|
|
501
|
+
FR_INDEX_BODY = <<HTML
|
|
502
|
+
!INCLUDE!
|
|
503
|
+
HTML
|
|
504
|
+
|
|
505
|
+
FILE_INDEX = XHTML_PREAMBLE + <<HTML
|
|
506
|
+
<html>
|
|
507
|
+
<head>
|
|
508
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
|
509
|
+
<style>
|
|
510
|
+
<!--
|
|
511
|
+
body {
|
|
512
|
+
background-color: #EEE;
|
|
513
|
+
font-family: #{FONTS};
|
|
514
|
+
color: #000;
|
|
515
|
+
margin: 0px;
|
|
516
|
+
}
|
|
517
|
+
.banner {
|
|
518
|
+
background: #005;
|
|
519
|
+
color: #FFF;
|
|
520
|
+
padding: 0.2em;
|
|
521
|
+
font-size: small;
|
|
522
|
+
font-weight: bold;
|
|
523
|
+
text-align: center;
|
|
524
|
+
}
|
|
525
|
+
.entries {
|
|
526
|
+
margin: 0.25em 1em 0 1em;
|
|
527
|
+
font-size: x-small;
|
|
528
|
+
}
|
|
529
|
+
a {
|
|
530
|
+
display: block;
|
|
531
|
+
color: #00F;
|
|
532
|
+
text-decoration: none;
|
|
533
|
+
white-space: nowrap;
|
|
534
|
+
}
|
|
535
|
+
a:hover {
|
|
536
|
+
color: #77F;
|
|
537
|
+
text-decoration: underline;
|
|
538
|
+
}
|
|
539
|
+
input#link_search {
|
|
540
|
+
color: #a00;
|
|
541
|
+
}
|
|
542
|
+
input#link_search.default {
|
|
543
|
+
color: #888;
|
|
544
|
+
}
|
|
545
|
+
-->
|
|
546
|
+
</style>
|
|
547
|
+
<script type="text/javascript" language="javascript">
|
|
548
|
+
function init_frame_select() {
|
|
549
|
+
var opts = document.getElementById('frame_select').options;
|
|
550
|
+
for (i = 0; i < opts.length; i++) {
|
|
551
|
+
opts[i].selected = (location.href.indexOf(opts[i].value) != -1);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
function do_link_search() {
|
|
555
|
+
var search_box = document.getElementById('link_search');
|
|
556
|
+
if (search_box.value == search_box.defaultValue) return;
|
|
557
|
+
var links = document.getElementById('entries').getElementsByTagName('a');
|
|
558
|
+
search = new RegExp(search_box.value, 'i');
|
|
559
|
+
for (i = 0; i < links.length; i++) {
|
|
560
|
+
links[i].style.display = search.exec(links[i].innerHTML) ? 'block' : 'none';
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
function clear_link_search() {
|
|
564
|
+
var search_box = document.getElementById('link_search');
|
|
565
|
+
if (search_box.value == search_box.defaultValue) search_box.value = '';
|
|
566
|
+
search_box.className = '';
|
|
567
|
+
}
|
|
568
|
+
function reset_link_search() {
|
|
569
|
+
var search_box = document.getElementById('link_search');
|
|
570
|
+
if (search_box.value == '') search_box.value = search_box.defaultValue;
|
|
571
|
+
search_box.className = 'default';
|
|
572
|
+
}
|
|
573
|
+
</script>
|
|
574
|
+
<base target="docwin">
|
|
575
|
+
</head>
|
|
576
|
+
<body onload="init_frame_select(); reset_link_search();">
|
|
577
|
+
<select id="frame_select" onchange="location.href=this.value" style="width: 100%;">
|
|
578
|
+
<option value="fr_class_index.html">Classes</option>
|
|
579
|
+
<option value="fr_file_index.html">Files</option>
|
|
580
|
+
<option value="fr_method_index.html">Methods</option>
|
|
581
|
+
</select>
|
|
582
|
+
<input id="link_search" class="default" type="text" onkeyup="do_link_search()" onfocus="clear_link_search()" onblur="reset_link_search()" style="width: 100%;" value="type search here..." />
|
|
583
|
+
<div class="banner">%list_title%</div>
|
|
584
|
+
<div class="entries" id="entries">
|
|
585
|
+
START:entries
|
|
586
|
+
<a href="%href%">%name%</a>
|
|
587
|
+
END:entries
|
|
588
|
+
</div>
|
|
589
|
+
</body></html>
|
|
590
|
+
HTML
|
|
591
|
+
|
|
592
|
+
CLASS_INDEX = FILE_INDEX
|
|
593
|
+
METHOD_INDEX = FILE_INDEX
|
|
594
|
+
|
|
595
|
+
INDEX = XHTML_PREAMBLE + <<HTML
|
|
596
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
597
|
+
<head>
|
|
598
|
+
<title>%title%</title>
|
|
599
|
+
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
|
|
600
|
+
</head>
|
|
601
|
+
|
|
602
|
+
<frameset cols="200, *">
|
|
603
|
+
<frame src="fr_class_index.html" name="framewin" />
|
|
604
|
+
<frame src="%initial_page%" name="docwin" />
|
|
605
|
+
</frameset>
|
|
606
|
+
|
|
607
|
+
<frameset cols="200,*">
|
|
608
|
+
<frame src="fr_class_index.html" name="framewin" />
|
|
609
|
+
IF:inline_source
|
|
610
|
+
<frame src="%initial_page%" name="docwin">
|
|
611
|
+
ENDIF:inline_source
|
|
612
|
+
IFNOT:inline_source
|
|
613
|
+
<frameset rows="80%,20%">
|
|
614
|
+
<frame src="%initial_page%" name="docwin">
|
|
615
|
+
<frame src="blank.html" name="source">
|
|
616
|
+
</frameset>
|
|
617
|
+
ENDIF:inline_source
|
|
618
|
+
<noframes>
|
|
619
|
+
<body bgcolor="white">
|
|
620
|
+
Click <a href="html/index.html">here</a> for a non-frames
|
|
621
|
+
version of this page.
|
|
622
|
+
</body>
|
|
623
|
+
</noframes>
|
|
624
|
+
</frameset>
|
|
625
|
+
|
|
626
|
+
</html>
|
|
627
|
+
HTML
|
|
628
|
+
|
|
629
|
+
end
|
|
630
|
+
end
|
|
631
|
+
|