[前][次][番号順一覧][スレッド一覧]

ruby-changes:38875

From: nobu <ko1@a...>
Date: Thu, 18 Jun 2015 22:58:45 +0900 (JST)
Subject: [ruby-changes:38875] nobu:r50956 (trunk): un.rb: cwd by default

nobu	2015-06-18 22:58:26 +0900 (Thu, 18 Jun 2015)

  New Revision: 50956

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50956

  Log:
    un.rb: cwd by default
    
    * lib/un.rb (httpd): set DocumentRoot to the current working
      directory by default.

  Modified files:
    trunk/lib/un.rb
Index: lib/un.rb
===================================================================
--- lib/un.rb	(revision 50955)
+++ lib/un.rb	(revision 50956)
@@ -320,10 +320,7 @@ def httpd https://github.com/ruby/ruby/blob/trunk/lib/un.rb#L320
       opt = options[name] and (options[name] = Integer(opt)) rescue nil
     end
     options[:Port] ||= 8080     # HTTP Alternate
-    unless argv.size == 1
-      raise ArgumentError, "DocumentRoot is mandatory"
-    end
-    options[:DocumentRoot] = argv.shift
+    options[:DocumentRoot] = argv.shift || '.'
     s = WEBrick::HTTPServer.new(options)
     shut = proc {s.shutdown}
     siglist = %w"TERM QUIT"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]