nitro 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/ChangeLog +175 -0
  2. data/README +41 -7
  3. data/RELEASES +24 -0
  4. data/Rakefile +5 -7
  5. data/bin/new_app.rb +26 -4
  6. data/bin/new_form.rb +54 -0
  7. data/bin/proto/config.rb +3 -3
  8. data/bin/proto/root/index.xhtml +2 -34
  9. data/bin/proto/root/style.css +4 -70
  10. data/bin/proto/root/style.xsl +8 -39
  11. data/doc/tutorial.txt +5 -0
  12. data/examples/blog/app.rb +2 -1
  13. data/examples/blog/config.rb +7 -2
  14. data/examples/blog/root/style.xsl +1 -2
  15. data/examples/flash/README +34 -0
  16. data/examples/flash/app.rb +20 -0
  17. data/examples/flash/config.rb +38 -0
  18. data/examples/flash/lib/flash.rb +40 -0
  19. data/examples/flash/root/index.xhtml +25 -0
  20. data/examples/flash/root/show_inline_text.xhtml +12 -0
  21. data/examples/flash/tmp.swf +0 -0
  22. data/examples/og/README +7 -0
  23. data/examples/og/mock_example.rb +58 -0
  24. data/examples/og/run.rb +9 -5
  25. data/examples/tiny/root/include.xhtml +3 -0
  26. data/examples/tiny/root/index.xhtml +2 -1
  27. data/lib/glue/property.rb +166 -107
  28. data/lib/glue/property.rb.old +307 -0
  29. data/lib/nitro/builders/form.rb +26 -17
  30. data/lib/nitro/events.rb +1 -1
  31. data/lib/nitro/markup.rb +120 -0
  32. data/lib/nitro/server/cookie.rb +1 -1
  33. data/lib/nitro/server/dispatcher.rb +5 -6
  34. data/lib/nitro/server/filters.rb +1 -1
  35. data/lib/nitro/server/render.rb +33 -29
  36. data/lib/nitro/server/shaders.rb +32 -3
  37. data/lib/nitro/server/user.rb +1 -1
  38. data/lib/nitro/server/webrick.rb +9 -4
  39. data/lib/nitro/ui/popup.rb +1 -1
  40. data/lib/nitro/ui/select.rb +1 -1
  41. data/lib/nitro/ui/tabs.rb +1 -1
  42. data/lib/nitro/version.rb +2 -2
  43. data/lib/og.rb +17 -6
  44. data/lib/og/backend.rb +34 -4
  45. data/lib/og/backends/mysql.rb +3 -17
  46. data/lib/og/backends/psql.rb +5 -17
  47. data/lib/og/meta.rb +41 -26
  48. data/lib/og/mock.rb +223 -0
  49. data/lib/og/version.rb +2 -2
  50. data/lib/parts/content.rb +61 -0
  51. data/test/glue/{tc_properties.rb → tc_property.rb} +0 -1
  52. data/test/glue/tc_property_mixins.rb +62 -0
  53. data/test/og/tc_lifecycle.rb +107 -0
  54. data/test/tc_og.rb +31 -4
  55. data/vendor/README +6 -0
  56. data/vendor/binding_of_caller.rb +81 -0
  57. data/vendor/breakpoint.rb +526 -0
  58. data/vendor/breakpoint_client.rb +157 -0
  59. metadata +135 -95
data/bin/proto/config.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  # * George Moschovitis <gm@navel.gr>
12
12
  #
13
13
  # (c) 2004 Navel, all rights reserved.
14
- # $Id: config.rb 188 2004-12-10 14:14:17Z gmosx $
14
+ # $Id: config.rb 194 2004-12-20 20:23:57Z gmosx $
15
15
 
16
16
  require "nitro"
17
17
  require "glue/logger"
@@ -43,7 +43,7 @@ if $DBG # DEBUG mode
43
43
  :address => "localhost",
44
44
  # :backend => "mysql",
45
45
  :backend => "psql",
46
- :database => "blog",
46
+ :database => "proto",
47
47
  :user => "postgres",
48
48
  :password => "navelrulez",
49
49
  :connection_count => 3
