nitro 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. data/CHANGELOG +124 -0
  2. data/README +2 -2
  3. data/Rakefile +4 -12
  4. data/bin/nitro +1 -1
  5. data/bin/nitrogen +47 -31
  6. data/doc/AUTHORS +3 -3
  7. data/doc/RELEASES +50 -1
  8. data/examples/README +7 -0
  9. data/lib/nitro.rb +5 -4
  10. data/lib/nitro/{adapters → adapter}/cgi.rb +2 -4
  11. data/lib/nitro/{adapters → adapter}/fastcgi.rb +1 -1
  12. data/lib/nitro/{adapters → adapter}/webrick.rb +5 -10
  13. data/lib/nitro/buffering.rb +6 -0
  14. data/lib/nitro/{builders → builder}/atom.rb +1 -5
  15. data/lib/nitro/{builders → builder}/form.rb +1 -5
  16. data/lib/nitro/{builders → builder}/rss.rb +3 -1
  17. data/lib/nitro/{builders → builder}/table.rb +2 -4
  18. data/lib/nitro/{builders → builder}/xhtml.rb +3 -5
  19. data/lib/nitro/{builders → builder}/xml.rb +2 -4
  20. data/lib/nitro/caching.rb +6 -4
  21. data/lib/nitro/caching/output.rb +18 -11
  22. data/lib/nitro/context.rb +3 -1
  23. data/lib/nitro/controller.rb +29 -18
  24. data/lib/nitro/dispatcher.rb +2 -4
  25. data/lib/nitro/element.rb +2 -0
  26. data/lib/nitro/environment.rb +2 -4
  27. data/lib/nitro/errors.rb +69 -0
  28. data/lib/nitro/mail.rb +2 -4
  29. data/lib/nitro/markup.rb +20 -3
  30. data/lib/nitro/output.rb +5 -9
  31. data/lib/nitro/part.rb +2 -3
  32. data/lib/nitro/render.rb +49 -30
  33. data/lib/nitro/request.rb +2 -1
  34. data/lib/nitro/runner.rb +23 -12
  35. data/lib/nitro/scaffold.rb +5 -3
  36. data/lib/nitro/service.rb +22 -0
  37. data/lib/nitro/service/xmlrpc.rb +42 -0
  38. data/lib/nitro/session.rb +2 -4
  39. data/lib/nitro/template.rb +8 -10
  40. data/lib/nitro/testing.rb +0 -4
  41. data/proto/public/error.xhtml +27 -2
  42. data/test/nitro/{adapters → adapter}/raw_post1.bin +0 -0
  43. data/test/nitro/{adapters → adapter}/tc_cgi.rb +1 -1
  44. data/test/nitro/{adapters → adapter}/tc_webrick.rb +1 -1
  45. data/test/nitro/{builders → builder}/tc_atom.rb +1 -1
  46. data/test/nitro/{builders → builder}/tc_rss.rb +1 -1
  47. data/test/nitro/{builders → builder}/tc_table.rb +1 -1
  48. data/test/nitro/{builders → builder}/tc_xhtml.rb +1 -1
  49. data/test/nitro/{builders → builder}/tc_xml.rb +1 -1
  50. data/test/nitro/tc_caching.rb +18 -0
  51. data/test/nitro/tc_controller.rb +1 -1
  52. data/test/nitro/tc_mail.rb +3 -1
  53. metadata +33 -168
  54. data/examples/README.windows +0 -9
  55. data/examples/ajax/controller.rb +0 -21
  56. data/examples/ajax/public/index.xhtml +0 -72
  57. data/examples/ajax/public/js/ajax.js +0 -64
  58. data/examples/ajax/run.rb +0 -14
  59. data/examples/blog/README +0 -70
  60. data/examples/blog/conf/apache.conf +0 -30
  61. data/examples/blog/conf/apache.conf.new +0 -53
  62. data/examples/blog/conf/lhttpd.conf +0 -79
  63. data/examples/blog/conf/locales/de.yml +0 -4
  64. data/examples/blog/conf/locales/en.yml +0 -4
  65. data/examples/blog/log/README +0 -3
  66. data/examples/blog/log/apache.error_log +0 -6647
  67. data/examples/blog/log/rewrite_log +0 -161
  68. data/examples/blog/public/base.xsl +0 -153
  69. data/examples/blog/public/fcgi.rb +0 -5
  70. data/examples/blog/public/m/bubbles.gif +0 -0
  71. data/examples/blog/public/m/comments_curve.gif +0 -0
  72. data/examples/blog/public/m/down.gif +0 -0
  73. data/examples/blog/public/m/footer_bg.gif +0 -0
  74. data/examples/blog/public/m/garrow.gif +0 -0
  75. data/examples/blog/public/m/gbull.gif +0 -0
  76. data/examples/blog/public/m/grbull.gif +0 -0
  77. data/examples/blog/public/m/h1_bg.gif +0 -0
  78. data/examples/blog/public/m/header_bg.gif +0 -0
  79. data/examples/blog/public/m/nitro.gif +0 -0
  80. data/examples/blog/public/m/obull.gif +0 -0
  81. data/examples/blog/public/m/page_bg.gif +0 -0
  82. data/examples/blog/public/m/rss.gif +0 -0
  83. data/examples/blog/public/m/side_title_bg.gif +0 -0
  84. data/examples/blog/public/m/sidebar_bg.gif +0 -0
  85. data/examples/blog/public/style.css +0 -305
  86. data/examples/blog/run.rb +0 -43
  87. data/examples/blog/src/blog.rb +0 -21
  88. data/examples/blog/src/controller.rb +0 -151
  89. data/examples/blog/src/mailer.rb +0 -23
  90. data/examples/blog/src/models/blog.rb +0 -33
  91. data/examples/blog/src/models/content.rb +0 -18
  92. data/examples/blog/src/views/blog_entry_email.xhtml +0 -16
  93. data/examples/blog/src/views/comments.xhtml +0 -36
  94. data/examples/blog/src/views/entry_form.xhtml +0 -22
  95. data/examples/blog/src/views/error.xhtml +0 -56
  96. data/examples/blog/src/views/index.xhtml +0 -49
  97. data/examples/blog/src/views/login.xhtml +0 -26
  98. data/examples/blog/src/views/recent_posts.xhtml +0 -14
  99. data/examples/blog/src/views/view_entry.xhtml +0 -37
  100. data/examples/blog/src/views/view_entry.xml +0 -12
  101. data/examples/blog/src/xsl/base.xsl +0 -160
  102. data/examples/blog/src/xsl/style.xsl +0 -143
  103. data/examples/blog/test/tc_blog.rb +0 -43
  104. data/examples/flash/log/README +0 -3
  105. data/examples/flash/root/index.xhtml +0 -16
  106. data/examples/flash/root/show_inline_text.xhtml +0 -17
  107. data/examples/flash/run.rb +0 -7
  108. data/examples/no_xsl_blog/README +0 -24
  109. data/examples/no_xsl_blog/conf/apache.conf +0 -30
  110. data/examples/no_xsl_blog/conf/lhttpd.conf +0 -79
  111. data/examples/no_xsl_blog/conf/locales/de.yml +0 -4
  112. data/examples/no_xsl_blog/conf/locales/en.yml +0 -4
  113. data/examples/no_xsl_blog/lib/blog.rb +0 -16
  114. data/examples/no_xsl_blog/lib/blog/controller.rb +0 -116
  115. data/examples/no_xsl_blog/lib/blog/model.rb +0 -35
  116. data/examples/no_xsl_blog/lib/blog/template.rb +0 -138
  117. data/examples/no_xsl_blog/lib/content.rb +0 -47
  118. data/examples/no_xsl_blog/log/README +0 -3
  119. data/examples/no_xsl_blog/log/apache.error_log +0 -473
  120. data/examples/no_xsl_blog/public/comments.xhtml +0 -36
  121. data/examples/no_xsl_blog/public/entry_form.xhtml +0 -22
  122. data/examples/no_xsl_blog/public/fcgi.rb +0 -5
  123. data/examples/no_xsl_blog/public/index.xhtml +0 -39
  124. data/examples/no_xsl_blog/public/login.xhtml +0 -21
  125. data/examples/no_xsl_blog/public/m/bubbles.gif +0 -0
  126. data/examples/no_xsl_blog/public/m/comments_curve.gif +0 -0
  127. data/examples/no_xsl_blog/public/m/down.gif +0 -0
  128. data/examples/no_xsl_blog/public/m/footer_bg.gif +0 -0
  129. data/examples/no_xsl_blog/public/m/garrow.gif +0 -0
  130. data/examples/no_xsl_blog/public/m/gbull.gif +0 -0
  131. data/examples/no_xsl_blog/public/m/grbull.gif +0 -0
  132. data/examples/no_xsl_blog/public/m/h1_bg.gif +0 -0
  133. data/examples/no_xsl_blog/public/m/header_bg.gif +0 -0
  134. data/examples/no_xsl_blog/public/m/nitro.gif +0 -0
  135. data/examples/no_xsl_blog/public/m/obull.gif +0 -0
  136. data/examples/no_xsl_blog/public/m/page_bg.gif +0 -0
  137. data/examples/no_xsl_blog/public/m/rss.gif +0 -0
  138. data/examples/no_xsl_blog/public/m/side_title_bg.gif +0 -0
  139. data/examples/no_xsl_blog/public/m/sidebar_bg.gif +0 -0
  140. data/examples/no_xsl_blog/public/recent_posts.xhtml +0 -14
  141. data/examples/no_xsl_blog/public/style.css +0 -299
  142. data/examples/no_xsl_blog/public/view_entry.xhtml +0 -25
  143. data/examples/no_xsl_blog/public/view_entry.xml +0 -12
  144. data/examples/no_xsl_blog/run.rb +0 -35
  145. data/examples/tiny/README +0 -14
  146. data/examples/tiny/conf/apache.conf +0 -30
  147. data/examples/tiny/conf/lhttpd.conf +0 -79
  148. data/examples/tiny/log/README +0 -3
  149. data/examples/tiny/log/apache.error_log +0 -154
  150. data/examples/tiny/public/deep/dir/hello.xhtml +0 -3
  151. data/examples/tiny/public/fcgi.rb +0 -5
  152. data/examples/tiny/public/include.xhtml +0 -3
  153. data/examples/tiny/public/index.xhtml +0 -55
  154. data/examples/tiny/public/nitro.png +0 -0
  155. data/examples/tiny/public/upload.xhtml +0 -21
  156. data/examples/tiny/run.rb +0 -7
  157. data/examples/wee_style/README +0 -10
  158. data/examples/wee_style/run.rb +0 -50
  159. data/examples/why_wiki/README +0 -5
  160. data/examples/why_wiki/run.rb +0 -59
  161. data/proto/public/js/ajax.js +0 -63
data/CHANGELOG CHANGED
@@ -1,5 +1,129 @@
1
+ 01-06-2005 George Moschovitis <gm@navel.gr>
2
+
3
+ * test/*: some fixes to make the tests pass again.
4
+
5
+ * fixed NASTY action_metadata bug.
6
+
7
+ 31-05-2005 George Moschovitis <gm@navel.gr>
8
+
9
+ * lib/nitro/render.rb (#redirect): fixed bug.
10
+
11
+ 30-05-2005 George Moschovitis <gm@navel.gr>
12
+
13
+ * doc/RELEASES: updated.
14
+
15
+ * lib/nitro/render.rb (#redirect): fixed to work with gecko.
16
+
17
+ * lib/nitro/runner.rb: fixed daemonize support.
18
+
19
+ 29-05-2005 George Moschovitis <gm@navel.gr>
20
+
21
+ * lib/nitro/caching: added global enable switch.
22
+
23
+ 27-05-2005 George Moschovitis <gm@navel.gr>
24
+
25
+ * lib/nitro/render.rb (#redirect): fixet to work behind a
26
+ proxy!
27
+
28
+ * lib/nitro/caching/output.rb (#expire_output): begin end block
29
+ to be more fault tolerant.
30
+
31
+ 26-05-2005 George Moschovitis <gm@navel.gr>
32
+
33
+ * lib/nitro/runner.rb (#daemonize): implemented.
34
+
35
+ * lib/nitro/caching/output.rb (#expire_output): introduced.
36
+
37
+ * lib/nitro/adapter/webrick.rb: fixed request_uri calc bug!
38
+
39
+ 25-05-2005 George Moschovitis <gm@navel.gr>
40
+
41
+ * lib/nitro/caching/output.rb: fixed filter problem.
42
+
43
+ * lib/nitro/markup.rb (MarkupShader): for the moment
44
+ a simple alias for RedCloth.
45
+
46
+ * lib/nitro/request.rb (#host): handle proxy case (forwarded).
47
+
48
+ * ../rpc: removed from repository.
49
+
50
+ * lib/nitro/service/xmlrpc.rb: copied from rpc.
51
+
52
+ * lib/nitro/service.rb: copied from rpc,
53
+ (Service): renamed from WebService.
54
+
55
+ 24-05-2005 George Moschovitis <gm@navel.gr>
56
+
57
+ * bin/nitrogen: the Dir.ls_r were copied to facets so this is
58
+ used.
59
+
60
+ * lib/examples/README: introduced.
61
+
62
+ 23-05-2005 George Moschovitis <gm@navel.gr>
63
+
64
+ * proto/public/error.xhtml: show exact error line in template.
65
+
66
+ * lib/nitro/errors.rb: better presentation,
67
+ reverse transform the code.
68
+
69
+ 22-05-2005 George Moschovitis <gm@navel.gr>
70
+
71
+ * lib/nitro/template.rb: improved template expansion, allows
72
+ for reverse transform (useful for error logging).
73
+
74
+ * lib/nitro/errors.rb: introduced,
75
+ (ActionCompileError): introduced,
76
+ (TemplateCompileError): introduced.
77
+ (#line_number): implemented.
78
+
79
+ * lib/nitro/render.rb (#compile_action): separately compile the
80
+ action and the template.
81
+
82
+ 21-05-2005 George Moschovitis <gm@navel.gr>
83
+
84
+ * changes to many files to accomodate some dir changes.
85
+
86
+ * lib/nitro/scaffold.rb: use tha facets inflector.
87
+
88
+ * lib/nitro/render.rb (#compile_action): also try to find
89
+ templates in the proto dir,
90
+ try to find templates in all superclasses of the controller.
91
+
92
+ * lib/nitro/controller.rb (#inherited): simplified,
93
+ set template root to point into proto in the default controller.
94
+
95
+ 20-05-2005 George Moschovitis <gm@navel.gr>
96
+
97
+ * moved examples outside of the nitro distribution.
98
+
99
+ * examples/flash/: fixed root dir. [gmary]
100
+
101
+ --- THE REVENGE OF SITH ---
102
+
103
+ 19-05-2005 George Moschovitis <gm@navel.gr>
104
+
105
+ * started fixing various references to the renamed directories.
106
+
107
+ * lib/nitro/part.rb: deprecated.
108
+
109
+ * lib/nitro/builder: renamed from builders.
110
+
111
+ * lib/nitro/adapter: renamed from adapters.
112
+
113
+ 17-05-2005 George Moschovitis <gm@navel.gr>
114
+
115
+ * lib/nitro/element.rb (#render): post proccesing to fix
116
+ elements with no text expansion problem.
117
+
118
+ * proto/src: added.
119
+
120
+ * bin/nitrogen: reimplemented, it now works with gems. The
121
+ implementation is based on mneumanns wee script [james_b].
122
+
1
123
  16-05-2005 George Moschovitis <gm@navel.gr>
2
124
 
125
+ * --- VERSION 0.17.0 ---
126
+
3
127
  * cleanup.rb: updated.
4
128
 
5
129
  * doc/RELEASES: updated.
data/README CHANGED
@@ -116,8 +116,8 @@ A short summary of the major features:
116
116
 
117
117
  * Multiple Platforms
118
118
 
119
- Runs on Linux and Windows. Has not been tested under MacOSX and
120
- other Unices.
119
+ Runs on Linux, Windows and Mac OSX. It will probably run on other
120
+ Unix based system with minor modifications.
121
121
 
122
122
  * Multiple Adapters
123
123
 
data/Rakefile CHANGED
@@ -1,7 +1,3 @@
1
- # * George Moschovitis <gm@navel.gr>
2
- # (c) 2004-2005 Navel, all rights reserved.
3
- # $Id$
4
-
5
1
  require 'rake/rdoctask'
6
2
  require 'rake/testtask'
7
3
  require 'rake/gempackagetask'
@@ -31,6 +27,8 @@ Homepage = "http://#{RubyForgeProject}.rubyforge.org/"
31
27
 
32
28
  task :default => :package
33
29
 
30
+ $NITRO_NO_ENVIRONMENT = true
31
+
34
32
  # Run the tests.
35
33
 
36
34
  Rake::TestTask.new do |t|
@@ -39,14 +37,6 @@ Rake::TestTask.new do |t|
39
37
  t.verbose = true
40
38
  end
41
39
 
42
- # Run all tests. (including expensive/depended tests)
43
-
44
- Rake::TestTask.new(:test_all) do |t|
45
- t.libs << 'test'
46
- t.test_files = FileList['test/**/tc*.rb']
47
- t.verbose = true
48
- end
49
-
50
40
  # Generate RDoc documentation.
51
41
 
52
42
  Rake::RDocTask.new do |rd|
@@ -233,3 +223,5 @@ task :publish => [:package] do
233
223
  end
234
224
  end
235
225
  end
226
+
227
+ # * George Moschovitis <gm@navel.gr>
data/bin/nitro CHANGED
@@ -8,5 +8,5 @@ if File.exist?('run.rb')
8
8
  system('ruby -rubygems run.rb')
9
9
  else
10
10
  puts 'No application found, starting default application.'
11
- system('ruby -rubygems ' + File.join(Nitro::LibPath, '..', 'proto', 'run.rb'))
11
+ system 'ruby -rubygems ' + File.join(Nitro::LibPath, '..', 'proto', 'run.rb')
12
12
  end
data/bin/nitrogen CHANGED
@@ -1,44 +1,60 @@
1
- #! /usr/bin/env ruby
2
-
3
- # * George Moschovitis <gm@navel.gr>
4
- # (c) 2004-2005 Navel, all rights reserved.
5
- # $Id$
6
-
7
- require 'fileutils'
8
-
9
- $NITRO_NO_ENVIRONMENT = true
1
+ #!/usr/bin/env ruby
10
2
 
11
3
  require 'nitro'
4
+ require 'ftools'
12
5
 
13
- # gmosx, TODO: move to a library
6
+ require 'facet/dir/recurse'
14
7
 
15
- def ll_r(path, &block)
16
- Dir.foreach(path) do |f|
17
- next if [".", ".."].include?(f)
18
- fullname = path + "/" + f
19
- yield(fullname)
20
- ll_r(fullname, &block) if FileTest.directory?fullname and not FileTest.symlink?fullname
21
- end
22
- end
8
+ PROTO_DIR = File.join(Nitro::LibPath, '..', 'proto')
23
9
 
24
- proto_dir = File.join(Nitro::LibPath, '..', 'proto')
10
+ def usage
11
+ puts <<-USAGE
25
12
 
26
- if base_dir = ARGV[0]
13
+ NAME
14
+ nitrogen - frontend for the Nitro generator mechanism.
27
15
 
28
- # remove the trailing '/' if it exists.
16
+ SYNOPSIS
17
+ nitrogen app [full path]
29
18
 
30
- base_dir = base_dir.gsub(/\/$/, '')
19
+ DESCRIPTION
20
+ This is a frontend to the Nitro generator mechanism. Nitro
21
+ generators are used to 'bootstrap' development by creating
22
+ a standard directory structure and files for common tasks.
23
+
24
+ app: This will create some basic files to get you
25
+ started fleshing out your Nitro web application.
31
26
 
32
- # the following code is win32 compatible.
27
+ EXAMPLE
28
+ nitrogen app ~/my_application
33
29
 
34
- FileUtils.cp_r proto_dir, base_dir
35
- ll_r(base_dir) { |f| FileUtils.rm_rf(f) if /\.svn$/ =~ f }
30
+ This will generate a new Nitro application in the
31
+ ~/my_application folder.
32
+ USAGE
33
+ exit 1
34
+ end
36
35
 
37
- else
36
+ def run
37
+ case command = ARGV[0] || usage()
38
+ when 'app'
39
+ path = ARGV[1] || usage()
40
+ path = File.expand_path(path)
41
+
42
+ if File.exists?(path)
43
+ STDERR.puts "ERROR: Path #{path} already exists! Aborting!"
44
+ exit 1
45
+ end
46
+
47
+ FileUtils.cp_r(PROTO_DIR, path)
48
+
49
+ Dir.recurse(path) do |f|
50
+ FileUtils.rm_rf(f) if /\.svn$/ =~ f
51
+ end
52
+
53
+ else
54
+ usage()
55
+ end
56
+ end
38
57
 
39
- puts %{
40
- USAGE:
41
- nitrogen base_dir
42
- }
58
+ run
43
59
 
44
- end
60
+ # This script is based on Michael Neumann's Wee creator script.
data/doc/AUTHORS CHANGED
@@ -6,11 +6,11 @@ MAIN DEVELOPER:
6
6
 
7
7
  IDEAS, ADDITIONAL CODING, SUPPORT:
8
8
 
9
- * Anastasios Koutoumanos <ak@navel.gr>
9
+ * Anastasios Koutoumanos <ak@navel.gr>
10
10
  Design, additional coding.
11
11
 
12
- * James Britt <james_b@neurogami.com>
12
+ * James Britt <james_b@neurogami.com>
13
13
  Additional code, design, bug reports.
14
14
 
15
- * Kostas Nasis <kostas@nasis.com>
15
+ * Kostas Nasis <kostas@nasis.com>
16
16
  Ideas and bug reports.
data/doc/RELEASES CHANGED
@@ -1,4 +1,53 @@
1
- == Version 0.17.0
1
+ == Version 0.18.0
2
+
3
+ Mainly a bug fix release. Many small improvements were
4
+ implemented. All reported bugs were fixed, as well as bugs found
5
+ during the deployment of a live application. For more information
6
+ consult the detailed changelog. Thanks to Julien Perrot for small
7
+ patches.
8
+
9
+ Some notable changes:
10
+
11
+ * Some changes to make Webrick a valid solution for powering
12
+ a production server. The full page output caching was improved
13
+ and support for daemonizing the server was added. Support
14
+ for running as a proxy target (behind an apache server) was also
15
+ added.
16
+
17
+ * Thread safe mode was added again in Og. This works nice with
18
+ the Webrick server.
19
+
20
+ * New order macro in Og to set default ordering for each
21
+ entity. The has_many collections respects the order setting.
22
+
23
+ * Improved error reporting.
24
+
25
+ * Support for template_root overloading. Lets say you have
26
+ the following Controller hierarchy:
27
+
28
+ Controller > MyController > SpecificController.
29
+
30
+ The template roots of the 3 controller are searched in reverse
31
+ order. So by adding a template file in the SpecificController
32
+ template root you can override a default action in the base
33
+ Controller. For convienience the base Controller points to
34
+ the Proto directory. This is experimental.
35
+
36
+ * Provide the examples as a separate distribution to make it
37
+ easier for Ruby newbies to find them.
38
+
39
+ * Bug fixes in the Elements system.
40
+
41
+ * Improved the nitrogen generator command. Just run
42
+
43
+ nitrogen app ~/the/target/path
44
+
45
+ to create a skeleton application.
46
+
47
+ * Cleaned up some source files.
48
+
49
+
50
+ == Version 0.17.0 was released on 16/05/2005.
2
51
 
3
52
  The biggest release yet, featuring the brand new implementation
4
53
  of Og. Due to the many changes this should be considered a preview
data/examples/README ADDED
@@ -0,0 +1,7 @@
1
+ = Examples
2
+
3
+ You can find a separate distribution of Nitro examples
4
+ on the project download page:
5
+
6
+ http://rubyforge.org/projects/nitro
7
+
data/lib/nitro.rb CHANGED
@@ -25,7 +25,7 @@ module Nitro
25
25
 
26
26
  # The version.
27
27
 
