copland 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. data/doc/README +88 -0
  2. data/doc/manual-html/chapter-1.html +454 -0
  3. data/doc/manual-html/chapter-10.html +399 -0
  4. data/doc/manual-html/chapter-11.html +600 -0
  5. data/doc/manual-html/chapter-12.html +406 -0
  6. data/doc/manual-html/chapter-2.html +382 -0
  7. data/doc/manual-html/chapter-3.html +424 -0
  8. data/doc/manual-html/chapter-4.html +432 -0
  9. data/doc/manual-html/chapter-5.html +381 -0
  10. data/doc/manual-html/chapter-6.html +364 -0
  11. data/doc/manual-html/chapter-7.html +434 -0
  12. data/doc/manual-html/chapter-8.html +373 -0
  13. data/doc/manual-html/chapter-9.html +324 -0
  14. data/doc/manual-html/copland.png +0 -0
  15. data/doc/manual-html/index.html +331 -0
  16. data/doc/manual-html/manual.css +179 -0
  17. data/doc/manual-html/tutorial-1.html +407 -0
  18. data/doc/manual-html/tutorial-2.html +451 -0
  19. data/doc/manual-html/tutorial-3.html +484 -0
  20. data/doc/manual-html/tutorial-4.html +446 -0
  21. data/doc/manual-html/tutorial-5.html +520 -0
  22. data/doc/manual/chapter.erb +18 -0
  23. data/doc/manual/example.erb +18 -0
  24. data/doc/manual/img/copland.png +0 -0
  25. data/doc/manual/index.erb +30 -0
  26. data/doc/manual/manual.css +179 -0
  27. data/doc/manual/manual.rb +239 -0
  28. data/doc/manual/manual.yml +2643 -0
  29. data/doc/manual/page.erb +102 -0
  30. data/doc/manual/tutorial.erb +30 -0
  31. data/doc/packages/copland.html +764 -0
  32. data/doc/packages/copland.lib.html +439 -0
  33. data/doc/packages/copland.remote.html +2096 -0
  34. data/doc/packages/copland.webrick.html +925 -0
  35. data/doc/packages/index.html +49 -0
  36. data/doc/packages/packrat.css +125 -0
  37. data/examples/calc/calc.rb +47 -0
  38. data/examples/calc/package.yml +35 -0
  39. data/examples/calc/services.rb +74 -0
  40. data/examples/solitaire-cipher/README +11 -0
  41. data/examples/solitaire-cipher/Rakefile +57 -0
  42. data/examples/solitaire-cipher/bin/main.rb +14 -0
  43. data/examples/solitaire-cipher/lib/cipher.rb +230 -0
  44. data/examples/solitaire-cipher/lib/cli.rb +24 -0
  45. data/examples/solitaire-cipher/lib/package.yml +106 -0
  46. data/examples/solitaire-cipher/test/tc_deck.rb +30 -0
  47. data/examples/solitaire-cipher/test/tc_key-stream.rb +19 -0
  48. data/examples/solitaire-cipher/test/tc_keying-algorithms.rb +31 -0
  49. data/examples/solitaire-cipher/test/tc_solitaire-cipher.rb +66 -0
  50. data/examples/solitaire-cipher/test/tc_unkeyed-algorithm.rb +17 -0
  51. data/examples/solitaire-cipher/test/tests.rb +2 -0
  52. data/lib/copland.rb +56 -0
  53. data/lib/copland/class-factory.rb +95 -0
  54. data/lib/copland/configuration-point.rb +38 -0
  55. data/lib/copland/configuration-point/common.rb +203 -0
  56. data/lib/copland/configuration-point/errors.rb +44 -0
  57. data/lib/copland/configuration-point/list.rb +59 -0
  58. data/lib/copland/configuration-point/map.rb +59 -0
  59. data/lib/copland/configuration/errors.rb +43 -0
  60. data/lib/copland/configuration/loader.rb +113 -0
  61. data/lib/copland/configuration/yaml/configuration-point.rb +87 -0
  62. data/lib/copland/configuration/yaml/implementor.rb +134 -0
  63. data/lib/copland/configuration/yaml/interceptor.rb +63 -0
  64. data/lib/copland/configuration/yaml/listener.rb +56 -0
  65. data/lib/copland/configuration/yaml/loader.rb +122 -0
  66. data/lib/copland/configuration/yaml/package.rb +125 -0
  67. data/lib/copland/configuration/yaml/parser.rb +71 -0
  68. data/lib/copland/configuration/yaml/schema.rb +165 -0
  69. data/lib/copland/configuration/yaml/service-point.rb +116 -0
  70. data/lib/copland/configuration/yaml/utils.rb +82 -0
  71. data/lib/copland/default-schema-processor.rb +144 -0
  72. data/lib/copland/errors.rb +82 -0
  73. data/lib/copland/event-producer.rb +95 -0
  74. data/lib/copland/impl/builder-factory.rb +112 -0
  75. data/lib/copland/impl/copland-config.yml +1 -0
  76. data/lib/copland/impl/include-exclude.rb +140 -0
  77. data/lib/copland/impl/logging-interceptor.rb +106 -0
  78. data/lib/copland/impl/package.yml +217 -0
  79. data/lib/copland/impl/startup.rb +116 -0
  80. data/lib/copland/impl/symbol-source-manager.rb +131 -0
  81. data/lib/copland/impl/symbol-source.rb +63 -0
  82. data/lib/copland/instantiator.rb +38 -0
  83. data/lib/copland/instantiator/abstract.rb +91 -0
  84. data/lib/copland/instantiator/complex.rb +96 -0
  85. data/lib/copland/instantiator/identity.rb +58 -0
  86. data/lib/copland/instantiator/simple.rb +68 -0
  87. data/lib/copland/interceptor-chain.rb +166 -0
  88. data/lib/copland/interceptor.rb +139 -0
  89. data/lib/copland/log-factory.rb +206 -0
  90. data/lib/copland/models.rb +39 -0
  91. data/lib/copland/models/abstract.rb +78 -0
  92. data/lib/copland/models/prototype-deferred.rb +58 -0
  93. data/lib/copland/models/prototype.rb +58 -0
  94. data/lib/copland/models/proxy.rb +100 -0
  95. data/lib/copland/models/singleton-deferred.rb +59 -0
  96. data/lib/copland/models/singleton.rb +77 -0
  97. data/lib/copland/models/threaded.rb +65 -0
  98. data/lib/copland/ordering.rb +123 -0
  99. data/lib/copland/package.rb +246 -0
  100. data/lib/copland/registry.rb +368 -0
  101. data/lib/copland/schema.rb +206 -0
  102. data/lib/copland/service-point.rb +282 -0
  103. data/lib/copland/utils.rb +221 -0
  104. data/lib/copland/version.rb +47 -0
  105. data/test/conf-test/list-bad-key.yml +30 -0
  106. data/test/conf-test/list-bad-missing.yml +28 -0
  107. data/test/conf-test/list-bad-type.yml +28 -0
  108. data/test/conf-test/list-good.yml +29 -0
  109. data/test/conf-test/map-bad-key.yml +25 -0
  110. data/test/conf-test/map-bad-missing.yml +24 -0
  111. data/test/conf-test/map-bad-type.yml +23 -0
  112. data/test/conf-test/map-good.yml +25 -0
  113. data/test/configuration-point/package.yml +52 -0
  114. data/test/configuration/yaml/config/copland-config.yml +2 -0
  115. data/test/configuration/yaml/config/module.yml +2 -0
  116. data/test/configuration/yaml/config/subdir/copland-config.yml +2 -0
  117. data/test/configuration/yaml/config/subdir/package.yml +4 -0
  118. data/test/configuration/yaml/defaults/package.yml +5 -0
  119. data/test/configuration/yaml/defaults/subdir/package.yml +4 -0
  120. data/test/configuration/yaml/tc_config-loader.rb +86 -0
  121. data/test/configuration/yaml/tc_configuration-point-processor.rb +134 -0
  122. data/test/configuration/yaml/tc_implementor-processor.rb +104 -0
  123. data/test/configuration/yaml/tc_interceptor-processor.rb +85 -0
  124. data/test/configuration/yaml/tc_listener-processor.rb +69 -0
  125. data/test/configuration/yaml/tc_loader.rb +74 -0
  126. data/test/configuration/yaml/tc_package-processor.rb +120 -0
  127. data/test/configuration/yaml/tc_parser.rb +94 -0
  128. data/test/configuration/yaml/tc_schema-parser.rb +160 -0
  129. data/test/configuration/yaml/tc_service-point-processor.rb +104 -0
  130. data/test/configuration/yaml/tc_type-validator.rb +90 -0
  131. data/test/custom-logger.yml +3 -0
  132. data/test/impl/logging/package.yml +44 -0
  133. data/test/impl/logging/services.rb +84 -0
  134. data/test/impl/startup/package.yml +46 -0
  135. data/test/impl/startup/services.rb +47 -0
  136. data/test/impl/symbols/package.yml +24 -0
  137. data/test/impl/symbols/services.rb +38 -0
  138. data/test/impl/tc_builder-factory.rb +173 -0
  139. data/test/impl/tc_logging-interceptor.rb +148 -0
  140. data/test/impl/tc_startup.rb +59 -0
  141. data/test/impl/tc_symbol-sources.rb +61 -0
  142. data/test/logger.yml +6 -0
  143. data/test/mock.rb +201 -0
  144. data/test/schema/bad-package.yml +65 -0
  145. data/test/schema/package.yml +102 -0
  146. data/test/schema/services.rb +5 -0
  147. data/test/services/package.yml +79 -0
  148. data/test/services/simple.rb +87 -0
  149. data/test/tc_class-factory.rb +93 -0
  150. data/test/tc_complex-instantiator.rb +107 -0
  151. data/test/tc_configuration-point-contrib.rb +74 -0
  152. data/test/tc_configuration-point-schema.rb +122 -0
  153. data/test/tc_configuration-point.rb +91 -0
  154. data/test/tc_default-schema-processor.rb +297 -0
  155. data/test/tc_identity-instantiator.rb +61 -0
  156. data/test/tc_interceptors.rb +84 -0
  157. data/test/tc_logger.rb +131 -0
  158. data/test/tc_models.rb +176 -0
  159. data/test/tc_package.rb +165 -0
  160. data/test/tc_proxy.rb +65 -0
  161. data/test/tc_registry.rb +141 -0
  162. data/test/tc_schema.rb +78 -0
  163. data/test/tc_service-point.rb +178 -0
  164. data/test/tc_service.rb +70 -0
  165. data/test/tc_simple-instantiator.rb +61 -0
  166. data/test/tests.rb +93 -0
  167. data/tutorial/01/main.rb +7 -0
  168. data/tutorial/01/package.yml +8 -0
  169. data/tutorial/01/tutorial.rb +7 -0
  170. data/tutorial/02/main.rb +10 -0
  171. data/tutorial/02/package.yml +27 -0
  172. data/tutorial/02/tutorial.rb +46 -0
  173. data/tutorial/03/main.rb +24 -0
  174. data/tutorial/03/package.yml +29 -0
  175. data/tutorial/03/tutorial.rb +48 -0
  176. data/tutorial/04/main.rb +24 -0
  177. data/tutorial/04/package.yml +35 -0
  178. data/tutorial/04/tutorial.rb +48 -0
  179. data/tutorial/05/functions/package.yml +16 -0
  180. data/tutorial/05/functions/services.rb +15 -0
  181. data/tutorial/05/main.rb +10 -0
  182. data/tutorial/05/package.yml +35 -0
  183. data/tutorial/05/tutorial.rb +53 -0
  184. metadata +260 -0
