nitro 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/AUTHORS +8 -0
  2. data/ChangeLog +1546 -0
  3. data/LICENCE +32 -0
  4. data/README +278 -0
  5. data/RELEASES +7 -0
  6. data/Rakefile +79 -0
  7. data/bin/cluster.rb +219 -0
  8. data/doc/architecture.txt +28 -0
  9. data/doc/bugs.txt +7 -0
  10. data/doc/css.txt +20 -0
  11. data/doc/ideas.txt +120 -0
  12. data/doc/pg.txt +47 -0
  13. data/doc/svn.txt +82 -0
  14. data/doc/todo.txt +30 -0
  15. data/etc/new-project.rb +18 -0
  16. data/examples/simple/README +15 -0
  17. data/examples/simple/app.rb +31 -0
  18. data/examples/simple/conf/apache.conf +100 -0
  19. data/examples/simple/conf/config.rb +89 -0
  20. data/examples/simple/conf/debug-config.rb +53 -0
  21. data/examples/simple/conf/live-config.rb +48 -0
  22. data/examples/simple/conf/overrides.rb +9 -0
  23. data/examples/simple/conf/requires.rb +51 -0
  24. data/examples/simple/ctl +32 -0
  25. data/examples/simple/env.rb +33 -0
  26. data/examples/simple/install.rb +12 -0
  27. data/examples/simple/lib/articles/entities.rb +35 -0
  28. data/examples/simple/lib/articles/lc-en.rb +36 -0
  29. data/examples/simple/lib/articles/methods.rb +55 -0
  30. data/examples/simple/lib/articles/part.rb +58 -0
  31. data/examples/simple/logs/access_log +2 -0
  32. data/examples/simple/logs/apache.log +3 -0
  33. data/examples/simple/logs/app.log +1 -0
  34. data/examples/simple/logs/events.log +1 -0
  35. data/examples/simple/root/add-article.sx +15 -0
  36. data/examples/simple/root/article-form.ss +20 -0
  37. data/examples/simple/root/comments-form.ss +16 -0
  38. data/examples/simple/root/comments.si +30 -0
  39. data/examples/simple/root/index.sx +44 -0
  40. data/examples/simple/root/shader/shader.xsl +100 -0
  41. data/examples/simple/root/shader/style.css +9 -0
  42. data/examples/simple/root/view-article.sx +30 -0
  43. data/examples/tiny/app.rb +30 -0
  44. data/examples/tiny/conf/apache.conf +100 -0
  45. data/examples/tiny/conf/config.rb +67 -0
  46. data/examples/tiny/conf/requires.rb +40 -0
  47. data/examples/tiny/ctl +31 -0
  48. data/examples/tiny/logs/access_log +9 -0
  49. data/examples/tiny/logs/apache.log +9 -0
  50. data/examples/tiny/root/index.sx +35 -0
  51. data/lib/n/app/cluster.rb +219 -0
  52. data/lib/n/app/cookie.rb +86 -0
  53. data/lib/n/app/filters/autologin.rb +50 -0
  54. data/lib/n/app/fragment.rb +67 -0
  55. data/lib/n/app/handlers.rb +120 -0
  56. data/lib/n/app/handlers/code-handler.rb +184 -0
  57. data/lib/n/app/handlers/page-handler.rb +612 -0
  58. data/lib/n/app/request-part.rb +59 -0
  59. data/lib/n/app/request.rb +653 -0
  60. data/lib/n/app/script.rb +398 -0
  61. data/lib/n/app/server.rb +53 -0
  62. data/lib/n/app/session.rb +224 -0
  63. data/lib/n/app/user.rb +47 -0
  64. data/lib/n/app/webrick-servlet.rb +213 -0
  65. data/lib/n/app/webrick.rb +70 -0
  66. data/lib/n/application.rb +187 -0
  67. data/lib/n/config.rb +31 -0
  68. data/lib/n/db.rb +217 -0
  69. data/lib/n/db/README +232 -0
  70. data/lib/n/db/connection.rb +369 -0
  71. data/lib/n/db/make-release.sh +26 -0
  72. data/lib/n/db/managed.rb +235 -0
  73. data/lib/n/db/mixins.rb +282 -0
  74. data/lib/n/db/mysql.rb +342 -0
  75. data/lib/n/db/psql.rb +378 -0
  76. data/lib/n/db/tools.rb +110 -0
  77. data/lib/n/db/utils.rb +99 -0
  78. data/lib/n/events.rb +118 -0
  79. data/lib/n/l10n.rb +22 -0
  80. data/lib/n/logger.rb +33 -0
  81. data/lib/n/macros.rb +53 -0
  82. data/lib/n/mixins.rb +46 -0
  83. data/lib/n/parts.rb +154 -0
  84. data/lib/n/properties.rb +194 -0
  85. data/lib/n/server.rb +61 -0
  86. data/lib/n/server/PLAYBACK.txt +8 -0
  87. data/lib/n/server/RESEARCH.txt +13 -0
  88. data/lib/n/server/filter.rb +77 -0
  89. data/lib/n/shaders.rb +167 -0
  90. data/lib/n/sitemap.rb +188 -0
  91. data/lib/n/std.rb +69 -0
  92. data/lib/n/sync/clc.rb +108 -0
  93. data/lib/n/sync/handler.rb +221 -0
  94. data/lib/n/sync/server.rb +170 -0
  95. data/lib/n/tools/README +11 -0
  96. data/lib/n/ui/date-select.rb +74 -0
  97. data/lib/n/ui/pager.rb +187 -0
  98. data/lib/n/ui/popup.rb +45 -0
  99. data/lib/n/ui/select.rb +41 -0
  100. data/lib/n/ui/tabs.rb +34 -0
  101. data/lib/n/utils/array.rb +92 -0
  102. data/lib/n/utils/cache.rb +144 -0
  103. data/lib/n/utils/gfx.rb +108 -0
  104. data/lib/n/utils/hash.rb +148 -0
  105. data/lib/n/utils/html.rb +147 -0
  106. data/lib/n/utils/http.rb +98 -0
  107. data/lib/n/utils/mail.rb +28 -0
  108. data/lib/n/utils/number.rb +31 -0
  109. data/lib/n/utils/pool.rb +66 -0
  110. data/lib/n/utils/string.rb +297 -0
  111. data/lib/n/utils/template.rb +38 -0
  112. data/lib/n/utils/time.rb +91 -0
  113. data/lib/n/utils/uri.rb +193 -0
  114. data/lib/xsl/base.xsl +205 -0
  115. data/lib/xsl/ce.xsl +30 -0
  116. data/lib/xsl/localization.xsl +23 -0
  117. data/lib/xsl/xforms.xsl +26 -0
  118. data/test/run.rb +95 -0
  119. metadata +187 -0