28
- Version = '0.17.0'
28
+ Version = '0.18.0'
29
29
 
30
30
  # Library path.
31
31
 
@@ -36,11 +36,12 @@ end
36
36
  # gmosx: leave them here.
37
37
 
38
38
  require 'nitro/context'
39
+ require 'nitro/controller'
39
40
  require 'nitro/dispatcher'
40
41
  require 'nitro/render'
41
42
  require 'nitro/conf'
42
- require 'nitro/runner'
43
- require 'nitro/controller'
44
- require 'nitro/part'
45
43
 
44
+ require 'nitro/runner'
46
45
  require 'nitro/environment' unless $NITRO_NO_ENVIRONMENT
46
+
47
+ # * George Moschovitis <gm@navel.gr>
@@ -1,7 +1,5 @@
1
- # * George Moschovitis <gm@navel.gr>
2
- # * James Britt <james_b@neurogami.com>
3
- # (c) 2005 Navel, all rights reserved.
4
- # $Id: cgi.rb 41 2005-05-05 14:56:40Z gmosx $
1
+ # * George Moschovitis <gm@navel.gr>
2
+ # * James Britt <james_b@neurogami.com>
5
3
 
6
4
  require 'cgi'
7
5
  require 'stringio'
@@ -3,7 +3,7 @@ require 'fcgi'
3
3
 
4
4
  require 'nitro/context'
5
5
  require 'nitro/dispatcher'
6
- require 'nitro/adapters/cgi'
6
+ require 'nitro/adapter/cgi'
7
7
 
8
8
  require 'glue/flexob'
9
9
 
@@ -1,7 +1,3 @@
1
- # * George Moschovitis <gm@navel.gr>
2
- # (c) 2004-2005 Navel, all rights reserved.
3
- # $Id: webrick.rb 41 2005-05-05 14:56:40Z gmosx $
4
-
5
1
  require 'webrick'
6
2
  require 'stringio'
7
3
 
@@ -102,9 +98,6 @@ class WebrickAdapter < WEBrick::HTTPServlet::AbstractServlet
102
98
  begin
103
99
  path = req.request_uri.path
104
100
 
105
- # gmosx, TODO: move this into a filter.
106
- # Og.db.get_connection if defined?(Og) and Og.db
107
-
108
101
  # REQUEST_MUTEX.lock
109
102
 
110
103
  context = Context.new(@conf)
@@ -115,7 +108,7 @@ class WebrickAdapter < WEBrick::HTTPServlet::AbstractServlet
115
108
  req.header.each { |h, v| context.headers[h.upcase] = v.first }
116
109
  context.headers.update(req.meta_vars)
117
110
  # gmosx: make compatible with fastcgi.
118
- context.headers['REQUEST_URI'].slice!(/http:\/\/(.*)\//)
111
+ context.headers['REQUEST_URI'].slice!(/http:\/\/(.*?)\//)
119
112
  context.headers['REQUEST_URI'] << '/'
120
113
 
121
114
  CgiUtils.parse_params(context)
@@ -131,7 +124,7 @@ class WebrickAdapter < WEBrick::HTTPServlet::AbstractServlet
131
124
  context.close
132
125
  ensure
133
126
  # REQUEST_MUTEX.unlock if REQUEST_MUTEX.locked?
134
- # Og.db.put_connection if defined?(Og) and Og.db
127
+ Og.manager.put_store if defined?(Og) and Og.manager
135
128
  end
136
129
  end
137
130
  end
@@ -146,7 +139,7 @@ class WebrickAdapter < WEBrick::HTTPServlet::AbstractServlet
146
139
  if req.path == '/'
147
140
  req.instance_variable_set(:@path_info, '/index.html')
148
141
  elsif req.path =~ /^([^.]+)$/
149
- req.instance_variable_set(:@path_info, "#{$1}.html")
142
+ req.instance_variable_set(:@path_info, "#{$1}/index.html")
150
143
  end
151
144
  end
152
145
 
@@ -162,3 +155,5 @@ class WebrickAdapter < WEBrick::HTTPServlet::AbstractServlet
162
155
  end
163
156
 
164
157
  end
158
+
159
+ # * George Moschovitis <gm@navel.gr>