@@ -0,0 +1,18 @@
1
+ <h1><%= object.index %>. <%= object.title %></h1>
2
+
3
+ <% object.sections.each do |section|
4
+
5
+ if section.title %>
6
+
7
+ <h2>
8
+ <a name="s<%= section.index %>"></a>
9
+ <%= object.index %>.<%= section.index %>. <%= section.title %>
10
+ </h2>
11
+
12
+ <% end %>
13
+
14
+ <div class="section">
15
+ <%= section.content.to_html %>
16
+ </div>
17
+
18
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <h1>Example #<%= object.index %>. <%= object.title %></h1>
2
+
3
+ <h2>Introduction</h2>
4
+
5
+ <%= object.intro.to_html %>
6
+
7
+ <h2>Design</h2>
8
+
9
+ <%= object.design.to_html %>
10
+
11
+ <h2>Implementation</h2>
12
+
13
+ <%= object.implementation.to_html %>
14
+
15
+ <h2>Summary</h2>
16
+
17
+ <%= object.summary.to_html %>
18
+
@@ -0,0 +1,30 @@
1
+ <p class="product-manual">Product Manual</p>
2
+
3
+ <p align="center">
4
+ <img src="<%= manual.product.logo %>"
5
+ alt="<%= manual.product.name %>: <%= manual.product.tagline %>" />
6
+ </p>
7
+
8
+ <p align="center">
9
+ <%= manual.product.name %> Website:
10
+ <a href="<%= manual.product.web %>"><%= manual.product.web %></a><br />
11
+ <%= manual.product.name %> Project Website:
12
+ <a href="<%= manual.product.project %>"><%= manual.product.project %></a><br />
13
+ </p>
14
+
15
+ <% if manual.recent_updates && manual.recent_updates.length > 0 %>
16
+ <p align="center"><strong>Recent Updates to This Manual</strong></p>
17
+ <table border='0' cellpadding='0' cellspacing='0' align='center'><tr><td>
18
+ <ul>
19
+ <% manual.recent_updates.each do |update| %>
20
+ <li><%= update %></li>
21
+ <% end %>
22
+ </ul>
23
+ </table>
24
+ <% end %>
25
+
26
+ <p class="copyright">
27
+ Copyright &copy; <%= manual.meta.copyright %>
28
+ <%= manual.meta.author %>
29
+ (<a href="mailto:<%= manual.meta.email %>"><%= manual.meta.email %></a>)
30
+ </p>
@@ -0,0 +1,179 @@
1
+ body {
2
+ background: #FFF;
3
+ font-family: sans-serif;
4
+ color: #000;
5
+ margin: 0px;
6
+ }
7
+
8
+ a {
9
+ color: #00F;
10
+ text-decoration: none;
11
+ }
12
+
13
+ a:hover {
14
+ text-decoration: underline;
15
+ }
16
+
17
+ .product-manual {
18
+ text-align: center;
19
+ font-size: x-large;
20
+ font-variant: small-caps;
21
+ font-weight: bold;
22
+ color: #005;
23
+ }
24
+
25
+ .copyright {
26
+ text-align: center;
27
+ font-size: small;
28
+ font-style: italic;
29
+ color: #005;
30
+ margin-top: 1in;
31
+ }
32
+
33
+ #banner {
34
+ background: #005;
35
+ color: #FFF;
36
+ border-bottom: 1px solid #000;
37
+ padding-top: 0.5em;
38
+ padding-bottom: 0.5em;
39
+ padding-left: 1em;
40
+ margin-bottom: 1em;
41
+ }
42
+
43
+ #banner .title {
44
+ font-size: x-large;
45
+ }
46
+
47
+ #banner .title:first-letter {
48
+ font-size: 250%;
49
+ font-weight: normal;
50
+ float: left;
51
+ margin-top: -7px;
52
+ margin-bottom: -7px;
53
+ }
54
+
55
+ #banner .product {
56
+ font-weight: bold;
57
+ color: #FF7;
58
+ letter-spacing: 0.5em;
59
+ }
60
+
61
+ #banner .tagline {
62
+ font-style: italic;
63
+ font-size: large;
64
+ color: #FFF;
65
+ }
66
+
67
+ #banner .info {
68
+ color: white;
69
+ font-size: small;
70
+ padding-right: 1em;
71
+ }
72
+
73
+ #content {
74
+ margin-left: 0cm;
75
+ margin-right: 1cm;
76
+ }
77
+
78
+ #navigation {
79
+ font-size: x-small;
80
+ border-right: 2px groove black;
81
+ border-top: 2px groove black;
82
+ margin-right: 1em;
83
+ width: 200px;
84
+ height: 100%;
85
+ background: #FFD;
86
+ }
87
+
88
+ #navigation ul, #navigation ol {
89
+ margin-left: 1.5em;
90
+ padding-left: 1.5em;
91
+ }
92
+
93
+ #navigation .license {
94
+ font-size: x-small;
95
+ text-align: center;
96
+ border-top: 1px dashed #005;
97
+ margin-top: 2em;
98
+ padding: 1em;
99
+ }
100
+
101
+ .section {
102
+ margin-bottom: 1em;
103
+ }
104
+
105
+ .section p {
106
+ text-align: justify;
107
+ }
108
+
109
+ #content pre {
110
+ background: #FFE;
111
+ border: 1px dotted #AAA;
112
+ padding: 1em;
113
+ }
114
+
115
+ #content h1 {
116
+ background: #005;
117
+ color: #FFF;
118
+ font-size: x-large;
119
+ font-weight: bold;
120
+ font-variant: small-caps;
121
+ padding: 0.5em;
122
+ border: 1px solid #000;
123
+ margin-top: 0px;
124
+ margin-bottom: 1em;
125
+ }
126
+
127
+ #content h2 {
128
+ background: #005;
129
+ color: #FFF;
130
+ font-size: large;
131
+ font-weight: bold;
132
+ font-variant: small-caps;
133
+ padding: 0.25em;
134
+ padding-left: 0.5em;
135
+ border: 1px solid #000;
136
+ margin-bottom: 1em;
137
+ }
138
+
139
+ #content h3 {
140
+ background: #FFD;
141
+ color: #000;
142
+ font-size: normal;
143
+ font-weight: bold;
144
+ font-variant: small-caps;
145
+ padding: 0.25em;
146
+ padding-left: 0.5em;
147
+ border: 1px dotted #000;
148
+ margin-bottom: 1em;
149
+ }
150
+
151
+ #navigation h1 {
152
+ margin: 0px;
153
+ padding: 1em;
154
+ color: #005;
155
+ background: transparent;
156
+ font-weight: bold;
157
+ font-size: 150%;
158
+ font-variant: small-caps;
159
+ text-align: center;
160
+ }
161
+
162
+ #navigation h2 {
163
+ margin: 0px;
164
+ margin-bottom: 1em;
165
+ padding: 0.5em;
166
+ border-top: 1px dashed #005;
167
+ border-bottom: 1px dashed #005;
168
+ color: #005;
169
+ background: transparent;
170
+ font-weight: bold;
171
+ font-size: 125%;
172
+ font-variant: small-caps;
173
+ text-align: center;
174
+ }
175
+
176
+ table.list td {
177
+ border-bottom: 1px dotted #005;
178
+ padding-bottom: 5px;
179
+ }
@@ -0,0 +1,239 @@
1
+ # --------------------------------------------------------------------------
2
+ # Portions of this code were taken from the "poignant.rb" script created
3
+ # by whytheluckystiff, which generates "Why's (Poignant) Guide to Ruby".
4
+ # The original script may be obtained from the poignant CVS repository,
5
+ # at http://poignant.rubyforge.org.
6
+ #
7
+ # This script is distributed under the by-sa/1.0 Creative Commons license.
8
+ # --------------------------------------------------------------------------
9
+
10
+ require 'erb'
11
+ require 'ftools'
12
+ require 'yaml'
13
+
14
+ require 'rubygems'
15
+ require_gem 'RedCloth'
16
+
17
+ module Copland
18
+ module Manual
19
+
20
+ class Manual
21
+ attr_accessor :product, :meta, :chapters, :tutorials, :examples, :recent_updates
22
+
23
+ def Manual.load( file_name )
24
+ File.open( file_name ) { |file| YAML.load( file ) }
25
+ end
26
+ end
27
+
28
+ class Meta
29
+ attr_accessor :copyright, :author, :email
30
+ end
31
+
32
+ class Product
33
+ attr_accessor :name, :tagline, :version, :logo, :web, :project
34
+ end
35
+
36
+ class Sidebar
37
+ attr_accessor :title, :content
38
+ end
39
+
40
+ class Chapter
41
+ attr_accessor :index, :title, :sections
42
+
43
+ def initialize( index, title, sections )
44
+ @index = index
45
+ @title = title
46
+
47
+ section_index = 0
48
+ @sections = sections.collect do |section|
49
+ section_index += 1
50
+ if section.respond_to? :keys
51
+ Section.new( section_index, section.keys.first, section.values.first )
52
+ else
53
+ section_index -= 1
54
+ Section.new( section_index, nil, section )
55
+ end
56
+ end
57
+ end
58
+
59
+ def page_title
60
+ "Chapter #{index}: #{title}"
61
+ end
62
+ end
63
+
64
+ class Tutorial
65
+ attr_accessor :index, :title, :brief, :intro, :steps, :summary
66
+
67
+ def initialize( index, title, brief, intro, steps, summary )
68
+ @index = index
69
+ @title = title
70
+ @brief = RedCloth.new( brief )
71
+ @intro = RedCloth.new( intro ) if intro
72
+ @summary = RedCloth.new( summary ) if summary
73
+ @steps = steps.map { |step| RedCloth.new( step ) }
74
+ end
75
+
76
+ def page_title
77
+ "Tutorial #{index}: #{title}"
78
+ end
79
+ end
80
+
81
+ class Example
82
+ attr_accessor :index, :title, :brief, :intro, :design, :implementation, :summary
83
+
84
+ def initialize( index, title, brief, intro, design, implementation, summary )
85
+ @index = index
86
+ @title = title
87
+ @brief = RedCloth.new( brief )
88
+ @intro = RedCloth.new( intro )
89
+ @design = RedCloth.new( design )
90
+ @implementation = RedCloth.new( implementation )
91
+ @summary = RedCloth.new( summary )
92
+ end
93
+
94
+ def page_title
95
+ "Example #{index}: #{title}"
96
+ end
97
+ end
98
+
99
+ class Section
100
+ attr_accessor :index, :title, :content
101
+
102
+ def initialize( index, title, content )
103
+ @index = index
104
+ @title = title
105
+ @content = RedCloth.new( content )
106
+ end
107
+ end
108
+
109
+ YAML.add_domain_type( 'jamisbuck.org,2004', 'manual' ) do |taguri, val|
110
+ index = 0
111
+
112
+ val['chapters'].collect! do |chapter|
113
+ index += 1
114
+ Chapter.new( index, chapter.keys.first, chapter.values.first )
115
+ end
116
+
117
+ index = 0
118
+ ( val['tutorials'] ||= [] ).collect! do |tutorial|
119
+ index += 1
120
+ content = tutorial.values.first
121
+ Tutorial.new( index, tutorial.keys.first, content['brief'], content['intro'],
122
+ content['steps'], content['summary'] )
123
+ end
124
+
125
+ index = 0
126
+ ( val['examples'] ||= [] ).collect! do |example|
127
+ index += 1
128
+ content = example.values.first
129
+ Example.new( index, example.keys.first, content['brief'], content['intro'], content['design'],
130
+ content['implementation'], content['summary'] )
131
+ end
132
+
133
+ YAML.object_maker( Manual, val )
134
+ end
135
+
136
+ YAML.add_domain_type( 'jamisbuck.org,2004', 'meta' ) do |taguri, val|
137
+ YAML.object_maker( Meta, val )
138
+ end
139
+
140
+ YAML.add_domain_type( 'jamisbuck.org,2004', 'product' ) do |taguri, val|
141
+ version = val["version"]
142
+ if version.respond_to?( :type_id )
143
+ if version.type_id == "version"
144
+ if version.value =~ %r{(.*)/(.*)}
145
+ require_file, constant = $1, $2
146
+ else
147
+ constant = version.value
148
+ end
149
+
150
+ require require_file if require_file
151
+ val["version"] = eval(constant)
152
+ else
153
+ raise "Unexpected type: #{val.type_id}"
154
+ end
155
+ end
156
+ YAML.object_maker( Product, val )
157
+ end
158
+
159
+ YAML.add_domain_type( 'jamisbuck.org,2004', 'sidebar' ) do |taguri, val|
160
+ YAML.object_maker( Sidebar,
161
+ 'title' => val.keys.first,
162
+ 'content'=> RedCloth.new( val.values.first ) )
163
+ end
164
+
165
+ end
166
+ end
167
+
168
+ if __FILE__ == $0
169
+
170
+ def log_action( action )
171
+ $stderr.puts action
172
+ end
173
+
174
+ unless ( output_path = ARGV[0] )
175
+ $stderr.puts "Usage: #{$0} [/path/to/save/html]"
176
+ exit
177
+ end
178
+
179
+ Dir.mkdir output_path rescue nil
180
+
181
+ log_action "Loading manual.yml..."
182
+ manual = Copland::Manual::Manual.load( 'manual.yml' )
183
+
184
+ # force these to be defined at the TOPLEVEL_BINDING
185
+ object = nil
186
+ guts = nil
187
+
188
+ page = File.open( "page.erb" ) { |file| ERB.new( file.read ) }
189
+ page.filename = "page.erb"
190
+
191
+ template = File.open( "index.erb" ) { |file| ERB.new( file.read ) }
192
+ template.filename = "index.erb"
193
+
194
+ File.open( File.join( output_path, "index.html" ), "w" ) do |file|
195
+ guts = template.result
196
+ file << page.result
197
+ end
198
+
199
+ template = File.open( "chapter.erb" ) { |file| ERB.new( file.read ) }
200
+ template.filename = "chapter.erb"
201
+
202
+ manual.chapters.each do |object|
203
+ log_action "Processing chapter ##{object.index}..."
204
+ File.open( File.join( output_path, "chapter-#{object.index}.html" ), "w" ) do |file|
205
+ guts = template.result
206
+ file << page.result
207
+ end
208
+ end
209
+
210
+ template = File.open( "tutorial.erb" ) { |file| ERB.new( file.read ) }
211
+ template.filename = "tutorial.erb"
212
+
213
+ manual.tutorials.each do |object|
214
+ log_action "Processing tutorial ##{object.index}..."
215
+ File.open( File.join( output_path, "tutorial-#{object.index}.html" ), "w" ) do |file|
216
+ guts = template.result
217
+ file << page.result
218
+ end
219
+ end
220
+
221
+ # template = File.open( "example.erb" ) { |file| ERB.new( file.read ) }
222
+ # template.filename = "example.erb"
223
+
224
+ # manual.examples.each do |object|
225
+ # log_action "Processing example ##{object.index}..."
226
+ # File.open( File.join( output_path, "example-#{object.index}.html" ), "w" ) do |file|
227
+ # guts = template.result
228
+ # file << page.result
229
+ # end
230
+ # end
231
+
232
+ log_action "Copying manual.css..."
233
+ File.copy( "manual.css", output_path )
234
+
235
+ log_action "Copying copland.png..."
236
+ File.copy( "img/copland.png", output_path )
237
+
238
+ log_action "Done!"
239
+ end