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
@@ -0,0 +1,157 @@
1
+ require 'breakpoint'
2
+ require 'optparse'
3
+ require 'timeout'
4
+
5
+ options = {
6
+ :ClientURI => nil,
7
+ :ServerURI => "druby://localhost:42531",
8
+ :RetryDelay => 10
9
+ }
10
+
11
+ ARGV.options do |opts|
12
+ script_name = File.basename($0)
13
+ opts.banner = [
14
+ "Usage: ruby #{script_name} [options] [server uri]",
15
+ "",
16
+ "This tool lets you connect to a breakpoint service ",
17
+ "which was started via Breakpoint.activate_drb.",
18
+ "",
19
+ "The server uri defaults to druby://localhost:42531"
20
+ ].join("\n")
21
+
22
+ opts.separator ""
23
+
24
+ opts.on("-c", "--client-uri=uri",
25
+ "Run the client on the specified uri.",
26
+ "This can be used to specify the port",
27
+ "that the client uses to allow for back",
28
+ "connections from the server.",
29
+ "Default: Find a good URI automatically.",
30
+ "Example: -c druby://localhost:12345"
31
+ ) { |options[:ClientURI]| }
32
+
33
+ opts.on("-s", "--server-uri=uri",
34
+ "Connect to the server specified at the",
35
+ "specified uri.",
36
+ "Default: druby://localhost:42531"
37
+ ) { |options[:ServerURI]| }
38
+
39
+ opts.on("-R", "--retry-delay=delay", Integer,
40
+ "Automatically try to reconnect to the",
41
+ "server after delay seconds when the",
42
+ "connection failed or timed out.",
43
+ "A value of 0 disables automatical",
44
+ "reconnecting completely.",
45
+ "Default: 10"
46
+ ) { |options[:RetryDelay]| }
47
+
48
+ opts.separator ""
49
+
50
+ opts.on("-h", "--help",
51
+ "Show this help message."
52
+ ) { puts opts; exit }
53
+
54
+ opts.parse!
55
+ end
56
+
57
+ options[:ServerURI] = ARGV[0] if ARGV[0]
58
+
59
+ loop do
60
+ DRb.start_service(options[:ClientURI])
61
+
62
+ begin
63
+ service = DRbObject.new(nil, options[:ServerURI])
64
+
65
+ begin
66
+ timeout(10) { service.ping }
67
+ rescue Timeout::Error, DRb::DRbConnError
68
+ puts "",
69
+ " *** Breakpoint service didn't respond to ping request ***",
70
+ " This likely happened because of a misconfigured ACL (see the",
71
+ " documentation of Breakpoint.activate_drb, note that by default",
72
+ " you can only connect to a remote Breakpoint service via a SSH",
73
+ " tunnel), but might also be caused by an extremely slow connection.",
74
+ ""
75
+ raise
76
+ end
77
+
78
+ begin
79
+ service.register_eval_handler do |code|
80
+ result = eval(code, TOPLEVEL_BINDING)
81
+ if result
82
+ DRbObject.new(result)
83
+ else
84
+ result
85
+ end
86
+ end
87
+
88
+ service.register_collision_handler do
89
+ msg = [
90
+ " *** Breakpoint service collision ***",
91
+ " Another Breakpoint service tried to use the",
92
+ " port already occupied by this one. It will",
93
+ " keep waiting until this Breakpoint service",
94
+ " is shut down.",
95
+ " ",
96
+ " If you are using the Breakpoint library for",
97
+ " debugging a Rails or other CGI application",
98
+ " this likely means that this Breakpoint",
99
+ " session belongs to an earlier, outdated",
100
+ " request and should be shut down via 'exit'."
101
+ ].join("\n")
102
+
103
+ if RUBY_PLATFORM["win"] then
104
+ # This sucks. Sorry, I'm not doing this because
105
+ # I like funky message boxes -- I need to do this
106
+ # because on Windows I have no way of displaying
107
+ # my notification via puts() when gets() is still
108
+ # being performed on STDIN. I have not found a
109
+ # better solution.
110
+ begin
111
+ require 'tk'
112
+ root = TkRoot.new { withdraw }
113
+ Tk.messageBox('message' => msg, 'type' => 'ok')
114
+ root.destroy
115
+ rescue Exception
116
+ puts "", msg, ""
117
+ end
118
+ else
119
+ puts "", msg, ""
120
+ end
121
+ end
122
+
123
+ service.register_handler do |workspace, message|
124
+ puts message
125
+ IRB.start(nil, nil, workspace)
126
+ puts "", "Resumed execution. Waiting for next breakpoint...", ""
127
+ end
128
+
129
+ puts "Connection established. Waiting for breakpoint...", ""
130
+
131
+ loop do
132
+ begin
133
+ service.ping
134
+ rescue DRb::DRbConnError => error
135
+ puts "Server exited. Closing connection..."
136
+ break
137
+ end
138
+
139
+ sleep(0.5)
140
+ end
141
+ ensure
142
+ service.unregister_handler
143
+ end
144
+ rescue Exception => error
145
+ if options[:RetryDelay] > 0 then
146
+ puts "No connection to breakpoint service at #{options[:ServerURI]}:",
147
+ " (#{error.inspect})"
148
+ puts error.backtrace if $DEBUG
149
+ puts " Reconnecting in #{options[:RetryDelay]} seconds..."
150
+
151
+ sleep options[:RetryDelay]
152
+ retry
153
+ else
154
+ raise
155
+ end
156
+ end
157
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.1
2
+ rubygems_version: 0.8.3
3
3
  specification_version: 1
