nitro 0.1.2 → 0.2.0

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 +3 -0
  2. data/ChangeLog +83 -0
  3. data/LICENCE +8 -8
  4. data/README +5 -1
  5. data/RELEASES +9 -0
  6. data/Rakefile +43 -23
  7. data/bin/cluster.rb +15 -12
  8. data/examples/ndb/README +5 -0
  9. data/examples/ndb/run.rb +271 -0
  10. data/examples/simple/README +27 -0
  11. data/examples/simple/app.rb +2 -2
  12. data/examples/simple/conf/config.rb +3 -8
  13. data/examples/simple/conf/debug-config.rb +6 -7
  14. data/examples/simple/conf/live-config.rb +2 -4
  15. data/examples/simple/conf/requires.rb +2 -10
  16. data/examples/simple/ctl +1 -1
  17. data/examples/simple/env.rb +2 -2
  18. data/examples/simple/root/article-form.ss +1 -1
  19. data/examples/simple/root/comments-form.ss +1 -1
  20. data/examples/tiny/README +15 -0
  21. data/examples/tiny/app.rb +2 -2
  22. data/examples/tiny/conf/config.rb +8 -13
  23. data/examples/tiny/conf/requires.rb +2 -8
  24. data/examples/tiny/ctl +2 -17
  25. data/examples/tiny/root/index.sx +1 -1
  26. data/lib/n/app/cluster.rb +15 -12
  27. data/lib/n/app/cookie.rb +10 -9
  28. data/lib/n/app/filters/autologin.rb +5 -4
  29. data/lib/n/app/fragment.rb +13 -10
  30. data/lib/n/app/handlers.rb +29 -22
  31. data/lib/n/app/handlers/code-handler.rb +2 -4
  32. data/lib/n/app/handlers/page-handler.rb +3 -5
  33. data/lib/n/app/request-part.rb +2 -7
  34. data/lib/n/app/request.rb +27 -22
  35. data/lib/n/app/script.rb +4 -15
  36. data/lib/n/app/server.rb +11 -7
  37. data/lib/n/app/session.rb +7 -11
  38. data/lib/n/app/user.rb +10 -11
  39. data/lib/n/app/webrick-servlet.rb +23 -10
  40. data/lib/n/app/webrick.rb +13 -10
  41. data/lib/n/application.rb +13 -6
  42. data/lib/n/config.rb +18 -7
  43. data/lib/n/db.rb +56 -40
  44. data/lib/n/db/connection.rb +18 -22
  45. data/lib/n/db/managed.rb +6 -8
  46. data/lib/n/db/mixins.rb +4 -7
  47. data/lib/n/db/mysql.rb +6 -3
  48. data/lib/n/db/psql.rb +15 -10
  49. data/lib/n/db/tools.rb +5 -9
  50. data/lib/n/db/utils.rb +11 -8
  51. data/lib/n/events.rb +14 -10
  52. data/lib/n/logger.rb +8 -2
  53. data/lib/n/macros.rb +5 -2
  54. data/lib/n/parts.rb +13 -10
  55. data/lib/n/properties.rb +17 -12
  56. data/lib/n/server.rb +3 -2
  57. data/lib/n/server/filter.rb +2 -4
  58. data/lib/n/shaders.rb +11 -13
  59. data/lib/n/sitemap.rb +23 -20
  60. data/lib/n/std.rb +15 -4
  61. data/lib/n/sync/clc.rb +4 -2
  62. data/lib/n/sync/handler.rb +20 -12
  63. data/lib/n/sync/server.rb +24 -18
  64. data/lib/n/ui/date-select.rb +2 -4
  65. data/lib/n/ui/pager.rb +10 -8
  66. data/lib/n/ui/popup.rb +5 -4
  67. data/lib/n/ui/select.rb +3 -4
  68. data/lib/n/ui/tabs.rb +3 -4
  69. data/lib/n/utils/array.rb +6 -14
  70. data/lib/n/utils/cache.rb +3 -7
  71. data/lib/n/utils/gfx.rb +5 -6
  72. data/lib/n/utils/hash.rb +7 -12
  73. data/lib/n/utils/html.rb +8 -4
  74. data/lib/n/utils/http.rb +10 -6
  75. data/lib/n/utils/mail.rb +6 -6
  76. data/lib/n/utils/number.rb +3 -4
  77. data/lib/n/utils/pool.rb +5 -8
  78. data/lib/n/utils/string.rb +12 -10
  79. data/lib/n/utils/template.rb +3 -5
  80. data/lib/n/utils/time.rb +7 -5
  81. data/lib/n/utils/uri.rb +5 -4
  82. data/lib/p/README +1 -0
  83. data/lib/xsl/xforms.xsl +2 -0
  84. data/test/n/app/tc_cookie.rb +34 -0
  85. data/test/n/app/tc_request.rb +70 -0
  86. data/test/n/app/tc_requestpart.rb +28 -0
  87. data/test/n/app/tc_session.rb +34 -0
  88. data/test/n/tc_db.rb +223 -0
  89. data/test/n/tc_db_mysql.rb +241 -0
  90. data/test/n/tc_events.rb +44 -0
  91. data/test/n/tc_properties.rb +68 -0
  92. data/test/n/tc_sitemap.rb +37 -0
  93. data/test/n/ui/tc_pager.rb +52 -0
  94. data/test/n/utils/tc_cache.rb +47 -0
  95. data/test/n/utils/tc_hash.rb +39 -0
  96. data/test/n/utils/tc_html.rb +79 -0
  97. data/test/n/utils/tc_http.rb +18 -0
  98. data/test/n/utils/tc_number.rb +21 -0
  99. data/test/n/utils/tc_strings.rb +149 -0
  100. data/test/n/utils/tc_uri.rb +100 -0
  101. metadata +49 -22
  102. data/doc/css.txt +0 -20
  103. data/doc/ideas.txt +0 -120
  104. data/doc/pg.txt +0 -47
  105. data/doc/svn.txt +0 -82
  106. data/doc/todo.txt +0 -30
  107. data/examples/simple/conf/overrides.rb +0 -9
  108. data/examples/simple/logs/access_log +0 -2
  109. data/examples/simple/logs/apache.log +0 -3
  110. data/examples/simple/logs/app.log +0 -1
  111. data/examples/simple/logs/events.log +0 -1
  112. data/examples/tiny/conf/apache.conf +0 -100
  113. data/examples/tiny/logs/access_log +0 -9
  114. data/examples/tiny/logs/apache.log +0 -9
  115. data/lib/n/db/make-release.sh +0 -26
  116. data/lib/n/tools/README +0 -11
  117. data/lib/xsl/ce.xsl +0 -30
  118. data/lib/xsl/localization.xsl +0 -23
  119. data/test/run.rb +0 -95
