ruby-changes:16441
From: nobu <ko1@a...>
Date: Fri, 25 Jun 2010 06:17:17 +0900 (JST)
Subject: [ruby-changes:16441] Ruby:r28426 (trunk, ruby_1_9_2): * lib/un.rb (setup): fix of word splitting.
nobu 2010-06-25 06:15:33 +0900 (Fri, 25 Jun 2010) New Revision: 28426 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28426 Log: * lib/un.rb (setup): fix of word splitting. [ruby-dev:41723] Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/lib/un.rb trunk/ChangeLog trunk/lib/un.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 28425) +++ ChangeLog (revision 28426) @@ -1,4 +1,4 @@ -Fri Jun 25 05:49:14 2010 Nobuyoshi Nakada <nobu@r...> +Fri Jun 25 06:14:47 2010 Nobuyoshi Nakada <nobu@r...> * lib/un.rb (setup): fix of word splitting. [ruby-dev:41723] Index: lib/un.rb =================================================================== --- lib/un.rb (revision 28425) +++ lib/un.rb (revision 28426) @@ -45,7 +45,8 @@ long_options.each do |s| opt_name, arg_name = s.split(/(?=[\s=])/, 2) 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 o.on(s) do |val| opt_hash[opt_name] = val @@ -307,7 +308,9 @@ |argv, options| require 'webrick' 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? options[:DocumentRoot] = argv.shift end Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 28425) +++ ruby_1_9_2/ChangeLog (revision 28426) @@ -1,4 +1,4 @@ -Fri Jun 25 05:49:14 2010 Nobuyoshi Nakada <nobu@r...> +Fri Jun 25 06:14:47 2010 Nobuyoshi Nakada <nobu@r...> * lib/un.rb (setup): fix of word splitting. [ruby-dev:41723] Index: ruby_1_9_2/lib/un.rb =================================================================== --- ruby_1_9_2/lib/un.rb (revision 28425) +++ ruby_1_9_2/lib/un.rb (revision 28426) @@ -45,7 +45,8 @@ long_options.each do |s| opt_name, arg_name = s.split(/(?=[\s=])/, 2) 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 o.on(s) do |val| opt_hash[opt_name] = val @@ -307,7 +308,9 @@ |argv, options| require 'webrick' 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? options[:DocumentRoot] = argv.shift end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/