@@ -62,7 +62,7 @@ else # LIVE mode
62
62
  :address => "localhost",
63
63
  # :backend => "mysql",
64
64
  :backend => "psql",
65
- :database => "blog",
65
+ :database => "proto",
66
66
  :user => "postgres",
67
67
  :password => "navelrulez",
68
68
  :connection_count => 20
@@ -3,40 +3,8 @@
3
3
  <x:page xmlns:x="http://www.navel.gr/xml/shader.xsd">
4
4
 
5
5
  <x:cell id="main">
6
-
7
- <?r
8
- if @entries
9
- for entry in @entries
10
- ?>
11
- <div class="entry">
12
- <h2 class="date">#{entry.create_time.strftime('%B %e, %G')}</h2>
13
- <div class="post">
14
- <h3 class="title">#{entry.title}</h3>
15
- #{entry.body}
16
- <div class="footer">
17
- posted by #{entry.author} at <a href="view_entry?oid=#{entry.oid}">#{entry.create_time.strftime('%R %p')}</a> |
18
- <a href="view_entry?oid=#{entry.oid}#comments">#{entry.comments_count} comments</a>.
19
- <?r if session['owner'] ?>
20
- [<a href="del_entry?oid=#{entry.oid}">del</a>]
21
- <?r end ?>
22
- </div>
23
- </div>
24
- </div>
25
- <?r
26
- end
27
- else
28
- ?>
29
- no entries
30
- <?r end ?>
31
-
32
- <?r if session['owner'] ?>
33
- <include href="entry_form" />
34
- <?r end ?>
35
-
36
- </x:cell>
37
-
38
- <x:cell id="side">
39
- <include href="recent_posts" />
6
+ Your application comes here!<br />
7
+ Happy Hacking :-)
40
8
  </x:cell>
41
9
 
42
10
  </x:page>
@@ -3,25 +3,8 @@ body {
3
3
  padding: 0;
4
4
  font-family: Verdana, sans-serif;
5
5
  font-size: small;
6
- color: #333;
7
- background: #e0e0e0;
8
- }
9
-
10
- a:link {
11
- color: #69c;
12
- }
13
-
14
- a:visited {
15
- color: #666699;
16
- }
17
-
18
- a:hover {
19
- color: #693;
20
- }
21
-
22
- a:active {
23
- color: #cc3333;
24
- text-decoration: none;
6
+ color: #000;
7
+ background: #fff;
25
8
  }
26
9
 
27
10
  input, textarea {
@@ -30,30 +13,24 @@ input, textarea {
30
13
  }
31
14
 
32
15
  #page {
33
- position: relative; top: 50%; left: 50%;
34
- margin: 0px; margin-left: -400px;
35
16
  width: 847px;
36
- background: url(m/page_bg.gif) repeat-y;
37
17
  }
38
18
 
39
19
  #header {
40
20
  margin: 0px;
41
- color: #fff;
21
+ color: #000;
42
22
  font-family: "Lucida Grande", "Trebuchet MS";
43
- background: url(m/header_bg.gif) no-repeat top left;
44
23
  }
45
24
 
46
25
  #header h1 {
47
26
  margin: 0px;
48
- padding: 45px 60px 50px 160px;
49
- background: url(m/h1_bg.gif) no-repeat bottom left;
27
+ padding: 5px;
50
28
  }
51
29
 
52
30
  #footer {
53
31
  height: 40px;
54
32
  color: #fff;
55
33
  font-size: 80%;
56
- background: url(m/footer_bg.gif) repeat-y;
57
34
  padding-top: 15px; padding-left: 90px;
58
35
  }
59
36
 
@@ -77,7 +54,6 @@ input, textarea {
77
54
  list-style: none;
78
55
  padding-left: 14px;
79
56
  margin-bottom: 3px;
80
- background: url(m/obull.gif) no-repeat 0 6px;
81
57
  }
82
58
 
