mongrel 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mongrel might be problematic. Click here for more details.

data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v1.0.4. Backport fixes for versioning inconsistency, mongrel_rails bug, and DirHandler bug.
3
+
2
4
  v1.0.3. Fix user-switching bug; make people upgrade to the latest from the RC.
3
5
 
4
6
  v1.0.2. Signed gem; many minor bugfixes and patches.
@@ -4,11 +4,15 @@
4
4
  # Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html
5
5
  # for more information.
6
6
 
7
- require 'rubygems'
8
7
  require 'yaml'
8
+ require 'etc'
9
+
10
+ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
9
11
  require 'mongrel'
10
12
  require 'mongrel/rails'
11
- require 'etc'
13
+
14
+ # require 'ruby-debug'
15
+ # Debugger.start
12
16
 
13
17
  module Mongrel
14
18
  class Start < GemPlugin::Plugin "/commands"
@@ -174,15 +178,14 @@ module Mongrel
174
178
 
175
179
  def config_keys
176
180
  @config_keys ||=
177
- %w(host port cwd log_file pid_file environment docroot mime_map daemon debug includes config_script
178
- num_processors timeout throttle user group prefix)
181
+ %w(address host port cwd log_file pid_file environment docroot mime_map daemon debug includes config_script num_processors timeout throttle user group prefix)
179
182
  end
180
183
 
181
184
  def settings
182
185
  config_keys.inject({}) do |hash, key|
183
186
  value = self.instance_variable_get("@#{key}")
184
187
  key = 'host' if key == 'address'
185
- hash[key.to_sym] = value
188
+ hash[key.to_sym] ||= value
186
189
  hash
187
190
  end
188
191
  end
@@ -571,7 +571,7 @@ void Init_http11()
571
571
  DEF_GLOBAL(server_protocol, "SERVER_PROTOCOL");
572
572
  DEF_GLOBAL(server_protocol_value, "HTTP/1.1");
573
573
  DEF_GLOBAL(http_host, "HTTP_HOST");
574
- DEF_GLOBAL(mongrel_version, "Mongrel 1.0.2");
574
+ DEF_GLOBAL(mongrel_version, "Mongrel 1.0.4");
575
575
  DEF_GLOBAL(server_software, "SERVER_SOFTWARE");
576
576
  DEF_GLOBAL(port_80, "80");
577
577
 
@@ -123,7 +123,7 @@ module Mongrel
123
123
  REQUEST_URI='REQUEST_URI'.freeze
124
124
  REQUEST_PATH='REQUEST_PATH'.freeze
125
125
 
126
- MONGREL_VERSION="1.0.2".freeze
126
+ MONGREL_VERSION="1.0.4".freeze
127
127
 
128
128
  MONGREL_TMP_BASE="mongrel".freeze
129
129
 
@@ -38,7 +38,7 @@ module Mongrel
38
38
  @@file_only_methods = ["GET","HEAD"]
39
39
 
40
40
  def initialize(klass)
41
- @files = Mongrel::DirHandler.new("/",false)
41
+ @files = Mongrel::DirHandler.new(nil, false)
42
42
  @guard = Mutex.new
43
43
  @klass = klass
44
44
  end
@@ -69,9 +69,11 @@ module Mongrel
69
69
  end
70
70
 
71
71
 
72
+ #
72
73
  # The server normally returns a 404 response if an unknown URI is requested, but it
73
74
  # also returns a lame empty message. This lets you do a 404 response
74
75
  # with a custom message for special URIs.
76
+ #
75
77
  class Error404Handler < HttpHandler
76
78
 
77
79
  # Sets the message to return. This is constructed once for the handler
@@ -87,24 +89,25 @@ module Mongrel
87
89
 
88
90
  end
89
91
 
90
-
92
+ #
91
93
  # Serves the contents of a directory. You give it the path to the root
92
94
  # where the files are located, and it tries to find the files based on
93
95
  # the PATH_INFO inside the directory. If the requested path is a
94
96
  # directory then it returns a simple directory listing.
95
97
  #
96
98
  # It does a simple protection against going outside it's root path by
97
- # converting all paths to an absolute expanded path, and then making sure
98
- # that the final expanded path includes the root path. If it doesn't
99
+ # converting all paths to an absolute expanded path, and then making
100
+ # sure that the final expanded path includes the root path. If it doesn't
99
101
  # than it simply gives a 404.
100
102
  #
101
103
  # If you pass nil as the root path, it will not check any locations or
102
- # expand any paths. This lets you serve files from multiple directories
104
+ # expand any paths. This lets you serve files from multiple drives
103
105
  # on win32.
104
106
  #
105
107
  # The default content type is "text/plain; charset=ISO-8859-1" but you
106
108
  # can change it anything you want using the DirHandler.default_content_type
107
109
  # attribute.
110
+ #
108
111
  class DirHandler < HttpHandler
109
112
  attr_accessor :default_content_type
110
113
  attr_reader :path
@@ -126,29 +129,27 @@ module Mongrel
126
129
  def can_serve(path_info)
127
130
 
128
131
  req_path = HttpRequest.unescape(path_info)
