nitro 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/AUTHORS +4 -1
  2. data/ChangeLog +290 -7
  3. data/README +3 -3
  4. data/RELEASES +94 -0
  5. data/Rakefile +7 -7
  6. data/benchmark/og/bench.rb +11 -10
  7. data/{ChangeLog.1 → doc/ChangeLog.1} +0 -0
  8. data/doc/apache.txt +9 -0
  9. data/doc/architecture.txt +1 -27
  10. data/doc/bugs.txt +11 -4
  11. data/doc/config.txt +22 -0
  12. data/doc/og_config.txt +35 -0
  13. data/doc/og_tutorial.txt +595 -0
  14. data/doc/tutorial.txt +22 -0
  15. data/examples/blog/conf/apache.conf +30 -0
  16. data/examples/blog/conf/lhttpd.conf +2 -2
  17. data/examples/blog/lib/blog/controller.rb +11 -2
  18. data/examples/blog/log/apache.error_log +5528 -0
  19. data/examples/blog/root/fcgi.rb +1 -1
  20. data/examples/blog/run.rb +9 -3
  21. data/examples/flash/run.rb +2 -2
  22. data/examples/no_xsl_blog/conf/apache.conf +30 -0
  23. data/examples/no_xsl_blog/conf/lhttpd.conf +1 -1
  24. data/examples/no_xsl_blog/lib/blog/controller.rb +2 -2
  25. data/examples/no_xsl_blog/log/apache.error_log +68 -0
  26. data/examples/no_xsl_blog/root/fcgi.rb +2 -2
  27. data/examples/no_xsl_blog/run.rb +3 -3
  28. data/examples/og/run.rb +1 -1
  29. data/examples/tiny/conf/apache.conf +29 -4
  30. data/examples/tiny/conf/lhttpd.conf +1 -1
  31. data/examples/tiny/log/apache.error_log +30 -0
  32. data/examples/tiny/root/fcgi.rb +2 -2
  33. data/examples/tiny/root/index.xhtml +1 -1
  34. data/examples/tiny/run.rb +3 -2
  35. data/examples/wee_style/run.rb +7 -9
  36. data/examples/why_wiki/README +5 -0
  37. data/examples/why_wiki/run.rb +57 -0
  38. data/examples/why_wiki/wiki.yml +6 -0
  39. data/examples/wiki.yml +1 -0
  40. data/lib/glue/array.rb +14 -33
  41. data/lib/glue/hash.rb +32 -53
  42. data/lib/glue/pool.rb +9 -12
  43. data/lib/glue/property.rb +31 -9
  44. data/lib/nitro.rb +30 -8
  45. data/lib/nitro/adapters/cgi.rb +23 -3
  46. data/lib/nitro/adapters/webrick.rb +9 -3
  47. data/lib/nitro/builders/form.rb +21 -13
  48. data/lib/nitro/builders/rss.rb +20 -9
  49. data/lib/nitro/builders/table.rb +69 -10
  50. data/lib/nitro/builders/xhtml.rb +13 -4
  51. data/lib/nitro/component.rb +15 -0
  52. data/lib/nitro/conf.rb +4 -3
  53. data/lib/nitro/context.rb +22 -14
  54. data/lib/nitro/controller.rb +63 -5
  55. data/lib/nitro/dispatcher.rb +11 -6
  56. data/lib/nitro/output.rb +28 -0
  57. data/lib/nitro/render.rb +78 -59
  58. data/lib/nitro/request.rb +5 -1
  59. data/lib/nitro/runner.rb +20 -6
  60. data/lib/nitro/session.rb +89 -18
  61. data/lib/nitro/session/drb.rb +31 -0
  62. data/lib/nitro/session/drbserver.rb +71 -0
  63. data/lib/nitro/session/memory.rb +13 -0
  64. data/lib/nitro/simple.rb +7 -0
  65. data/lib/nitro/ui/date-select.rb +2 -5
  66. data/lib/nitro/ui/pager.rb +4 -4
  67. data/lib/nitro/ui/tabs.rb +2 -4
  68. data/lib/nitro/uri.rb +7 -4
  69. data/lib/og.rb +20 -12
  70. data/lib/og/adapter.rb +40 -13
  71. data/lib/og/adapters/filesys.rb +121 -0
  72. data/lib/og/adapters/mysql.rb +10 -5
  73. data/lib/og/adapters/oracle.rb +374 -0
  74. data/lib/og/adapters/psql.rb +10 -23
  75. data/lib/og/adapters/sqlite.rb +3 -3
  76. data/lib/og/backend.rb +2 -2
  77. data/lib/og/connection.rb +6 -6
  78. data/lib/og/database.rb +5 -5
  79. data/lib/og/enchant.rb +6 -2
  80. data/lib/og/meta.rb +56 -26
  81. data/lib/og/mock.rb +1 -1
  82. data/lib/og/typemacros.rb +23 -0
  83. data/lib/parts/content.rb +4 -10
  84. data/test/nitro/adapters/tc_cgi.rb +1 -1
  85. data/test/nitro/builders/tc_rss.rb +1 -1
  86. data/test/nitro/builders/tc_table.rb +30 -0
  87. data/test/nitro/tc_context.rb +4 -0
  88. data/test/nitro/tc_controller.rb +9 -2
  89. data/test/og/tc_filesys.rb +83 -0
  90. data/test/og/tc_meta.rb +55 -0
  91. data/test/tc_og.rb +115 -36
  92. data/vendor/README +11 -5
  93. data/vendor/breakpoint.rb +35 -38
  94. data/vendor/breakpoint_client.rb +119 -80
  95. data/vendor/composite_sexp_processor.rb +43 -0
  96. data/vendor/parse_tree.rb +745 -0
  97. data/vendor/sexp_processor.rb +453 -0
  98. metadata +34 -7
  99. data/examples/no_xsl_blog/conf/app.conf.rb +0 -47
data/AUTHORS CHANGED
@@ -1,7 +1,7 @@
1
1
  MAIN DEVELOPER:
2
2
 
3
3
  * George Moschovitis <gm@navel.gr>
4
- Project Leader, Architecture and Design, main coder,
4
+ Project leader, architecture and design, code,
5
5
  documentation, maintainer.
6
6
 
7
7
  IDEAS, ADDITIONAL CODING, SUPPORT:
@@ -9,6 +9,9 @@ IDEAS, ADDITIONAL CODING, SUPPORT:
9
9
  * Michael Neumann <mneumann@ntecs.de>
10
10
  Design, additional coding and bug reports.
11
11
 
12
+ * Matt Bowen <matt.bowen@farweststeel.com>
13
+ Additional code and documentation.
14
+
12
15
  * Anastasios Koutoumanos <ak@navel.gr>
13
16
  Design, additional coding.
14
17
 
data/ChangeLog CHANGED
@@ -1,5 +1,288 @@
1
+ 28-02-2005 George Moschovitis <gm@navel.gr>
2
+
3
+ * lib/nitro/controller.rb (#action_method_arguments): implemented.
4
+
5
+ * lib/nitro.rb: added resolve_action_arguments,
6
+ define Nitro before requiring.
7
+
8
+ * lib/nitro/render.rb: added a simple check for ParseTree.
9
+
10
+ * Rakefile: no ParseTree dependency,
11
+ include og_config/og_tutorial in the docs.
12
+
13
+ * use 127.0.0.1 as default address Windows gets fucked with 0.0.0.0
14
+
15
+ * lib/nitro/simple.rb: hack fix for SimpleController problem.
16
+
17
+ * lib/og/adapters/oracle.rb: small fixes [mbowen].
18
+
19
+ * lib/og/adapter.rb: fixed DEFAULT NOT NULL to make oracle compaible [mbowen].
20
+
21
+ * doc/og_tutorial.txt: more fixes [james_b],
22
+ made more compatible with RDoc.
23
+
24
+ 27-02-2005 George Moschovitis <gm@navel.gr>
25
+
26
+ * lib/nitro/adapters/xhtml.rb (#submit): introduced.
27
+
28
+ * lib/nitro/request.rb (#path_info): introduced.
29
+
30
+ * lib/nitro/adapters/webrick.rb (#start): check for Conf instead of Flexob.
31
+
32
+ * examples/why_wiki/run.rb: introduced the wiki example from
33
+ redhanded.hobix.com (btw, why_ fuckin RULEZ!),
34
+ converted to use the programmatic render,
35
+ more fixes, now fully working, better than why_'s original.
36
+
37
+ * many small fixes to make tests pass again.
38
+
39
+ * lib/controller.rb (#action_methods): temp fix for pretty_print
40
+ methods, argh!
41
+
42
+ * examples/*: added apache configuration to all examples,
43
+ updated fcgi.rb in examples.
44
+
45
+ * examples/blog/conf/apache.conf: pass -rubygems -I.. to make compatible
46
+ with lhttpd.
47
+
48
+ * Rakefile: added ParseTree requirement,
49
+ fixed test without og test-cases.
50
+
51
+ * RELEASES: updated.
52
+
53
+ * doc/og_tutorial.tx: more fixes.
54
+
55
+ 27-02-2005 Matt Bowen <matt.bowen@farweststeel.com>
56
+
57
+ * doc/og_tutorial.txt: many, many fixes to this text.
58
+
59
+ 26-02-2005 George Moschovitis <gm@navel.gr>
60
+
61
+ * lib/glue/*: cleaned up various files.
62
+
63
+ * doc/og_tutorial.txt: small fixes [marioh].
64
+
65
+ * test/tc_og.rb: a bit more flexible, fixes.
66
+
67
+ * lib/og/adapters/oracle.rb: small fixes to the adapter.
68
+
69
+ 26-02-2005 Matt Bowen <matt.bowen@farweststeel.com>
70
+
71
+ * lib/og/meta.rb (#many_to_many): don't use AS in join queries
72
+ to make more compatible with Oracle.
73
+
74
+ * lib/og/adapters/oracle.rb: many fixes to the adapter.
75
+
76
+ 25-02-2005 George Moschovitis <gm@navel.gr>
77
+
78
+ * vendor/: added ParseTree files,
79
+ copied latest breakpointer files.
80
+
81
+ * lib/nitro/render.rb: some guarding code for ParseTree, argh.
82
+
83
+ * lib/nitro/runner.rb: clearly show where the application is
84
+ listening.
85
+
86
+ * lib/nitro/conf.rb: use 0.0.0.0 by default to make the app accessible both
87
+ localy and remotely,
88
+ use 9999 as default port, easier to remember.
89
+
90
+ * doc/og_config.txt: wrote first version.
91
+
92
+ * doc/og_tutorial.txt: wrote first version.
93
+
94
+ 24-02-2005 George Moschovitis <gm@navel.gr>
95
+
96
+ * test/tc_og.rb: added extra checks.
97
+
98
+ * lib/og/adapter.rb (#create_fields): set default value,
99
+ (#parse_timestamp): handle nil strings.
100
+
101
+ * lib/og/adapters/*: better default values (NULL) [mneumann]
102
+
103
+ * lib/og/adapters/mysql.rb: fixed props_for_insert.
104
+
105
+ * lib/og/adapters/oracle.rb: worked on this.
106
+ removed write_prop/read_prop.
107
+
108
+ * lib/nitro/render.rb (#o): convienience method.
109
+
110
+ * lib/nitro/builders/*: render -> build,
111
+ recoded abstract builders.
112
+
113
+ * lib/nitro/builders/form: introduced mixin.
114
+
115
+ * lib/nitro/context.rb: use the output buffer.
116
+
117
+ * lib/nitro/output.rb (OutputBuffer): introduced.
118
+
119
+ * lib/nitro/builders/rss: introduced mixin.
120
+
121
+ * lib/og/meta.rb (Relation): added foreign_class alias.
122
+
123
+ * doc/*: cleaned up.
124
+
125
+ * doc/configuration_params.txt: introduced.
126
+
127
+ * RELEASES: updated.
128
+
129
+ * README: updated.
130
+
131
+ 23-02-2005 George Moschovitis <gm@navel.gr>
132
+
133
+ * test/og/tc_meta.rb: implemented.
134
+
135
+ * lib/og/enchant.rb (#properties_and_relations): added.
136
+
137
+ * lib/og/typemacros.rb: introduced, copied code from meta.
138
+
139
+ * lib/og/meta.rb: added more metainfo in relations to facilitate
140
+ even more advanced scaffoliding [mneumann],
141
+ encapsulated type macros in Og namespace [mneumann],
142
+ define Relation classes as extension to properties [mneumann],
143
+ use meta[:descendants] to store cascading delete metadata.
144
+
145
+ * lib/glue/property.rb: added property alias for prop_accessor. [mneumann],
146
+ added more comments.
147
+ (#meta): *val packs arguments in array.
148
+ also keep properties in meta[:properties_and_relations]
149
+
150
+ * lib/og.rb: added 'create_schema' configuration variable, when
151
+ set to false, the applications start much faster.
152
+
153
+ 22-02-2005 George Moschovitis <gm@navel.gr>
154
+
155
+ * yeah, fastcgi works better on lhttpd and apache.
156
+
157
+ * lib/nitro/request.rb (#referer): fixed NASTY bug in non-webrick mode.
158
+
159
+ * lib/nitro/adapters/cgi.rb (#response_headers): added Date to headers,
160
+ after some changes, I got apache to kinda work,
161
+ proto parameter, fixes apache.
162
+
163
+ * lib/nitro/dispatcher.rb: correct handling of default api.
164
+
165
+ * lib/nitro/context.rb (#initialize): init status.
166
+
167
+ * test/nitro/builders/tc_table.rb: introduced.
168
+
169
+ * lib/og/adapters/odbc.rb: introduced.
170
+
171
+ * lib/nitro/builders/table.rb (TableBuilderMixin): introduced,
172
+ (TableBuilder): implemented.
173
+ (#render_table): implemented simple version.
174
+
175
+ * example/wee_style/run.rb: use components.
176
+
177
+ 21-02-2005 George Moschovitis <gm@navel.gr>
178
+
179
+ * lib/og/adapter.rb (#table): use og prefix to be compatible with oracle [mbowen],
180
+ (#join_table): use og prefix instead of '_' [mbowen].
181
+
182
+ * lib/glue/property.rb (#meta): fix, should call enchant(self).
183
+
184
+ * test/tc_og.rb: added more tests to check new feature and
185
+ fixes,
186
+ added test for many_to_many relations.
187
+
188
+ * lib/og/meta.rb: removed uneeded extra parameter from
189
+ some meta_methods.
190
+ (#many_to_many): allow yield block in add_xxx,
191
+ save target_objects!,
192
+
193
+ * lib/og/adapters/oracle.rb: cleanup.
194
+
195
+ 21-02-2005 Michael Neumann <mneumann@ntecs.de>
196
+
197
+ * lib/og/meta.rb: (#has_many): allow yield block in add_xxx,
198
+ added some standard typemacros.
199
+
200
+ 20-02-2005 Matt Bowen <matt.bowen@farweststeel.com>
201
+
202
+ * lib/og/adapters/oracle.rb: introduced, and initial implementation.
203
+
204
+ 20-02-2005 George Moschovitis <gm@navel.gr>
205
+
206
+ * examples/blog/conf/apache.rb: implemented, mostly works!
207
+
208
+ * experimented with method injection, it can be done!!
209
+
210
+ * lib/nitro/render.rb: added ParseTree/SexpProcessor,
211
+ (#compile_action): handle action with parameters and
212
+ automatically lookup request parameters.
213
+ (#compile_action): added sync to be more thread safe.
214
+
215
+ * experimented with ParseTree, this lib is ultracool.
216
+
217
+ 19-02-2005 George Moschovitis <gm@navel.gr>
218
+
219
+ * lib/nitro/runner.rb: no duplicate lhttpd,
220
+ added apache option,
221
+ fixed parameter passing to apachectl.
222
+
223
+ * lib/og/*: converted Og to a Module to be includeable.
224
+
225
+ * Rakefile: put RDoc files in doc/rdoc.
226
+
227
+ * doc/*: moved some files from root dir here.
228
+
229
+ * lib/og/adapters/*: small changes.
230
+
231
+ * lib/og/adapters/filesys.rb: introduced,
232
+ (#db_dir): added.
233
+ create class 'tables' and sequence.
234
+ (#load/#save): temp hacks, but this works!!
235
+ This kinda works :)
236
+
237
+ 18-02-2005 George Moschovitis <gm@navel.gr>
238
+
239
+ * doc/apache.txt: introduced.
240
+
241
+ * doc/tutorial.txt: started working on this.
242
+
243
+ * lib/nitro/session/drb.rb: yeah, distributed session
244
+ works correctly.
245
+
246
+ * lib/nitro/context.rb: removed sessions attribute,
247
+ (#close): implemented.
248
+
249
+ * lib/nitro/session.rb: added ctime, mtime, atime and
250
+ aliases,
251
+ (#touch!): introduced.
252
+ collection -> store.
253
+
254
+ * lib/nitro/session/drbserver.rb: added debug mode.
255
+
256
+ 17-02-2005 George Moschovitis <gm@navel.gr>
257
+
258
+ * lib/nitro/session/memory.rb: implemented.
259
+
260
+ * YEAH, i got drb sessions working again.
261
+
262
+ * lib/nitro/session/drb.rb: implemented.
263
+
264
+ * lib/nitro/session.rb: added store configuration parameter,
265
+ FIX: use SafeHash for session collections.
266
+
267
+ * lib/nitro/session/drbserver.rb: implemented,
268
+ added command line parameters.
269
+
270
+ * lib/glue/hash.rb: cleaned up.
271
+
272
+ * lib/nitro/component.rb: introduced.
273
+
274
+ 16-02-2005 George Moschovitis <gm@navel.gr>
275
+
276
+ * lib/nitro/render.rb: SECURITY FIX: only render action_methods.
277
+
278
+ * test/nitro/tc_controller.rb: fixes, more tests.
279
+
280
+ * lib/nitro/controller.rb (#action_methods): introduced.
281
+
1
282
  15-02-2005 George Moschovitis <gm@navel.gr>
2
283
 
284
+ * --- VERSION 0.10.0 ---
285
+
3
286
  * INSTALL: added some text for manual installation.
4
287
 
5
288
  * examples/no_xsl_blog/*: misc fixes.
@@ -127,7 +410,7 @@
127
410
 
128
411
  * test/tc_og.rb: added test for override db.
129
412
 
130
- * lib/og/adapters/*: dont use entity,
413
+ * lib/og/adapters/*: don't use entity,
131
414
  (#calc_field_index): ensure res.close in
132
415
  (#create_table): use conn.store to avoid catching the errors.
133
416
 
@@ -234,7 +517,7 @@
234
517
 
235
518
  * cleaned up docs in many files.
236
519
 
237
- * test/tc_og.rb: dont use global ($og),
520
+ * test/tc_og.rb: don't use global ($og),
238
521
  run tests for all backends.
239
522
 
240
523
  * lib/og/*: small cleanups.
@@ -487,7 +770,7 @@
487
770
  (#redirect): fixed.
488
771
  (#render): raise when no controller found.
489
772
  (#render): fixed template extension selection,
490
- (#compile_action): dont set content_type.
773
+ (#compile_action): don't set content_type.
491
774
 
492
775
  * lib/nitro/controller.rb: include Scaffolding, Filtering.
493
776
 
@@ -664,7 +947,7 @@
664
947
 
665
948
  * lib/nitro/filters: introduced.
666
949
 
667
- * lib/nitro/server/dispatcher.rb: dont use $og.
950
+ * lib/nitro/server/dispatcher.rb: don't use $og.
668
951
 
669
952
  * lib/nitro/adaptors/webrick: new implementation.
670
953
  (WebrickAdaptor): introduced.
@@ -900,7 +1183,7 @@
900
1183
 
901
1184
  * lib/og/*: converted to new code.
902
1185
 
903
- * lib/og/meta.rb: dont use $og. [mneumann]
1186
+ * lib/og/meta.rb: don't use $og. [mneumann]
904
1187
 
905
1188
  * lib/og.rb: made Og a class,
906
1189
  removed $og_xx_xx options, use class methods [mneumann]
@@ -933,7 +1216,7 @@
933
1216
 
934
1217
  * --- VERSION 0.7.0 ---
935
1218
 
936
- * lib/og/mock.rb: fix, dont wrap methods.
1219
+ * lib/og/mock.rb: fix, don't wrap methods.
937
1220
 
938
1221
  * Rakefile: fix.
939
1222
 
@@ -1113,4 +1396,4 @@
1113
1396
 
1114
1397
  * final preparations for release.
1115
1398
 
1116
- * ChangeLog: branched.
1399
+ * ChangeLog: branched from 'doc/ChangeLog.1'.
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = Nitro 0.10.0
1
+ = Nitro 0.11.0
2
2
 
3
3
  Nitro is an efficient, yet simple engine for developing professional Web
4
4
  Applications using the Ruby language. Nitro aims to provide a robust
@@ -445,8 +445,8 @@ http://rubyforge.org/mailman/listinfo/nitro-general
445
445
  Copyright (c) 2004-2005, George 'tml' Moschovitis.
446
446
  Copyright (c) 2004-2005, Navel Ltd (http://www.navel.gr)
447
447
 
448
- Nitro (http://www.navel.gr/nitro) is copyrighted free software
449
- created and maintained by George Moschovitis (mailto:gm@navel.gr)
448
+ Nitro (http://www.rubyforge.com/projects/nitro) is copyrighted free
449
+ software created and maintained by George Moschovitis (mailto:gm@navel.gr)
450
450
  and released under the standard BSD Licence. For details consult
451
451
  the file LICENCE.
452
452
 
data/RELEASES CHANGED
@@ -1,3 +1,97 @@
1
+ == Version 0.11.0 was released on 28/02/2005.
2
+
3
+ The platform continues to evolve and now supports the
4
+ Apache web server and the Oracle database out of the box.
5
+ This version features improved documentation, important
6
+ bug fixes and many subtle improvements to make programming
7
+ even more enjoyable. Many thanks to Matt Bowen for his help
8
+ with this release.
9
+
10
+ Most notable additions:
11
+
12
+ * Configuration files for Apache/FastCGI.
13
+
14
+ * Og documentation (doc/og_tutorial.txt, doc/og_config.txt)
15
+
16
+ * Actions with parameters:
17
+
18
+ def list(username, oid)
19
+ ...
20
+ end
21
+
22
+ http://www.mysite.com/list?username=tml;oid=2
23
+
24
+ calls list() with the correct parameters, no need to
25
+ use request['oid'], just use oid.
26
+
27
+ def list(username, oid)
28
+ puts oid # oid == request['oid']
29
+ end
30
+
31
+ WARNING: this feature requires the ParseTree library which
32
+ is not compatible with Windows. For the moment, this feature
33
+ is dissabled by default. To enable this feature, set
34
+ Nitro.resolve_action_arguments = true.
35
+
36
+ * New session store system, DRb sessions (stored in an independent
37
+ DRb server) are reimplemented.
38
+
39
+ Session.store_type = :drb
40
+
41
+ * TableBuilder helps in creating html tables.
42
+
43
+ * Integrated builders with the programmatic render. For example:
44
+
45
+ <div class="mytable">
46
+ #{o.build_table(:id => 'my_tab', :headers => headers, :values => values)
47
+ </div>
48
+
49
+ or
50
+
51
+ <p>
52
+ <b>Object Form</b>
53
+ #{o.build_form(obj)}
54
+ </p>
55
+
56
+ * Og Oracle adapter.
57
+
58
+ * Og provides advanced metadata for the managed objects
59
+
60
+ class Article
61
+ property :title, String
62
+ property :body, String
63
+ has_many :comments, Comment
64
+ end
65
+
66
+ par = Article.properties_and_relations
67
+ => [Property(:title), Property(:body), Og::HasMany(:comments)]
68
+
69
+ par[2].klass
70
+ => Comment
71
+
72
+ par[2].meta[:linkback]
73
+ => :article_oid
74
+
75
+ * Og Typemacros, here is an example:
76
+
77
+ def VarChar(size)
78
+ return String, :sql => "NOT NULL VARCHAR(#{size})"
79
+ end
80
+
81
+ property :title, VarChar(30)
82
+
83
+ * Option for faster startup, skip schema check.
84
+
85
+ * Many small Og improvements and fixes.
86
+
87
+ * FastCGI adapter bug fixes.
88
+
89
+ * New example, why's wiki, from a cool post at
90
+ http://redhanded.hobix.com
91
+
92
+ * IMPORTANT security fixes.
93
+
94
+
1
95
  == Version 0.10.0 was released on 15/02/2005.
2
96
 
3
97
  Another strong release featuring a completely recoded Og