nitro 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/CHANGELOG +187 -0
  2. data/INSTALL +5 -0
  3. data/README +11 -5
  4. data/doc/AUTHORS +11 -1
  5. data/doc/RELEASES +217 -0
  6. data/doc/tutorial.txt +1 -2
  7. data/lib/nitro.rb +9 -6
  8. data/lib/nitro/adapter/webrick.rb +13 -2
  9. data/lib/nitro/builder/form.rb +11 -9
  10. data/lib/nitro/builder/rss.rb +2 -2
  11. data/lib/nitro/builder/xhtml.rb +15 -0
  12. data/lib/nitro/caching.rb +15 -10
  13. data/lib/nitro/conf.rb +0 -5
  14. data/lib/nitro/controller.rb +118 -81
  15. data/lib/nitro/cookie.rb +6 -6
  16. data/lib/nitro/dispatcher.rb +62 -18
  17. data/lib/nitro/element.rb +4 -1
  18. data/lib/nitro/element/java_script.rb +15 -0
  19. data/lib/nitro/localization.rb +3 -4
  20. data/lib/nitro/markup.rb +4 -4
  21. data/lib/nitro/mixin/debug.rb +30 -0
  22. data/lib/nitro/mixin/helper.rb +14 -0
  23. data/lib/nitro/mixin/javascript.rb +137 -0
  24. data/lib/nitro/{ui → mixin}/pager.rb +110 -82
  25. data/lib/nitro/render.rb +20 -8
  26. data/lib/nitro/request.rb +6 -0
  27. data/lib/nitro/routing.rb +6 -5
  28. data/lib/nitro/runner.rb +21 -9
  29. data/lib/nitro/server.rb +95 -0
  30. data/lib/nitro/service.rb +0 -1
  31. data/lib/nitro/session.rb +4 -5
  32. data/lib/nitro/shaders.rb +2 -2
  33. data/lib/nitro/template.rb +1 -1
  34. data/lib/nitro/testing/assertions.rb +2 -4
  35. data/lib/nitro/testing/context.rb +4 -6
  36. data/proto/public/js/behaviour.js +254 -0
  37. data/proto/public/js/controls.js +446 -0
  38. data/proto/public/js/dragdrop.js +537 -0
  39. data/proto/public/js/effects.js +612 -0
  40. data/proto/public/js/prototype.js +644 -370
  41. data/proto/public/settings.xhtml +64 -0
  42. data/test/nitro/adapter/tc_cgi.rb +2 -2
  43. data/test/nitro/builder/tc_rss.rb +1 -1
  44. data/test/nitro/mixin/tc_pager.rb +35 -0
  45. data/test/nitro/tc_controller.rb +1 -1
  46. data/test/nitro/tc_cookie.rb +14 -0
  47. data/test/nitro/tc_dispatcher.rb +11 -6
  48. data/test/nitro/tc_server.rb +35 -0
  49. metadata +20 -15
  50. data/lib/nitro/builder/atom.rb +0 -74
  51. data/lib/nitro/part.rb +0 -22
  52. data/lib/nitro/simple.rb +0 -11
  53. data/lib/nitro/ui/popup.rb +0 -41
  54. data/lib/nitro/ui/tabs.rb +0 -25
  55. data/lib/nitro/uri.rb +0 -193
  56. data/test/nitro/builder/tc_atom.rb +0 -24
  57. data/test/nitro/tc_uri.rb +0 -97
  58. data/test/nitro/ui/tc_pager.rb +0 -49
data/CHANGELOG CHANGED
@@ -1,5 +1,192 @@
1
+ 12-07-2005 George Moschovitis <gm@navel.gr>
2
+
3
+ * doc/RELEASES: updated.
4
+
5
+ * test/nitro/mixin/tc_pager.rb: added.
6
+
7
+ * lib/nitro/mixin/pager.rb: copied old code,
8
+ added support for in-memory pagination,
9
+ small fixes: it WORKS!
10
+
11
+ * lib/nitro/uri.rb: moved to glue.
12
+
13
+ * lib/nitro/helper/*: moved to mixin/*
14
+
15
+ * lib/nitro/builder/atom.rb: removed.
16
+
17
+ 11-07-2005 George Moschovitis <gm@navel.gr>
18
+
19
+ * lib/nitro/mixin/pager.rb: introduced,
20
+ (Pager): introduced,
21
+ (PagerMixin): introduced,
22
+ (#paginate): implemented.
23
+
24
+ * lib/nitro/mixin: introduced.
25
+
26
+ * test/nitro/tc_dispatcher.rb: removed deprecated multiapi
27
+ tests.
28
+
29
+ * test/*: many changes and fixes to pass again.
30
+
31
+ * lib/nitro/adapter/webrick.rb (XhtmlFileAdapter): implemented,
32
+ don't return xhtml source [james_b].
33
+
34
+ * doc/RELEASES: updated.
35
+
36
+ 09-07-2005 George Moschovitis <gm@navel.gr>
37
+
38
+ * doc/RELEASES: updated.
39
+
40
+ * lib/nitro/helper/javascript.rb (#live_request): implemented,
41
+ get the href from the actual element.
42
+ (#autocomplete): implemented.
43
+ added effects.js to the default js libraries.
44
+ set autocomplete="off" with a behaviour.
45
+
46
+ 08-07-2005 George Moschovitis <gm@navel.gr>
47
+
48
+ * lib/nitro/helper/javascript.rb: introduced.
49
+ (#dragable): implemented,
50
+ yeah drag and drop works!
51
+ (#escape_javascript): added.
52
+ (#behaviour): ULTRA COOL added.
53
+
54
+ 07-07-2005 George Moschovitis <gm@navel.gr>
55
+
56
+ * proto/public/js/behaviour.js: introduced.
57
+
58
+ * proto/public/js/controls.js: introduced.
59
+
60
+ * proto/public/js/dragdrop.js: upgraded to latest version.
61
+
62
+ * proto/public/js/effects.js: upgraded to latest version.
63
+
64
+ * proto/public/js/effects2.js: deprecated.
65
+
66
+ * proto/public/js/prototype.js: upgrated to latest version.
67
+
68
+ * README: updated.
69
+
70
+ 06-07-2005 George Moschovitis <gm@navel.gr>
71
+
72
+ * test/nitro/tc_cookie.rb: added.
73
+
74
+ * lib/nitro/cookie.rb: set path = '/' by default, fixes NASTY
75
+ session bug [mneumann].
76
+
77
+ 04-07-2005 George Moschovitis <gm@navel.gr>
78
+
79
+ * lib/nitro/builder/rss.rb: small fixes.
80
+
81
+ 03-07-2005 George Moschovitis <gm@navel.gr>
82
+
83
+ * lib/nitro/controller.rb (#alias_action): added, experimental.
84
+
85
+ * added more const_defined? checks.
86
+
87
+ 01-07-2005 George Moschovitis <gm@navel.gr>
88
+
89
+ * lib/nitro/request.rb (#fetch): implemented as shorthand [drak].
90
+
91
+ * lib/nitro/render.rb: added controller_name [mneumann].
92
+
93
+ 30-06-2005 George Moschovitis <gm@navel.gr>
94
+
95
+ * test/nitro/tc_server.rb: introduced and implemented.
96
+
97
+ * lib/nitro/server.rb: don't use as singleton,
98
+ (Mounter): implements really cool CherryPy style publishing!
99
+
100
+ * lib/nitro/controller.rb: added default action.
101
+
102
+ 29-06-2005 George Moschovitis <gm@navel.gr>
103
+
104
+ * lib/nitro/dispatcher.rb (#update_routes): fixed.
105
+
106
+ * lib/nitro/simple.rb: removed.
107
+
108
+ * lib/nitro/part.rb: removed.
109
+
110
+ 28-06-2005 George Moschovitis <gm@navel.gr>
111
+
112
+ * lib/nitro.rb (##start): implemented.
113
+
114
+ * yeah, the new hello world example passes.
115
+
116
+ * lib/nitro/controller.rb: moved SimpleController here,
117
+ removed the dangerous (and no longer needed) #inherited override,
118
+ SimpleController in Nitro namespace,
119
+ (ControllerMixin): started implementing,
120
+ renamed to Publishable.
121
+
122
+ * started using the unless const_defined? trick.
123
+
124
+ * lib/nitro/dispatcher.rb: simplified (no context passed),
125
+ (#dispatch): more natural mount points, no :root.
126
+ publish alias for add_controller.
127
+
128
+ 27-06-2005 George Moschovitis <gm@navel.gr>
129
+
130
+ * lib/nitro/server.rb: introduced.
131
+
132
+ 27-06-2005 George Moschovitis <gm@navel.gr>
133
+
134
+ * lib/nitro/element.rb: fixed bugs.
135
+
136
+ * lib/nitro/builder/form.rb: fixed bugs.
137
+
138
+ 25-06-2005 George Moschovitis <gm@navel.gr>
139
+
140
+ * lib/nitro/helper/debug.rb: implemented.
141
+
142
+ * lib/nitro/controller.rb: include HelperSupport.
143
+
144
+ * test/nitro/tc_helper.rb: introduced.
145
+
146
+ * lib/nitro/helper.rb: introduced,
147
+ helper macro to make the helpers methods private,
148
+ (#include_auto_helpers): implemented.
149
+ (Helper): include debug helper by default.
150
+
151
+ 24-06-2005 George Moschovitis <gm@navel.gr>
152
+
153
+ * lib/nitro/*: beutified/updated/commented many files.
154
+
155
+ * lib/nitro/element/java_script.rb: implemented.
156
+
157
+ * doc/AUTHORS: updated.
158
+
159
+ * proto/public/js/*: added scriptacoulous libraries.
160
+
161
+ * proto/public/settings.xhtml: cooler, shows all configuration
162
+ variables. [epiperak]
163
+
164
+ * lib/nitro/*: started adding settings keywords everywhere.
165
+
166
+ * lib/nitro/runner.rb: include configuration.
167
+
168
+ 23-06-2005 George Moschovitis <gm@navel.gr>
169
+
170
+ * lib/nitro/markup.rb (MarkupShader): call expand_html.
171
+
172
+ 21-06-2005 George Moschovitis <gm@navel.gr>
173
+
174
+ * lib/nitro/caching.rb: temporarily dissabled per controller
175
+ caching.
176
+
177
+ 20-06-2005 George Moschovitis <gm@navel.gr>
178
+
179
+ * README: facet/redcloth pointers. [bcandler]
180
+
181
+ * INSTALL: facet/redcloth pointers. [bcandler]
182
+
1
183
  17-06-2005 George Moschovitis <gm@navel.gr>
2
184
 
185
+ * lib/nitro/caching.rb (##caching_enabled): added singleton
186
+ method too!
187
+
188
+ * --- VERSION 0.19.0 ---
189
+
3
190
  * README: updated.
4
191
 
5
192
  * doc/RELEASES: updated.
data/INSTALL CHANGED
@@ -69,6 +69,11 @@ or, at windows
69
69
 
70
70
  > set RUBYOPT=Ic:\dev\nitro\lib;c:\dev\og\lib;c:\dev\glue\lib
71
71
 
72
+ You also have to manualy install the following libraries:
73
+
74
+ * Facets
75
+ * RedCloth
76
+
72
77
  = Additional libraries
73
78
 
74
79
  Nitro uses a number of additional libraries. RubyGems
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = Nitro 0.19.0 README
1
+ = Nitro 0.20.0 README
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
@@ -253,13 +253,13 @@ doc/RELEASES
253
253
 
254
254
  The latest version of Nitro can be found at
255
255
 
256
- * http://nitro.rubyforge.org
256
+ * http://www.nitrohq.com
257
257
 
258
258
  == Documentation
259
259
 
260
260
  Documentation for Nitro can be found at
261
261
 
262
- * http://nitro.rubyforge.org
262
+ * http://www.nitrohq.com
263
263
 
264
264
  Don't forget to read the file doc/RELEASES for usefull
265
265
  documentation bits. Also, have a look at the test cases in
@@ -274,6 +274,9 @@ Nitro requires the following applications or libraries:
274
274
  http://www.ruby-lang.org
275
275
  Version 1.8.2 is recomended
276
276
 
277
+ * Facets
278
+ http://rubyforge.org/frs/?group_id=483
279
+
277
280
  The following applications or libraries are OPTIONAL:
278
281
 
279
282
  * PostgreSQL
@@ -312,6 +315,9 @@ The following applications or libraries are OPTIONAL:
312
315
  http://www.fastcgi.com/dist/fcgi.tar.gz
313
316
  Needed to compile the C-version of the ruby fcgi library.
314
317
 
318
+ * RedCloth
319
+ http://rubyforge.org/projects/redcloth/
320
+
315
321
  Please install the required applications and libraries before continuing
316
322
  with the installation of Nitro.
317
323
 
@@ -461,7 +467,7 @@ http://rubyforge.org/mailman/listinfo/nitro-general
461
467
  Copyright (c) 2004-2005, George 'tml' Moschovitis.
462
468
  Copyright (c) 2004-2005, Navel Ltd (http://www.navel.gr)
463
469
 
464
- Nitro (http://www.rubyforge.com/projects/nitro) is copyrighted free
465
- software created and maintained by George Moschovitis (mailto:gm@navel.gr)
470
+ Nitro (http://www.nitrohq.com) is copyrighted free software
471
+ created and maintained by George Moschovitis (mailto:gm@navel.gr)
466
472
  and released under the standard BSD Licence. For details consult
467
473
  the file LICENCE.
data/doc/AUTHORS CHANGED
@@ -1,6 +1,6 @@
1
1
  MAIN DEVELOPER:
2
2
 
3
- * George Moschovitis <gm@navel.gr>
3
+ * George Moschovitis <gm@navel.gr>
4
4
  Project leader, architecture and design, main coder,
5
5
  documentation, maintainer.
6
6
 
@@ -17,3 +17,13 @@ IDEAS, ADDITIONAL CODING, SUPPORT:
17
17
 
18
18
  * Kostas Nasis <kostas@nasis.com>
19
19
  Ideas and bug reports.
20
+
21
+ INTEGRATED LIBRARIES:
22
+
23
+ Nitro integrates several open source libraries:
24
+
25
+ * Prototype: Object Oriented Javascript library
26
+ Sam Stepherson, http://www.conio.net
27
+
28
+ * Srciptacolous: Special FX Javascript library
29
+ Thomas Fuchs, http://script.aculo.us
data/doc/RELEASES CHANGED
@@ -1,3 +1,220 @@
1
+ == Version 0.20.0
2
+
3
+ Another superb release! State of the art AJAX/Javascript support,
4
+ Wee components / programmatic renderer integration, a beginners
5
+ tutorial, self documenting configuration and many important bug
6
+ fixes. Don't forget to check out our new community site at
7
+ http://www.nitrohq.com
8
+
9
+ Some notable changes:
10
+
11
+ * Ajax is THE buzzword at the moment, and Nitro provides the
12
+ best support you can find. Nitro fully separates the behaviour
13
+ from the template using the behaviour.js library and allowing
14
+ for dynamic injection of ajax functionality. The generated code
15
+ contains clean html and all the javascript organized in a
16
+ single <script> block. Here is an example:
17
+
18
+ in the Controller:
19
+
20
+ def index
21
+ # Inject functionality to the DOM elements of the template.
22
+
23
+ behaviour '#alert', %{
24
+ el.onclick = function() {
25
+ alert('Hello world');
26
+ }
27
+ }
28
+ auto_complete :country # convert to autocomplete field
29
+ live :live # convert to async link!
30
+ draggable :dragger, :revert => false
31
+ end
32
+
33
+ def a_simple_action
34
+ puts 'LIVE!'
35
+ end
36
+
37
+ def country_auto_complete # data for auto complete.
38
+ %{
39
+ <ul>
40
+ <li>Greece</li>
41
+ <li>England</li>
42
+ ...
43
+ </ul>
44
+ }
45
+ end
46
+
47
+ in the Template:
48
+
49
+ <label>Enter a country:</label>
50
+ <input type="text" id="country" />
51
+ <div id="country_auto_complete" class="auto_complete"> </div>
52
+
53
+ Behaviour example:<br />
54
+ <button id="alert">Click to alert</button>
55
+
56
+ Drag and Drop example:<br />
57
+ <div id="dragger">DRAG ME</div>
58
+
59
+ Live/Asynchonous request (AJAX) example:<br />
60
+ Here comes a <a id="live" href="a_simple_action">live link</a>.<br />
61
+ (Check out the log to see the action called in the background!)
62
+
63
+ All you have to do is define id's for your DOM elements. Here
64
+ comes the generated code:
65
+
66
+ <label>Enter a country:</label>
67
+ ...
68
+ (Check out the log to see the action called in the background!)
69
+
70
+ <script type="text/javascript">
71
+ var _behaviours = {
72
+ '#alert': function(el) {
73
+ el.onclick = function() {
74
+ alert('Hello world');
75
+ }
76
+ },'#country': function(el) {
77
+ el.autocomplete = 'off';
78
+
79
+ },'#live': function(el) {
80
+ el.onclick = function() {
81
+ new Ajax.Request(el.href, {});
82
+ return false;
83
+ }
84
+ }
85
+ }
86
+ Behaviour.register(_behaviours);
87
+
88
+ new Ajax.Autocompleter('country', 'country_auto_complete', 'country_auto_complete');
89
+ new Draggable('dragger', {revert:false});
90
+ </script>
91
+
92
+ See how a normal <a> tag is converted transparently to an Ajax request.
93
+ The prototype, scriptacoulous and behaviour js libraries are used.
94
+
95
+ The ajax support in this release is a PREVIEW. Stay tuned for
96
+ major improvements (and some surprises) in the next version.
97
+
98
+ * Wee Components integration. Nitro now transparently integrates
99
+ Wee components. This is truly a win-win situation. Wee applications
100
+ can use Nitro's infrastructure. Nitro applications can use
101
+ extremely reusable, stateful Components. For a demonstration
102
+ check out the new Wee example in the examples distribution!
103
+ Wee 0.9.0 is needed!
104
+
105
+ Even better interoperability with Wee is coming soon. Nitro
106
+ plays well with the others, and always provides more options.
107
+
108
+ * Mixins are modules of functionality that can be mixed into
109
+ Controllers. The developer can explicitly include Mixins or
110
+ use Nitro conventions to have helper Mixins automatically
111
+ included:
112
+
113
+ class MyController
114
+ ..
115
+ end
116
+
117
+ module MyControlllerMixin
118
+ # gets automatically mixed in
119
+ end
120
+
121
+ This works just like Og Mixins.
122
+
123
+ * Brand new, self-documenting configuration system. There is a new
124
+ keyword for defining configuration settings:
125
+
126
+ Here is an example:
127
+
128
+ class Render
129
+ setting :template_extension, :default => 'xhtml', :doc => 'The default template extension'
130
+ end
131
+
132
+ class Session
133
+ setting :store, :default => 'memory', :doc => 'The session store'
134
+ end
135
+
136
+ You can configure the Application using ruby code or yaml files:
137
+
138
+ Render.template_extension = 'xhtml'
139
+ Session.store = 'drb'
140
+
141
+ or
142
+
143
+ Render:
144
+ template_extension: xhtml
145
+ Session:
146
+ store: drb
147
+
148
+ You can access all defined settings:
149
+
150
+ Configuration.settings.each { |s| ... }
151
+
152
+ You can view the settings of the application along with documentation
153
+ on the following url:
154
+
155
+ www.myapp.com/settings
156
+
157
+ This feature is also a PREVIEW. Will be used a lot more in the
158
+ next release.
159
+
160
+ * CherryPy style published objects. Nitro allows you to publish
161
+ any Ruby object. Here is the new hello world example:
162
+
163
+ class HelloWorld
164
+ def index
165
+ print 'Hello World'
166
+ end
167
+
168
+ def add(val)
169
+ print "added: #{val + 2}"
170
+ end
171
+ end
172
+
173
+ App.start(HelloWorld)
174
+
175
+ Now, point your browser to localhost:/ or localhost/add?val=2
176
+
177
+ If you need the advanced controller functionality just extend
178
+ your published object from the Controller base class. The normal
179
+ heuristics to decide which method is safe to publish are aplied.
180
+
181
+ * CherryPy-style dispatcher configuration, provides another way
182
+ to define mounting points for Controllers and published objects.
183
+ Here is an example:
184
+
185
+ server = Server.new
186
+ server.root = MainController # /
187
+ server.root.fora = ForaController # /fora
188
+ server.root.wiki = WikiController # /wiki
189
+ server.root.really.deep = DeepController # /really/deap
190
+
191
+ * Improved pager interface. Thanks to the new PagerMixin, presenting
192
+ paged lists is easier (and as efficient) than ever:
193
+
194
+ items, pager = paginate(Article, :per_page => 5, :order => 'date DESC')
195
+
196
+ * Added better sql injection protection in Og sql stores.
197
+
198
+ * Fixed Mysql store reconnect bug.
199
+
200
+ * Og falls back to pure ruby adapters for Mysql and Postgres, to
201
+ make it easier to run out of the box. Please, don't forget to
202
+ switch to the natively compiled adapters for production sites.
203
+
204
+ * This is surely the most request feature: Nitro Step by Step
205
+ by James Britt, a beginers guide to Nitro. Available in the
206
+ brand-new, Nitro-powered, www.nitrohq.com Community wiki.
207
+
208
+ * New examples: The totaly recoded and ultra cool ajax example,
209
+ a Wee/Nitro example and the new Hello world example.
210
+
211
+ * Cleaned up a lot of source files.
212
+
213
+ * Many, many, many bug fixes and small improvements. This release
214
+ fixes all reported bugs in the spirit of out zero-bug tolerance
215
+ philosophy.
216
+
217
+
1
218
  == Version 0.19.0
2
219
 
3
220
  Og reloaded part 2: Another superb release introducing a balanced