4
4
  name: nitro
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.0
7
- date: 2004-12-10
6
+ version: 0.7.0
7
+ date: 2004-12-27
8
8
  summary: Web Engine
9
9
  require_paths:
10
10
  - lib
11
- author: George Moschovitis
12
11
  email: gm@navel.gr
13
12
  homepage: http://www.navel.gr/nitro
14
13
  rubyforge_project: nitro
@@ -25,169 +24,210 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
24
  version: 1.8.1
26
25
  version:
27
26
  platform: ruby
27
+ authors:
28
+ - George Moschovitis
28
29
  files:
30
+ - Rakefile
29
31
  - ChangeLog.1
32
+ - ChangeLog
33
+ - LICENSE
30
34
  - AUTHORS
31
35
  - RELEASES
32
- - LICENSE
33
36
  - README
34
- - ChangeLog
35
- - Rakefile
37
+ - bin/new_app.rb
36
38
  - bin/proto
37
39
  - bin/cluster.rb
38
- - bin/new_app.rb
40
+ - bin/new_form.rb
41
+ - bin/proto/config.rb
39
42
  - bin/proto/log
40
- - bin/proto/app.rb
41
43
  - bin/proto/apache.conf
42
44
  - bin/proto/root
43
- - bin/proto/README
44
- - bin/proto/config.rb
45
+ - bin/proto/app.rb
45
46
  - bin/proto/lib
46
- - bin/proto/root/style.xsl
47
- - bin/proto/root/m
48
- - bin/proto/root/style.css
47
+ - bin/proto/README
49
48
  - bin/proto/root/index.xhtml
49
+ - bin/proto/root/style.css
50
+ - bin/proto/root/m
51
+ - bin/proto/root/style.xsl
52
+ - benchmark/nitro
53
+ - benchmark/og
54
+ - examples/flash
50
55
  - examples/tiny
51
56
  - examples/blog
52
57
  - examples/og
58
+ - examples/flash/config.rb
59
+ - examples/flash/log
60
+ - examples/flash/root
61
+ - examples/flash/tmp.swf
62
+ - examples/flash/app.rb
63
+ - examples/flash/lib
64
+ - examples/flash/README
65
+ - examples/flash/root/index.xhtml
66
+ - examples/flash/root/show_inline_text.xhtml
67
+ - examples/flash/lib/flash.rb
68
+ - examples/tiny/config.rb
53
69
  - examples/tiny/log
