mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/un.rb (setup): fix of word splitting. [ruby-dev:41723]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e7ad51a53a
commit
eb6731dcc1
2 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
Fri Jun 25 05:49:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Jun 25 06:14:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/un.rb (setup): fix of word splitting. [ruby-dev:41723]
|
* lib/un.rb (setup): fix of word splitting. [ruby-dev:41723]
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,8 @@ def setup(options = "", *long_options)
|
||||||
long_options.each do |s|
|
long_options.each do |s|
|
||||||
opt_name, arg_name = s.split(/(?=[\s=])/, 2)
|
opt_name, arg_name = s.split(/(?=[\s=])/, 2)
|
||||||
opt_name.sub!(/\A--/, '')
|
opt_name.sub!(/\A--/, '')
|
||||||
s = "--#{opt_name.gsub(/([A-Za-z]+)([A-Z])/, '\1-\2').downcase}#{arg_name}"
|
s = "--#{opt_name.gsub(/([A-Z]+|[a-z])([A-Z])/, '\1-\2').downcase}#{arg_name}"
|
||||||
|
puts "#{opt_name}=>#{s}" if $DEBUG
|
||||||
opt_name = opt_name.intern
|
opt_name = opt_name.intern
|
||||||
o.on(s) do |val|
|
o.on(s) do |val|
|
||||||
opt_hash[opt_name] = val
|
opt_hash[opt_name] = val
|
||||||
|
@ -307,7 +308,9 @@ def httpd
|
||||||
|argv, options|
|
|argv, options|
|
||||||
require 'webrick'
|
require 'webrick'
|
||||||
opt = options[:RequestTimeout] and options[:RequestTimeout] = opt.to_i
|
opt = options[:RequestTimeout] and options[:RequestTimeout] = opt.to_i
|
||||||
opt = options[:Port] and (options[:Port] = Integer(opt)) rescue nil
|
[:Port, :MaxClients].each do |name|
|
||||||
|
opt = options[name] and (options[name] = Integer(opt)) rescue nil
|
||||||
|
end
|
||||||
unless argv.empty?
|
unless argv.empty?
|
||||||
options[:DocumentRoot] = argv.shift
|
options[:DocumentRoot] = argv.shift
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue