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

ruby-changes:49283

From: normal <ko1@a...>
Date: Fri, 22 Dec 2017 10:18:04 +0900 (JST)
Subject: [ruby-changes:49283] normal:r61402 (trunk): webrick/httputils: note Kernel#open behavior

normal	2017-12-22 10:08:05 +0900 (Fri, 22 Dec 2017)

  New Revision: 61402

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

  Log:
    webrick/httputils: note Kernel#open behavior
    
    I don't know who uses the load_mime_types method; but it is
    conceivable that a user would want to read the results of a
    command instead of reading a regular file to load MIME types.
    
    None of the WEBrick-related code in Ruby or default/bundled gems
    seems to rely on this method; but it is likely 3rd-party code does.
    
    * lib/webrick/httputils.rb (load_mime_types): note Kernel#open behavior
      [Misc #14216]

  Modified files:
    trunk/lib/webrick/httputils.rb
Index: lib/webrick/httputils.rb
===================================================================
--- lib/webrick/httputils.rb	(revision 61401)
+++ lib/webrick/httputils.rb	(revision 61402)
@@ -108,6 +108,8 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/httputils.rb#L108
     # Loads Apache-compatible mime.types in +file+.
 
     def load_mime_types(file)
+      # note: +file+ may be a "| command" for now; some people may
+      # rely on this, but currently we do not use this method by default.
       open(file){ |io|
         hash = Hash.new
         io.each{ |line|

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

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