@@ -0,0 +1,30 @@
1
+ <?xml version='1.0' encoding='iso-8859-7'?>
2
+
3
+ <!--
4
+ gmosx:
5
+ contenteditable templates
6
+ -->
7
+
8
+ <xsl:stylesheet
9
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
10
+ xmlns:ce='http://www.navel.gr/xml/content-editable.xsd'
11
+ version='1.0'>
12
+
13
+ <xsl:template name='ce:enable' match='ce:enable'>
14
+ <script language='javascript' src='*root/content/content-editable.js'>//
15
+ </script>
16
+ </xsl:template>
17
+
18
+ <xsl:template name='ce:block' match='ce:block'>
19
+ <xsl:param name='id'><xsl:value-of select='id'/></xsl:param>
20
+ <xsl:param name='action'><xsl:value-of select='action'/></xsl:param>
21
+ <form id='{$id}_ce_form' method='post' action='{$action}'>
22
+ <input type='hidden' name='content'/>
23
+ </form>
24
+ [<a href='#' onclick='javascript: CE_startEdit("{$id}")'>on</a>]<br/>
25
+ <div id='{$id}' contenteditable='false'>
26
+ <xsl:apply-templates/>
27
+ </div>
28
+ </xsl:template>
29
+
30
+ </xsl:stylesheet>
@@ -0,0 +1,23 @@
1
+ <?xml version='1.0' encoding='iso-8859-7'?>
2
+
3
+ <!--
4
+ gmosx:
5
+ Localization templates
6
+ -->
7
+
8
+ <xsl:stylesheet
9
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
10
+ version='1.0'>
11
+
12
+ <xsl:template match='*[@xml:lang]'>
13
+ <xsl:processing-instruction name='r'>if "<xsl:value-of select='@xml:lang'/>" == request.session.language</xsl:processing-instruction>
14
+ <xsl:copy><xsl:apply-templates/></xsl:copy>
15
+ <xsl:processing-instruction name='r'>end</xsl:processing-instruction>
16
+ </xsl:template>
17
+
18
+ <xsl:template match='l'>
19
+ <xsl:apply-templates/>
20
+ <xsl:processing-instruction name='r'>L["<xsl:apply-templates/>"]</xsl:processing-instruction>
21
+ </xsl:template>
22
+
23
+ </xsl:stylesheet>
@@ -0,0 +1,26 @@
1
+ <?xml version='1.0' encoding='iso-8859-7'?>
2
+
3
+ <!--
4
+ gmosx:
5
+ XForms related templates
6
+ -->
7
+
8
+ <xsl:stylesheet
9
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
10
+ xmlns:xf='http://www.w3.org/2002/08/xforms/cr'
11
+ xmlns:x='http://www.navel.gr/xml/shader.xsd' version='1.0'>
12
+
13
+ <xsl:template match='xf:form'>
14
+ <table width='100%'>
15
+ <xsl:apply-templates/>
16
+ </table>
17
+ </xsl:template>
18
+
19
+ <xsl:template match='xf:input'>
20
+ <tr><td class='form-label'>
21
+ <xsl:value-of select='xf:label'/>:<br/>
22
+ <input type='text'/>
23
+ </td></tr>
24
+ </xsl:template>
25
+
26
+ </xsl:stylesheet>
@@ -0,0 +1,95 @@
1
+ #!/usr/local/bin/ruby
2
+
3
+ # = Master Test Suite for Navel Technology Revision 2 (n2)
4
+ #
5
+ # === FIXME:
6
+ #
7
+ # - move this to tools/ or something.
8
+ # - remove this unshift crap (have to fix some tests)
9
+ #
10
+ # * gmosx, ekarak
11
+ #
12
+ # (c) 2003 Navel, all rights reserved.
13
+ # $Id: run.rb 79 2004-10-18 16:38:19Z gmosx $
14
+
15
+ ($:).unshift ".."
16
+
17
+ require "test/unit"
18
+
19
+ # FIXME: remove n1 dependencies!
20
+
21
+ require "n1/og"
22
+ require "n1/utils/arrays"
23
+ require "n1/utils/time-utils"
24
+ require "n1/utils/string-utils"
25
+
26
+ require "n/std"
27
+ require "n/logger"
28
+
29
+ #---------------------------------------------------------------
30
+ # parse parameters, setup.
31
+
32
+ # enable n2 logging.
33
+ LOG = ARGV.include?("--log")
34
+
35
+ # enable this to run all the tests, even time consuming ones.
36
+ FULL_TEST = ("--full" == ARGV.pop)
37
+
38
+ # FIXME: have a flag to set the logger to show debug info!
39
+ if LOG
40
+ $log = Logger.new(STDERR)
41
+ else
42
+ $log = Logger.new("test-all.out")
43
+ end
44
+
45
+ #---------------------------------------------------------------
46
+ # locate all testcases
47
+
48
+ # add time consuming tests here!
49
+ time_consuming_testcases = [
50
+ "mixins/tc-expirable.rb",
51
+ "odb/backends/tc-mysql.rb"
52
+ ]
53
+
54
+ # add tests to exclude here!
55
+ excluded_testcases = [
56
+ "web/server/tc-modruby-adapter.rb",
57
+ # tml, FIXME: re-enable these CRITICAL tests!
58
+ "web/server/handlers/tc-page-handler.rb",
59
+ "web/server/handlers/tc-rx-handler.rb",
60
+ "web/server/handlers/tc-action-handler.rb"
61
+ ]
62
+
63
+ testcases = %x{ find . -name "tc-*.rb" -print0 }
64
+ testcases = testcases.split("\0").collect { |tc| tc[2..tc.length] }
65
+ testcases = testcases - excluded_testcases
66
+ testcases = (testcases - time_consuming_testcases) unless FULL_TEST
67
+
68
+ # shuffle is used to test for missing requires.
69
+ testcases.shuffle.each { |tc|
70
+ require tc
71
+ }
72
+
73
+ #---------------------------------------------------------------
74
+ # perform tests
75
+
76
+ if FULL_TEST
77
+ puts "syntax checking ruby (.rb) files"
78
+
79
+ str = %x{ find . -name "*.rb" | xargs -n1 ruby -c}
80
+ $log.warn(str) unless $? == 0
81
+
82
+ count = %x{find . -name "*.rb" | wc -l}
83
+ puts "#{count.chop} files validated!"
84
+
85
+ puts "syntax checking xml (.sx, .si, etc) files"
86
+
87
+ str = %x{ find . -name "*.s[x|i]" | xargs -n1 xmllint --noout }
88
+ $log.warn(str) unless $? == 0
89
+
90
+ count = %x{find . -name "*.s[x|i]" | wc -l}
91
+ puts "#{count.chop} files validated!"
92
+ end
93
+
94
+ # TestUnit uses reflection to perfom the tests now.
95
+ # ...
metadata ADDED
@@ -0,0 +1,187 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.1
3
+ specification_version: 1
4
+ name: nitro
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.1.2
7
+ date: 2004-10-21
8
+ summary: Web Engine
9
+ require_paths:
10
+ - lib
11
+ author: George Moschovitis
12
+ email: gm@navel.gr
13
+ homepage: http://www.navel.gr/nitro
14
+ rubyforge_project: nitro
15
+ description: "An efficient, yet simple engine for Web Applications"
16
+ autorequire: n/std
17
+ default_executable:
18
+ bindir: bin
19
+ has_rdoc: true
20
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
21
+ requirements:
22
+ -
23
+ - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: 1.8.1
26
+ version:
27
+ platform: ruby
28
+ files:
29
+ - LICENCE
30
+ - AUTHORS
31
+ - RELEASES
32
+ - README
33
+ - ChangeLog
34
+ - Rakefile
35
+ - bin/cluster.rb
36
+ - etc/new-project.rb
37
+ - examples/tiny
38
+ - examples/simple
39
+ - examples/tiny/conf
40
+ - examples/tiny/app.rb
41
+ - examples/tiny/logs
42
+ - examples/tiny/root
43
+ - examples/tiny/ctl
44
+ - examples/tiny/conf/requires.rb
45
+ - examples/tiny/conf/apache.conf
46
+ - examples/tiny/conf/config.rb
47
+ - examples/tiny/logs/apache.log
48
+ - examples/tiny/logs/access_log
49
+ - examples/tiny/root/index.sx
50
+ - examples/simple/conf
51
+ - examples/simple/app.rb
52
+ - examples/simple/install.rb
53
+ - examples/simple/env.rb
54
+ - examples/simple/logs
55
+ - examples/simple/root
56
+ - examples/simple/README
57
+ - examples/simple/ctl
58
+ - examples/simple/lib
59
+ - examples/simple/conf/overrides.rb
60
+ - examples/simple/conf/requires.rb
61
+ - examples/simple/conf/apache.conf
62
+ - examples/simple/conf/live-config.rb
63
+ - examples/simple/conf/config.rb
64
+ - examples/simple/conf/debug-config.rb
65
+ - examples/simple/logs/events.log
66
+ - examples/simple/logs/apache.log
67
+ - examples/simple/logs/access_log
68
+ - examples/simple/logs/app.log
69
+ - examples/simple/root/comments-form.ss
70
+ - examples/simple/root/view-article.sx
71
+ - examples/simple/root/comments.si
72
+ - examples/simple/root/shader
73
+ - examples/simple/root/etc
74
+ - examples/simple/root/index.sx
75
+ - examples/simple/root/add-article.sx
76
+ - examples/simple/root/article-form.ss
77
+ - examples/simple/root/shader/shader.xsl
78
+ - examples/simple/root/shader/style.css
79
+ - examples/simple/lib/articles
80
+ - examples/simple/lib/articles/lc-en.rb
81
+ - examples/simple/lib/articles/part.rb
82
+ - examples/simple/lib/articles/entities.rb
83
+ - examples/simple/lib/articles/methods.rb
84
+ - doc/todo.txt
85
+ - doc/bugs.txt
86
+ - doc/css.txt
87
+ - doc/ideas.txt
88
+ - doc/pg.txt
89
+ - doc/svn.txt
90
+ - doc/architecture.txt
91
+ - lib/n
92
+ - lib/xsl
93
+ - lib/p
94
+ - lib/n/app
95
+ - lib/n/sitemap.rb
96
+ - lib/n/properties.rb
97
+ - lib/n/parts.rb
98
+ - lib/n/utils
99
+ - lib/n/db
100
+ - lib/n/macros.rb
101
+ - lib/n/shaders.rb
102
+ - lib/n/sync
103
+ - lib/n/server.rb
104
+ - lib/n/server
105
+ - lib/n/events.rb
106
+ - lib/n/mixins.rb
107
+ - lib/n/l10n.rb
108
+ - lib/n/tools
109
+ - lib/n/ui
110
+ - lib/n/application.rb
111
+ - lib/n/config.rb
112
+ - lib/n/logger.rb
113
+ - lib/n/std.rb
114
+ - lib/n/db.rb
115
+ - lib/n/app/filters
116
+ - lib/n/app/session.rb
117
+ - lib/n/app/handlers
118
+ - lib/n/app/request.rb
119
+ - lib/n/app/fragment.rb
120
+ - lib/n/app/script.rb
121
+ - lib/n/app/webrick-servlet.rb
122
+ - lib/n/app/server.rb
123
+ - lib/n/app/cluster.rb
124
+ - lib/n/app/cookie.rb
125
+ - lib/n/app/user.rb
126
+ - lib/n/app/request-part.rb
127
+ - lib/n/app/handlers.rb
128
+ - lib/n/app/webrick.rb
129
+ - lib/n/app/filters/autologin.rb
130
+ - lib/n/app/handlers/page-handler.rb
131
+ - lib/n/app/handlers/code-handler.rb
132
+ - lib/n/utils/pool.rb
133
+ - lib/n/utils/time.rb
134
+ - lib/n/utils/mail.rb
135
+ - lib/n/utils/array.rb
136
+ - lib/n/utils/number.rb
137
+ - lib/n/utils/uri.rb
138
+ - lib/n/utils/gfx.rb
139
+ - lib/n/utils/cache.rb
140
+ - lib/n/utils/html.rb
141
+ - lib/n/utils/template.rb
142
+ - lib/n/utils/string.rb
143
+ - lib/n/utils/http.rb
144
+ - lib/n/utils/hash.rb
145
+ - lib/n/db/make-release.sh
146
+ - lib/n/db/tools.rb
147
+ - lib/n/db/connection.rb
148
+ - lib/n/db/psql.rb
149
+ - lib/n/db/mysql.rb
150
+ - lib/n/db/managed.rb
151
+ - lib/n/db/utils.rb
152
+ - lib/n/db/mixins.rb
153
+ - lib/n/db/README
154
+ - lib/n/sync/handler.rb
155
+ - lib/n/sync/server.rb
156
+ - lib/n/sync/clc.rb
157
+ - lib/n/server/RESEARCH.txt
158
+ - lib/n/server/PLAYBACK.txt
159
+ - lib/n/server/filter.rb
160
+ - lib/n/tools/README
161
+ - lib/n/ui/popup.rb
162
+ - lib/n/ui/select.rb
163
+ - lib/n/ui/date-select.rb
164
+ - lib/n/ui/tabs.rb
165
+ - lib/n/ui/pager.rb
166
+ - lib/xsl/localization.xsl
167
+ - lib/xsl/ce.xsl
168
+ - lib/xsl/xforms.xsl
169
+ - lib/xsl/base.xsl
170
+ - test/run.rb
171
+ test_files: []
172
+ rdoc_options:
173
+ - "--main"
174
+ - README
175
+ - "--title"
176
+ - Nitro Documentation
177
+ extra_rdoc_files:
178
+ - LICENCE
179
+ - AUTHORS
180
+ - RELEASES
181
+ - README
182
+ - ChangeLog
183
+ - Rakefile
184
+ executables: []
185
+ extensions: []
186
+ requirements: []
187
+ dependencies: []