@@ -1,20 +0,0 @@
1
- Center a page:
2
- --------------
3
-
4
- 1>
5
- .parent {
6
- text-align: center;
7
- }
8
-
9
- .child {
10
- width: 800px;
11
- margin: auto;
12
- }
13
-
14
- 2>
15
- .child {
16
- width: 800px;
17
- position: relative;
18
- left: 50%;
19
- margin-left: -(800/2)px;
20
- }
@@ -1,120 +0,0 @@
1
- Names:
2
- ------
3
-
4
- Nitro
5
- Cell
6
- Plasma
7
- Root
8
- Surrender
9
-
10
- Services
11
- --------
12
-
13
- + api / rpc
14
- + feeds
15
-
16
- Pickaxe
17
- -------
18
-
19
- #-- : stops RDoc comment.
20
- :include: file
21
- gem install -r rake
22
-
23
- General
24
- -------
25
-
26
- + use hashes/yaml for configuration (so they can be editable from a
27
- web interface). Or even marshal dump them to the db.
28
- + use P prefix for part classes. (infamous File problem).
29
- + enable cache should be default.
30
- + dependencies in parts.
31
- + env.rb -> .irbrc
32
- + add a check for nested db invocations.
33
- + geoloc part.
34
- + xpath->sql translator.
35
- + keep old values in form when updating (transaction checks).
36
- + use xsltproc x:include
37
- + use ruby/extensions.
38
- + MEGA: use ostruct for db non serialized access.
39
- + auto-box .ss/.si files.
40
- + something like phpinfo.
41
- + have banned user names.
42
- + somehow use templates for .ss stuff to avoid the .sx
43
- + convert to greeklish when searching has an interesting side effect.
44
- + remove non-hash/utility methods from request (to simplify the code
45
- and make more compatible with irb).
46
- + use closures to implement filters.
47
- + mute.
48
- + irb.login returns request (and session).
49
- + request[:USER]
50
- + change log format.
51
- + run the app from a special user inherit the root directory.
52
- + index.sx like ruby require !!!
53
- + use Ruby/DL for libxml/libxslt and if it is as efficient for psql.
54
- + dont use $vars due to nasty ruby handling!
55
- + use one cookie for nsid/nauth
56
- + _ prefix for sql tables to be more safe.
57
- + __ -> _
58
- + Trash with marshaled objects.
59
- + use those cool tooltips from the js library.
60
- + __pre_render ? or rename __init?
61
- + expires needed as well as lm ?
62
- + try to NOT create sessions when calculating etag.
63
- + do NOT use threads, very risky! -> NO, i AM risky :)
64
-
65
- Messages
66
- --------
67
-
68
- yahoo:
69
-
70
- + send audibles/avatars (flash based).
71
-
72
- Fora
73
- ----
74
-
75
- + css export (generalized should parse categories)
76
- + show related threads (how calc? --> tags?)
77
-
78
- mad:
79
-
80
- + see recent messages 24, 48, 7 h
81
-
82
- from yahoo:
83
-
84
- + report abuse.
85
- + ignore filter / profanity.
86
- + threaded titles.
87
- + go to message id.
88
-
89
-
90
- Polls
91
- -----
92
-
93
- + sort poll results by votes !! (da)
94
-
95
-
96
- Ad Management
97
- --------------
98
- + ad management should be centralized, not per page, just overrides.
99
-
100
-
101
- App Server
102
- ----------
103
-
104
- + sitemap should autocalculate which part a given page belongs
105
- (context sensitive search).
106
- + use one object (io ??) instead of request/response.
107
- + pre-compress css files.
108
-
109
-
110
-
111
-
112
-
113
- DONE:
114
- =====
115
-
116
- + [rails] Enviroroments, allows scripts and debugging with irb.
117
- + .tc-xxxx.rb for unit tests!
118
- + dont allow special chars in user names (esp ':')
119
- + push model for DRB synchronization to avoid excessive drb calls.
120
-
data/doc/pg.txt DELETED
@@ -1,47 +0,0 @@
1
-
2
- PostgreSQL Tips
3
- ===============
4
-
5
-
6
- * Quicky connect to a database 'foo' using
7
- the interactive shell:
8
-
9
- [elathan@velka elathan]$ psql foo -U postgres
10
-
11
- Use '\d' to show the tables after the connection.
12
-
13
-
14
- * Execute an SQL command via psql:
15
-
16
- joy=# SELECT * FROM r_forum;
17
-
18
- Keep in mind that you have to use uppercase for SQL commands
19
- and don't forget the trailing ';'.
20
-
21
-
22
- * Create a new database called 'foo':
23
-
24
- [elathan@velka elathan]$ createdb foo -U postgres
25
- CREATE DATABASE
26
-
27
-
28
- * Dump 'foo' database to 'dump.out':
29
-
30
- [elathan@velka elathan]$ pg_dump -U postgres -db foo -Fc > dump.out
31
-
32
- '-Fc' is the output format. From the docs:
33
-
34
- 'The most flexible output file format is the "custom" format (-Fc).
35
- It allows for selection and reordering of all archived items, and is
36
- compressed by default.'
37
-
38
- * Drop database called foo:
39
-
40
- [elathan@velka elathan]$ dropdb joy -U postgres
41
-
42
-
43
- * Restore foo using dump.out
44
-
45
- [elathan@velka elathan]$ pg_restore foo.out -d joy -U postgres
46
-
47
-
@@ -1,82 +0,0 @@
1
- elathan:
2
-
3
- Navel SVN Server: http://morfeas.navel.gr/
4
- Central Repository: navel
5
-
6
- FOR COMMITS: Don't forget to set up SVN_EDITOR:
7
- export SVN_EDITOR=vim
8
-
9
- Some Tips for the SubVersion System
10
-
11
- 1. Install a server
12
-
13
- [elathan@velka elathan]$ cat /etc/services | grep svn
14
- svn 3690/tcp # Subversion
15
- svn 3690/udp # Subversion
16
-
17
- For xinetd-based systems:
18
-
19
- [elathan@velka elathan]$ cat /etc/xinetd.d/svn
20
-
21
- service svn
22
- {
23
- disable = no
24
- socket_type = stream
25
- wait = no
26
- port = 3690
27
- protocol = tcp
28
- user = svn
29
- server = /usr/local/bin/svnserve
30
- server_args = -i -r /home/svn/
31
- }
32
-
33
- For inetd-based systems:
34
-
35
- elathan@morfeas:~> cat /etc/inetd.conf | grep svn
36
- svn stream tcp nowait svn /usr/local/bin/svnserve svnserve -i -r /home/svn
37
-
38
- In all the above the creation of a user 'svn' is implied. Also, all
39
- the repositories will be created under his home directory.
40
-
41
- 2. Create a repository
42
-
43
- % svnadmin create /home/svn/navel
44
-
45
- 3. Checking Out
46
-
47
- [elathan@velka navel]$ svn checkout svn://morfeas.navel.gr/navel
48
-
49
- svn://morfeas.navel.gr is the SVN Server.
50
- navel is the repository
51
-
52
- 4. Updating
53
-
54
- svn update
55
-
56
- 5. Adding
57
-
58
- svn add foo
59
-
60
- 6. Committing
61
-
62
- svn commit foo
63
-
64
- 7. Seeing the changes
65
-
66
- svn status [--verbose]
67
-
68
- 8. Id tag use
69
-
70
- Put these in your .subversion/config:
71
-
72
- [miscellany]
73
- enable-auto-props = yes
74
-
75
- [auto-props]
76
- *.rb = svn:keywords=Id
77
- *.rx = svn:keywords=Id
78
- *.sx = svn:keywords=Id
79
- *.si = svn:keywords=Id
80
- *.ss = svn:keywords=Id
81
- *.xsl = svn:keywords=Id
82
- *.css = svn:keywords=Id
@@ -1,30 +0,0 @@
1
-
2
- beutify:
3
-
4
- - better solution than initialize(*args)
5
-
6
- db:
7
-
8
- - support N::Entity.db_get(oid).
9
-
10
- features:
11
-
12
- - synchronizable
13
-
14
- client:
15
-
16
- - handle checkboxes
17
-
18
- research:
19
-
20
- - template system like amrita (more portable through langs)
21
-
22
-
23
- optimization:
24
-
25
- - custom webserver instead of webrick, only for .sx/.rx
26
-
27
-
28
- debugging:
29
-
30
- - debug part
@@ -1,9 +0,0 @@
1
- # = Simple
2
- #
3
- # Framework overrides.
4
- #
5
- # === Todo:
6
- #
7
- # - find a better name for this file.
8
-
9
-
@@ -1,2 +0,0 @@
1
- 127.0.0.1 - - [20/Oct/2004:16:50:41 +0300] "GET /index.sx HTTP/1.1" 200 1605
2
- 127.0.0.1 - - [20/Oct/2004:16:50:42 +0300] "GET /favicon.ico HTTP/1.1" 404 209
@@ -1,3 +0,0 @@
1
- [Wed Oct 20 16:50:36 2004] [warn] pid file /tmp/simple-apache.pid overwritten -- Unclean shutdown of previous Apache run?
2
- [Wed Oct 20 16:50:36 2004] [notice] Apache/2.0.50 (Fedora) configured -- resuming normal operations
3
- [Wed Oct 20 16:50:42 2004] [error] [client 127.0.0.1] File does not exist: /navel/nitro/examples/simple/root/favicon.ico
@@ -1 +0,0 @@
1
- # Logfile created on Wed Oct 20 16:50:36 EEST 2004 by logger.rb/1.5.2.4
@@ -1 +0,0 @@
1
- # Logfile created on Wed Oct 20 16:50:36 EEST 2004 by logger.rb/1.5.2.4
@@ -1,100 +0,0 @@
1
- # Apache proxy configuration
2
- # code: gmosx, drak, elathan, ekarak
3
-
4
- # gmosx: FIXME (optimize this!)
5
- LoadModule access_module /usr/lib/httpd/modules/mod_access.so
6
- LoadModule log_config_module /usr/lib/httpd/modules/mod_log_config.so
7
- LoadModule mime_magic_module /usr/lib/httpd/modules/mod_mime_magic.so
8
- LoadModule expires_module /usr/lib/httpd/modules/mod_expires.so
9
- LoadModule headers_module /usr/lib/httpd/modules/mod_headers.so
10
- LoadModule mime_module /usr/lib/httpd/modules/mod_mime.so
11
- LoadModule status_module /usr/lib/httpd/modules/mod_status.so
12
- LoadModule autoindex_module /usr/lib/httpd/modules/mod_autoindex.so
13
- LoadModule vhost_alias_module /usr/lib/httpd/modules/mod_vhost_alias.so
14
- LoadModule dir_module /usr/lib/httpd/modules/mod_dir.so
15
- LoadModule alias_module /usr/lib/httpd/modules/mod_alias.so
16
- LoadModule rewrite_module /usr/lib/httpd/modules/mod_rewrite.so
17
- LoadModule proxy_module /usr/lib/httpd/modules/mod_proxy.so
18
- LoadModule proxy_http_module /usr/lib/httpd/modules/mod_proxy_http.so
19
- LoadModule proxy_connect_module /usr/lib/httpd/modules/mod_proxy_connect.so
20
- LoadModule cgi_module /usr/lib/httpd/modules/mod_cgi.so
21
-
22
- Listen 8080
23
-
24
- User navel
25
- Group users
26
-
27
- PidFile /tmp/tiny-apache.pid
28
- ErrorLog logs/apache.log
29
- LogLevel warn
30
-
31
- # used for debuging
32
- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
33
- LogFormat "%h %l %u %t \"%r\" %>s %b" common
34
- CustomLog logs/access_log common
35
-
36
- Timeout 300
37
-
38
- # Keepalive
39
-
40
- KeepAlive On
41
- MaxKeepAliveRequests 64
42
- KeepAliveTimeout 5
43
-
44
- ServerTokens Off
45
- ServerSignature Off
46
- ExtendedStatus Off
47
-
48
- UseCanonicalName Off
49
- HostnameLookups Off
50
-
51
- #DirectoryIndex index.sx
52
-
53
- TypesConfig /etc/mime.types
54
- DefaultType text/plain
55
-
56
- MIMEMagicFile /etc/httpd/conf/magic
57
-
58
- IndexOptions None
59
-
60
- AddEncoding x-compress Z
61
- AddEncoding x-gzip gz tgz
62
- AddType application/x-tar .tgz
63
- AddType image/x-icon .ico
64
- AddType text/css .css # gmosx: needed! fixes a bug!
65
-
66
- AddLanguage en .en
67
- AddLanguage el .el
68
-
69
- AddDefaultCharset ISO-8859-7
70
-
71
- AddCharset ISO-8859-1 .iso8859-1 .latin1
72
- AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
73
- AddCharset UTF-8 .utf8
74
-
75
- # enable expirations
76
-
77
- ExpiresActive On
78
-
79
- # expire GIF images after a month in the client's cache
80
- ExpiresByType image/gif A2592000
81
- ExpiresByType image/jpg A2592000
82
- ExpiresByType image/bmp A2592000
83
-
84
- ExpiresByType text/css A2592000
85
- ExpiresByType text/javascript A2592000
86
-
87
- # prefork MPM
88
- StartServers 5
89
- MinSpareServers 1
90
- MaxSpareServers 7
91
- MaxClients 50
92
- MaxRequestsPerChild 10000
93
-
94
- DocumentRoot "/navel/nitro/examples/tiny/root"
95
-
96
- RewriteEngine on
97
-
98
- RewriteRule ^/(.*[sr][bix])$ http://127.0.0.1:9090/$1 [P]
99
- RewriteRule ^(.*)/$ http://127.0.0.1:9090$1/index.sx [P]
100
- RewriteRule ^/([^\.]*)$ http://127.0.0.1:9090/$1/index.sx [P]
@@ -1,9 +0,0 @@
1
- 127.0.0.1 - - [20/Oct/2004:16:50:12 +0300] "GET /favicon.ico HTTP/1.1" 404 209
2
- 127.0.0.1 - - [20/Oct/2004:16:50:14 +0300] "GET /index.sx HTTP/1.1" 200 390
3
- 127.0.0.1 - - [20/Oct/2004:16:50:14 +0300] "GET /favicon.ico HTTP/1.1" 404 209
4
- 127.0.0.1 - - [20/Oct/2004:16:50:16 +0300] "GET /index.sx?name=dasdsa HTTP/1.1" 200 403
5
- 127.0.0.1 - - [20/Oct/2004:16:50:17 +0300] "GET /favicon.ico HTTP/1.1" 404 209
6
- 127.0.0.1 - - [20/Oct/2004:16:50:20 +0300] "GET /index.sx?name=dasdsa HTTP/1.1" 200 403
7
- 127.0.0.1 - - [20/Oct/2004:16:50:20 +0300] "GET /favicon.ico HTTP/1.1" 404 209
8
- 127.0.0.1 - - [20/Oct/2004:17:55:45 +0300] "GET / HTTP/1.1" 200 390
9
- 127.0.0.1 - - [20/Oct/2004:17:55:45 +0300] "GET /favicon.ico HTTP/1.1" 404 209
@@ -1,9 +0,0 @@
1
- [Wed Oct 20 16:50:06 2004] [warn] pid file /tmp/tiny-apache.pid overwritten -- Unclean shutdown of previous Apache run?
2
- [Wed Oct 20 16:50:06 2004] [notice] Apache/2.0.50 (Fedora) configured -- resuming normal operations
3
- [Wed Oct 20 16:50:12 2004] [error] [client 127.0.0.1] File does not exist: /navel/nitro/examples/tiny/root/favicon.ico
4
- [Wed Oct 20 16:50:14 2004] [error] [client 127.0.0.1] File does not exist: /navel/nitro/examples/tiny/root/favicon.ico
5
- [Wed Oct 20 16:50:17 2004] [error] [client 127.0.0.1] File does not exist: /navel/nitro/examples/tiny/root/favicon.ico
6
- [Wed Oct 20 16:50:20 2004] [error] [client 127.0.0.1] File does not exist: /navel/nitro/examples/tiny/root/favicon.ico
7
- [Wed Oct 20 17:55:39 2004] [warn] pid file /tmp/tiny-apache.pid overwritten -- Unclean shutdown of previous Apache run?
8
- [Wed Oct 20 17:55:39 2004] [notice] Apache/2.0.50 (Fedora) configured -- resuming normal operations
9
- [Wed Oct 20 17:55:45 2004] [error] [client 127.0.0.1] File does not exist: /navel/nitro/examples/tiny/root/favicon.ico