83
59
  .side {
@@ -86,7 +62,6 @@ input, textarea {
86
62
  padding-top: 25px; padding-left: 20px; padding-right: 20px;
87
63
  font-size: 85%;
88
64
  line-height: 1.4em;
89
- background: url(m/sidebar_bg.gif) no-repeat 0 0;
90
65
  }
91
66
 
92
67
  .side h2 {
@@ -97,7 +72,6 @@ input, textarea {
97
72
  height /**/:57px; /* for IE5/Win */
98
73
  font-family: "Lucida Grande", "Trebuchet MS";
99
74
  font-size: 130%;
100
- background: url(m/side_title_bg.gif) no-repeat 0px 15px;
101
75
  }
102
76
 
103
77
  .side ul {
@@ -109,7 +83,6 @@ input, textarea {
109
83
  list-style: none;
110
84
  margin-left: 0px; margin-bottom: 3px;
111
85
  padding-left: 14px;
112
- background: url(m/gbull.gif) no-repeat 0 6px;
113
86
  }
114
87
 
115
88
  .entry {
@@ -126,7 +99,6 @@ h2.date {
126
99
  padding-left: 14px;
127
100
  font-size: 90%;
128
101
  color: #f93;
129
- background: url(m/down.gif) no-repeat 0 50%;
130
102
  }
131
103
 
132
104
  .post {
@@ -147,7 +119,6 @@ h2.date {
147
119
  padding: 0 0 0 14px;
148
120
  font-size: 88%;
149
121
  color: #999;
150
- background: url(m/grbull.gif) no-repeat 0 6px;
151
122
  }
152
123
 
153
124
  #comments {
@@ -156,35 +127,6 @@ h2.date {
156
127
  font-size: 85%;
157
128
  line-height: 1.5em;
158
129
  color: #666;
159
- background: #eee url(m/comments_curve.gif) no-repeat top left;
160
- }
161
-
162
- #comments h2 {
163
- margin: 20px 0 15px 0;
164
- padding: 8px 0 0 40px;
165
- font-family: "Lucida Grande", "Trebuchet MS";
166
- font-size: 130%;
167
- color: #666;
168
- background: url(m/bubbles.gif) no-repeat 10px 0;
169
- height: 29px !important; /* for most browsers */
170
- height /**/:37px; /* for IE5/Win */
171
- }
172
-
173
- #comments form {
174
- margin: 10px;
175
- padding-bottom: 10px;
176
- }
177
-
178
- .comment {
179
- padding: 10px;
180
- border-bottom: 1px solid #ddd;
181
- }
182
-
183
- .comment .footer {
184
- margin: 4px 0 0 0;
185
- padding: 0 0 0 60px;
186
- color: #999;
187
- background: url(m/garrow.gif) no-repeat 44px 2px;
188
130
  }
189
131
 
190
132
  .error {
@@ -208,11 +150,3 @@ h2.date {
208
150
  margin: 20px;
209
151
  }
210
152
 
211
- .rss li {
212
- list-style: none;
213
- padding-left: 34px; padding-top: 3px;
214
- margin-bottom: 3px;
215
- height: 18px;
216
- background: url(m/rss.gif) no-repeat 0 6px;
217
- }
218
-
@@ -7,7 +7,7 @@ code:
7
7
  * George Moschovitis <gm@navel.gr>
8
8
 
9
9
  (c) 2004 Navel, all rights reserved.
10
- $Id: style.xsl 188 2004-12-10 14:14:17Z gmosx $
10
+ $Id: style.xsl 194 2004-12-20 20:23:57Z gmosx $
11
11
  -->
12
12
 
13
13
  <!DOCTYPE shader
@@ -27,17 +27,17 @@ $Id: style.xsl 188 2004-12-10 14:14:17Z gmosx $
27
27
 
28
28
  <xsl:include href="../nitro/lib/xsl/base.xsl" />
29
29
 
30
- <xsl:output method="xml" indent="yes" encoding="iso-8859-1" />
30
+ <xsl:output method="xml" indent="yes" encoding="utf-8" />
31
31
 
32
32
  <xsl:template name="x:head">
33
33
  <head>
34
34
  <title>#$name</title>
35
- <meta name="title" content="Blog" />
36
- <meta name="description" content="Example" />
37
- <meta name="keywords" content="nitro, example, blog" />
38
- <meta name="category" content="example" />
35
+ <meta name="title" content="Proto" />
36
+ <meta name="description" content="Prototyp application" />
37
+ <meta name="keywords" content="nitro, example, prototype" />
38
+ <meta name="category" content="prototype" />
39
39
  <meta name="robots" content="index, follow" />
40
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
40
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
41
41
 
42
42
  <xsl:apply-templates select="x:block[@id='meta']"/>
43
43
 
@@ -57,6 +57,7 @@ $Id: style.xsl 188 2004-12-10 14:14:17Z gmosx $
57
57
 
58
58
  <xsl:template name="x:footer">
59
59
  <div id="footer">
60
+ powered by Nitro.
60
61
  </div>
61
62
  </xsl:template>
62
63
 
@@ -79,39 +80,7 @@ $Id: style.xsl 188 2004-12-10 14:14:17Z gmosx $
79
80
  </div>
80
81
 
81
82
  <div class="block side">
82
- <h2>About</h2>
83
- This is a simple blog powered by <a href="http://www.navel.gr/nitro">
84
- Nitro</a> Web Engine. Have a look at the source code and enjoy
85
- the power of Ruby.
86
- <ruby>unless session['owner']</ruby>
87
- <p><a href="login">Login</a> as owner.</p>
88
- <ruby>else</ruby>
89
- <p><a href="logout">Logout</a>.</p>
90
- <ruby>end</ruby>
91
-
92
83
  <xsl:apply-templates select="x:cell[@id='side']" />
93
-
94
- <h2>Linkage</h2>
95
- <ul>
96
- <li><a target="_new" href="http://www.navel.gr">Navel Ltd</a></li>
97
- <li><a target="_new" href="http://www.navel.gr/nitro">Nitro Web Engine</a></li>
98
- <li><a target="_new" href="http://www.ruby-lang.org">Ruby</a></li>
99
- <li><a target="_new" href="http://www.blogger.com">Blogger</a></li>
100
- <li><a target="_new" href="http://www.w3c.org">W3 Consortium</a></li>
101
- </ul>
102
-
103
- <br />
104
- <ul class="rss">
105
- <li><a href="rest/list_entry">Latest entries</a></li>
106
- <li><a href="rest/list_comment">Latest comments</a></li>
107
- </ul>
108
-
109
- <br />
110
- <p>
111
- powered by <b><a href="http://www.navel.gr/nitro">Nitro</a></b>
112
- <br />
113
- skin from <a href="http://www.blogger.com">Blogger.com</a>
114
- </p>
115
84
  </div>
116
85
 
117
86
  <div class="clear">.</div>
data/doc/tutorial.txt ADDED
@@ -0,0 +1,5 @@
1
+ = Tutorial
2
+
3
+ == Create new app directory structure
4
+
5
+
data/examples/blog/app.rb CHANGED
@@ -8,12 +8,13 @@
8
8
  # * George Moschovitis <gm@navel.gr>
9
9
  #
10
10
  # (c) 2004 Navel, all rights reserved.
11
- # $Id: app.rb 185 2004-12-10 13:29:09Z gmosx $
11
+ # $Id: app.rb 197 2004-12-21 13:50:17Z gmosx $
12
12
 
13
13
  # set to true for DEBUG mode.
14
14
  $DBG = true
15
15
 
16
16
  $LOAD_PATH.unshift "../../lib"
17
+ $LOAD_PATH.unshift "../../vendor"
17
18
 
18
19
  require "config"
19
20
 
@@ -11,7 +11,7 @@
11
11
  # * George Moschovitis <gm@navel.gr>
12
12
  #
13
13
  # (c) 2004 Navel, all rights reserved.
14
- # $Id: config.rb 185 2004-12-10 13:29:09Z gmosx $
14
+ # $Id: config.rb 197 2004-12-21 13:50:17Z gmosx $
15
15
 
16
16
  require 'nitro'
17
17
  require 'glue/logger'
@@ -65,7 +65,12 @@ if $DBG # DEBUG mode
65
65
  $shader = N::XSLTShader.new("#$root_dir/style.xsl",
66
66
  N::RubyShader.new
67
67
  )
68
-
68
+ =begin
69
+ # lets play with the ULTRA-COOL breakpointer library.
70
+ require 'breakpoint'
71
+ Breakpoint.activate_drb
72
+ =end
73
+
69
74
  else # LIVE mode
70
75
 
71
76
  $appsrv_port = 8080
@@ -7,7 +7,7 @@ code:
7
7
  * George Moschovitis <gm@navel.gr>
8
8
 
9
9
  (c) 2004 Navel, all rights reserved.
10
- $Id: style.xsl 185 2004-12-10 13:29:09Z gmosx $
10
+ $Id: style.xsl 194 2004-12-20 20:23:57Z gmosx $
11
11
  -->
12
12
 
13
13
  <!DOCTYPE shader
@@ -26,7 +26,6 @@ $Id: style.xsl 185 2004-12-10 13:29:09Z gmosx $
26
26
  exclude-result-prefixes="x xl">
27
27
 
28
28
  <xsl:include href="../../lib/xsl/base.xsl" />
29
- <xsl:include href="../../lib/xsl/ui.xsl" />
30
29
 
31
30
  <xsl:output method="xml" indent="yes" encoding="iso-8859-1" />
32
31
 
@@ -0,0 +1,34 @@
1
+ = Your application
2
+
3
+ Here comes the README file for your application.
4
+
5
+ == Configuration
6
+
7
+ Edit the file conf/webapp.rb as needed.
8
+
9
+ By default this skeleton app uses the PostgreSQL backend.
10
+ If you want to use a different backend dont forget to
11
+ change it for the DEBUG and LIVE configurations.
12
+
13
+ == Run
14
+
15
+ Exec the following command:
16
+
17
+ ruby app.rb --start
18
+
19
+ then point your browser to:
20
+
21
+ http://127.0.0.1:8080
22
+
23
+ (if you want to change the server address/port, edit the config.rb
24
+ file)
25
+
26
+ == Discussion
27
+
28
+ If you want to modify the skeleton app it is a nice idea to switch
29
+ to debug mode. Edit the following line in the file app.rb:
30
+
31
+ $DBG = true
32
+
33
+ In debug mode the view files (xhtml/xsl/etc) are automatically
34
+ reloaded.
@@ -0,0 +1,20 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ # = YourApp
4
+ #
5
+ # A skeleton application.
6
+ #
7
+ # code:
8
+ # * George Moschovitis <gm@navel.gr>
9
+ #
10
+ # (c) 2004 Navel, all rights reserved.
11
+ # $Id: app.rb 189 2004-12-13 21:38:05Z gmosx $
12
+
13
+ # set to true for DEBUG mode.
14
+ $DBG = true
15
+
16
+ $LOAD_PATH.unshift '../../lib'
17
+
18
+ require 'config'
19
+
20
+ $app = N::WebrickServer.new.exec()
@@ -0,0 +1,38 @@
1
+ # = Dynamic Flash
2
+ #
3
+ # A simple app that demonstrates
4
+ #
5
+ # code:
6
+ # * George Moschovitis <gm@navel.gr>
7
+ #
8
+ # (c) 2004 Navel, all rights reserved.
9
+ # $Id: config.rb 189 2004-12-13 21:38:05Z gmosx $
10
+
11
+ require 'nitro'
12
+ require 'glue/logger'
13
+ require 'nitro/config'
14
+
15
+ require 'nitro/l10n'
16
+ require 'glue/mixins'
17
+ require 'nitro/sitemap'
18
+
19
+ require 'glue/number'
20
+ require 'glue/string'
21
+ require 'glue/array'
22
+ require 'glue/hash'
23
+ require 'nitro/html'
24
+
25
+ require 'nitro/server/webrick'
26
+ require 'nitro/server/shaders'
27
+
28
+ require 'lib/flash'
29
+
30
+ $name = 'Dynamic Flash Application'
31
+
32
+ $services = {
33
+ :index => N::FlashService
34
+ }
35
+
36
+ $srv_address = $appsrv_address = '127.0.0.1'
37
+ $srv_url = "http://#$srv_address:#$srv_port"
38
+