129
- if @path
130
- req_path = File.expand_path(File.join(@path, path_info), @path)
131
- else
132
- req_path = File.expand_path(req_path)
133
- end
134
-
135
- if req_path.index(@path) == 0 and File.exist? req_path
136
- # it exists and it's in the right location
132
+ # Add the drive letter or root path
133
+ req_path = File.join(@path, req_path) if @path
134
+ req_path = File.expand_path req_path
135
+
136
+ if File.exist? req_path
137
+ # It exists and it's in the right location
137
138
  if File.directory? req_path
138
- # the request is for a directory
139
+ # The request is for a directory
139
140
  index = File.join(req_path, @index_html)
140
141
  if File.exist? index
141
- # serve the index
142
+ # Serve the index
142
143
  return index
143
144
  elsif @listing_allowed
144
- # serve the directory
145
+ # Serve the directory
145
146
  return req_path
146
147
  else
147
- # do not serve anything
148
+ # Do not serve anything
148
149
  return nil
149
150
  end
150
151
  else
151
- # it's a file and it's there
152
+ # It's a file and it's there
152
153
  return req_path
153
154
  end
154
155
  else
@@ -1,16 +1,16 @@
1
1
 
2
- # Gem::Specification for Mongrel-1.0.3
2
+ # Gem::Specification for Mongrel-1.0.4
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{mongrel}
7
- s.version = "1.0.3"
7
+ s.version = "1.0.4"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Zed A. Shaw"]
13
- s.date = %q{2007-10-27}
13
+ s.date = %q{2007-10-29}
14
14
  s.default_executable = %q{mongrel_rails}
15
15
  s.description = %q{A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps.}
16
16
  s.email = %q{}
@@ -51,10 +51,6 @@ end
51
51
  # p.need_tar_gz = false
52
52
  # p.need_tgz = true
53
53
  #
54
- # case RUBY_PLATFORM
55
- # when /mswin/
56
- # else
57
- # end
58
54
  #
59
55
  # p.eval = proc do
60
56
  # case RUBY_PLATFORM
@@ -91,12 +87,8 @@ end
91
87
  # case RUBY_PLATFORM
92
88
  # when /mswin/
93
89
  # filename = "lib/http11.so"
94
- # file filename do
95
- # Dir.chdir("ext/http11") do
96
- # ruby "extconf.rb"
97
- # system(PLATFORM =~ /mswin/ ? 'nmake' : 'make')
98
- # end
99
- # move_extensions
90
+ # file filename do
91
+ # cp "#{filename}.win32", filename
100
92
  # end
101
93
  # task :compile => [filename]
102
94
  # end
@@ -148,7 +140,7 @@ end
148
140
  # sub_project("mongrel_console", :uninstall)
149
141
  # sub_project("gem_plugin", :uninstall)
150
142
  # sub_project("fastthread", :uninstall)
151
- # sub_project("mongrel_service", :install) if RUBY_PLATFORM =~ /mswin/
143
+ # sub_project("mongrel_service", :uninstall) if RUBY_PLATFORM =~ /mswin/
152
144
  # end
153
145
  #
154
146
  # desc "for Mongrel and all its subprojects"
@@ -178,7 +170,7 @@ end
178
170
  # FileList["**/*.tgz"].each {|tgz| mv tgz, "pkg/tars" }
179
171
  #
180
172
  # # XXX Hack, because only Luis can package for Win32 right now
181
- # sh "cp ~/Downloads/mongrel-1.0.2-mswin32.gem pkg/gems/"
173
+ # sh "cp ~/Downloads/mongrel-#{e.version}-mswin32.gem pkg/gems/"
182
174
  # sh "cp ~/Downloads/mongrel_service-0.3.3-mswin32.gem pkg/gems/"
183
175
  # sh "rm -rf pkg/mongrel*"
184
176
  # sh "gem generate_index -d pkg"
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4.6
3
3
  specification_version: 2
4
4
  name: mongrel
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.3
7
- date: 2007-10-27 00:00:00 -04:00
6
+ version: 1.0.4
7
+ date: 2007-10-29 00:00:00 -04:00
8
8
  summary: A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps.
9
9
  require_paths:
10
10
  - lib
metadata.gz.sig CHANGED
@@ -1,5 +1,2 @@
1
- �#pf͇�88Yg�Š��Xy�F�*(V��Ƞ :dpZ]��\W�m4=�?�BV9�Ro�X�)8��
2
- ��̀�:@w����^�W>�JUy�U�"Ђ����y\J[ ���>�U3E���P�s
3
-
4
- B:L%�|�H �v�����v|��5�m����?�]�<���^n�0�!���e=�nɻ� �~�J����}���#2F�K��cf���q�T,�36c3l �|
5
- �u�7os���K�#�`�Ķ�����
1
+ ѐgr�PǯH�+q-��it��tI@H�F�ƐՓE]ZrU�|�a4�i���Q��پ�q�M�W{��SZD"R�8�>�@ڨM�4��d�mH��L���5$ӞRr� a��;�.�xVK[��ٸ?E3hd$͜
2
+ K@�� ����\̖�K���,x�U����t�&������$ ��hu���1m:���$̾XA��� �