54
- - examples/tiny/app.rb
55
70
  - examples/tiny/root
71
+ - examples/tiny/app.rb
56
72
  - examples/tiny/README
57
- - examples/tiny/config.rb
58
- - examples/tiny/root/nitro-small.png
59
73
  - examples/tiny/root/index.xhtml
74
+ - examples/tiny/root/include.xhtml
75
+ - examples/tiny/root/nitro-small.png
76
+ - examples/blog/config.rb
60
77
  - examples/blog/log
61
- - examples/blog/app.rb
62
- - examples/blog/env.rb
63
78
  - examples/blog/apache.conf
64
79
  - examples/blog/root
65
- - examples/blog/README
66
- - examples/blog/config.rb
80
+ - examples/blog/app.rb
81
+ - examples/blog/env.rb
67
82
  - examples/blog/lib
83
+ - examples/blog/README
68
84
  - examples/blog/root/login.xhtml
69
- - examples/blog/root/style.xsl
85
+ - examples/blog/root/index.xhtml
86
+ - examples/blog/root/style.css
70
87
  - examples/blog/root/entry_form.xhtml
71
- - examples/blog/root/view_entry.xml
72
88
  - examples/blog/root/m
89
+ - examples/blog/root/comments.xhtml
90
+ - examples/blog/root/style.xsl
73
91
  - examples/blog/root/recent_posts.xhtml
74
92
  - examples/blog/root/view_entry.xhtml
75
- - examples/blog/root/comments.xhtml
76
- - examples/blog/root/style.css
77
- - examples/blog/root/index.xhtml
93
+ - examples/blog/root/view_entry.xml
94
+ - examples/blog/root/m/gbull.gif
95
+ - examples/blog/root/m/garrow.gif
96
+ - examples/blog/root/m/comments_curve.gif
97
+ - examples/blog/root/m/obull.gif
98
+ - examples/blog/root/m/down.gif
78
99
  - examples/blog/root/m/bubbles.gif
79
- - examples/blog/root/m/footer_bg.gif
80
100
  - examples/blog/root/m/page_bg.gif
81
- - examples/blog/root/m/obull.gif
82
101
  - examples/blog/root/m/header_bg.gif
83
- - examples/blog/root/m/sidebar_bg.gif
84
- - examples/blog/root/m/garrow.gif
85
- - examples/blog/root/m/nitro.gif
86
- - examples/blog/root/m/gbull.gif
87
- - examples/blog/root/m/rss.gif
88
- - examples/blog/root/m/down.gif
89
- - examples/blog/root/m/comments_curve.gif
90
102
  - examples/blog/root/m/side_title_bg.gif
91
- - examples/blog/root/m/grbull.gif
103
+ - examples/blog/root/m/rss.gif
92
104
  - examples/blog/root/m/h1_bg.gif
105
+ - examples/blog/root/m/nitro.gif
106
+ - examples/blog/root/m/sidebar_bg.gif
107
+ - examples/blog/root/m/grbull.gif
108
+ - examples/blog/root/m/footer_bg.gif
93
109
  - examples/blog/lib/blog.rb
94
110
  - examples/og/run.rb
111
+ - examples/og/mock_example.rb
95
112
  - examples/og/README
96
- - doc/bugs.txt
113
+ - doc/tutorial.txt
97
114
  - doc/architecture.txt
115
+ - doc/bugs.txt
98
116
  - lib/nitro
117
+ - lib/parts
99
118
  - lib/xsl
100
- - lib/og
119
+ - lib/glue.rb
101
120
  - lib/nitro.rb
102
121
  - lib/glue
122
+ - lib/og
103
123
  - lib/og.rb
104
- - lib/glue.rb
124
+ - lib/nitro/config.rb
105
125
  - lib/nitro/sitemap.rb
106
- - lib/nitro/mail.rb
107
- - lib/nitro/service.rb
108
- - lib/nitro/builders
109
- - lib/nitro/scaffold.rb
110
126
  - lib/nitro/uri.rb
111
- - lib/nitro/filters.rb
112
- - lib/nitro/server.rb
113
- - lib/nitro/server
114
- - lib/nitro/events.rb
127
+ - lib/nitro/version.rb
128
+ - lib/nitro/scaffold.rb
129
+ - lib/nitro/builders
130
+ - lib/nitro/ui
115
131
  - lib/nitro/html.rb
132
+ - lib/nitro/mail.rb
116
133
  - lib/nitro/l10n.rb
117
- - lib/nitro/ui
118
134
  - lib/nitro/application.rb
119
- - lib/nitro/config.rb
135
+ - lib/nitro/events.rb
120
136
  - lib/nitro/http.rb
121
- - lib/nitro/version.rb
122
- - lib/nitro/builders/table.rb
123
- - lib/nitro/builders/rss.rb
137
+ - lib/nitro/server.rb
138
+ - lib/nitro/server
139
+ - lib/nitro/service.rb
140
+ - lib/nitro/markup.rb
141
+ - lib/nitro/filters.rb
124
142
  - lib/nitro/builders/form.rb
125
- - lib/nitro/server/filters
126
- - lib/nitro/server/session.rb
127
- - lib/nitro/server/request.rb
128
- - lib/nitro/server/render.rb
143
+ - lib/nitro/builders/rss.rb
144
+ - lib/nitro/builders/table.rb
145
+ - lib/nitro/ui/pager.rb
146
+ - lib/nitro/ui/date-select.rb
147
+ - lib/nitro/ui/tabs.rb
148
+ - lib/nitro/ui/select.rb
149
+ - lib/nitro/ui/popup.rb
129
150
  - lib/nitro/server/requestpart.rb
130
- - lib/nitro/server/appserver.rb
151
+ - lib/nitro/server/cookie.rb
152
+ - lib/nitro/server/session.rb
131
153
  - lib/nitro/server/fragment.rb
132
- - lib/nitro/server/dispatcher.rb
133
154
  - lib/nitro/server/shaders.rb
155
+ - lib/nitro/server/render.rb
134
156
  - lib/nitro/server/script.rb
135
- - lib/nitro/server/filters.rb
136
- - lib/nitro/server/server.rb
157
+ - lib/nitro/server/appserver.rb
137
158
  - lib/nitro/server/cluster.rb
138
- - lib/nitro/server/cookie.rb
139
- - lib/nitro/server/user.rb
159
+ - lib/nitro/server/dispatcher.rb
140
160
  - lib/nitro/server/handlers.rb
161
+ - lib/nitro/server/user.rb
141
162
  - lib/nitro/server/webrick.rb
163
+ - lib/nitro/server/server.rb
164
+ - lib/nitro/server/request.rb
165
+ - lib/nitro/server/filters
166
+ - lib/nitro/server/filters.rb
142
167
  - lib/nitro/server/filters/autologin.rb
143
- - lib/nitro/ui/popup.rb
144
- - lib/nitro/ui/select.rb
145
- - lib/nitro/ui/date-select.rb
146
- - lib/nitro/ui/tabs.rb
147
- - lib/nitro/ui/pager.rb
168
+ - lib/parts/content.rb
169
+ - lib/parts/content
148
170
  - lib/xsl/ui.xsl
149
171
  - lib/xsl/xforms.xsl
150
172
  - lib/xsl/base.xsl
151
- - lib/og/backends
152
- - lib/og/connection.rb
153
- - lib/og/backend.rb
154
- - lib/og/meta.rb
155
- - lib/og/version.rb
156
- - lib/og/backends/psql.rb
157
- - lib/og/backends/mysql.rb
173
+ - lib/glue/mixins.rb
174
+ - lib/glue/logger.rb
158
175
  - lib/glue/pool.rb
159
- - lib/glue/time.rb
160
- - lib/glue/macro.rb
161
176
  - lib/glue/inflector.rb
162
- - lib/glue/array.rb
177
+ - lib/glue/hash.rb
163
178
  - lib/glue/number.rb
164
- - lib/glue/cache.rb
165
- - lib/glue/mixins.rb
179
+ - lib/glue/time.rb
166
180
  - lib/glue/property.rb
181
+ - lib/glue/property.rb.old
182
+ - lib/glue/macro.rb
183
+ - lib/glue/cache.rb
167
184
  - lib/glue/string.rb
168
- - lib/glue/hash.rb
169
- - lib/glue/logger.rb
185
+ - lib/glue/array.rb
186
+ - lib/og/backends
187
+ - lib/og/version.rb
188
+ - lib/og/connection.rb
189
+ - lib/og/mock.rb
190
+ - lib/og/meta.rb
191
+ - lib/og/backend.rb
192
+ - lib/og/backends/mysql.rb
193
+ - lib/og/backends/psql.rb
170
194
  - test/nitro
171
195
  - test/tc_og.rb
172
196
  - test/glue
173
- - test/nitro/tc_sitemap.rb
174
- - test/nitro/server
197
+ - test/og
198
+ - test/nitro/tc_uri.rb
175
199
  - test/nitro/tc_events.rb
176
- - test/nitro/ui
177
200
  - test/nitro/tc_http.rb
201
+ - test/nitro/ui
178
202
  - test/nitro/tc_html.rb
179
- - test/nitro/tc_uri.rb
180
- - test/nitro/server/tc_filters.rb
203
+ - test/nitro/server
204
+ - test/nitro/tc_sitemap.rb
205
+ - test/nitro/ui/tc_pager.rb
206
+ - test/nitro/server/tc_request.rb
207
+ - test/nitro/server/tc_session.rb
181
208
  - test/nitro/server/tc_requestpart.rb
209
+ - test/nitro/server/tc_filters.rb
182
210
  - test/nitro/server/tc_cookie.rb
183
- - test/nitro/server/tc_session.rb
184
- - test/nitro/server/tc_request.rb
185
- - test/nitro/ui/tc_pager.rb
186
- - test/glue/tc_cache.rb
211
+ - test/glue/tc_strings.rb
212
+ - test/glue/tc_property.rb
187
213
  - test/glue/tc_hash.rb
214
+ - test/glue/tc_property_mixins.rb
215
+ - test/glue/tc_cache.rb
188
216
  - test/glue/tc_numbers.rb
189
- - test/glue/tc_strings.rb
190
- - test/glue/tc_properties.rb
217
+ - test/og/tc_lifecycle.rb
218
+ - vendor/breakpoint_client.rb
219
+ - vendor/binding_of_caller.rb
220
+ - vendor/breakpoint_doc
221
+ - vendor/breakpoint.rb
222
+ - vendor/README
223
+ - vendor/breakpoint_doc/files
224
+ - vendor/breakpoint_doc/classes
225
+ - vendor/breakpoint_doc/files/breakpoint_rb.src
226
+ - vendor/breakpoint_doc/classes/Breakpoint
227
+ - vendor/breakpoint_doc/classes/Breakpoint.src
228
+ - vendor/breakpoint_doc/classes/Breakpoint/CommandBundle
229
+ - vendor/breakpoint_doc/classes/Breakpoint/CommandBundle.src
230
+ - vendor/breakpoint_doc/classes/Breakpoint/CommandBundle/Client.src
191
231
  test_files: []
192
232
  rdoc_options:
193
233
  - "--main"
@@ -195,13 +235,13 @@ rdoc_options:
195
235
  - "--title"
196
236
  - Nitro Documentation
197
237
  extra_rdoc_files:
238
+ - Rakefile
198
239
  - ChangeLog.1
240
+ - ChangeLog
241
+ - LICENSE
199
242
  - AUTHORS
200
243
  - RELEASES
201
- - LICENSE
202
244
  - README
203
- - ChangeLog
204
- - Rakefile
205
245
  executables: []
206
246
  extensions: []
207
247
  requirements: []