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

ruby-changes:44284

From: nobu <ko1@a...>
Date: Thu, 6 Oct 2016 11:04:34 +0900 (JST)
Subject: [ruby-changes:44284] nobu:r56357 (trunk): uri/common.rb: Update URI::WEB_ENCODINGS_ [ci skip]

nobu	2016-10-06 11:04:28 +0900 (Thu, 06 Oct 2016)

  New Revision: 56357

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

  Log:
    uri/common.rb: Update URI::WEB_ENCODINGS_ [ci skip]
    
    * lib/uri/common.rb (WEB_ENCODINGS_): split command lines and
      append a trailing comma.

  Modified files:
    trunk/ChangeLog
    trunk/lib/uri/common.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 56356)
+++ ChangeLog	(revision 56357)
@@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
 Thu Oct  6 11:01:49 2016  Tieg Zaharia  <tieg.zaharia@g...>
 
-
+	* lib/uri/common.rb (WEB_ENCODINGS_): Update URI::WEB_ENCODINGS_
+	  hash, and fix documented command to grab it.  [Fix GH-1430]
 
 Thu Oct  6 10:37:13 2016  SHIBATA Hiroshi  <hsbt@r...>
 
Index: lib/uri/common.rb
===================================================================
--- lib/uri/common.rb	(revision 56356)
+++ lib/uri/common.rb	(revision 56357)
@@ -487,7 +487,24 @@ module URI https://github.com/ruby/ruby/blob/trunk/lib/uri/common.rb#L487
   end
 
   private
-  # curl https://encoding.spec.whatwg.org/encodings.json|ruby -rpp -rjson -e'H={};h={"shift_jis"=>"Windows-31J","euc-jp"=>"cp51932","iso-2022-jp"=>"cp50221","x-mac-cyrillic"=>"macCyrillic"};JSON($<.read).map{|x|x["encodings"]}.flatten.each{|x|Encoding.find(n=h.fetch(n=x["name"].downcase,n))rescue next;x["labels"].each{|y|H[y]=n}};pp H'
+=begin command for WEB_ENCODINGS_
+  curl https://encoding.spec.whatwg.org/encodings.json|
+  ruby -rjson -e 'H={}
+  h={
+    "shift_jis"=>"Windows-31J",
+    "euc-jp"=>"cp51932",
+    "iso-2022-jp"=>"cp50221",
+    "x-mac-cyrillic"=>"macCyrillic",
+  }
+  JSON($<.read).map{|x|x["encodings"]}.flatten.each{|x|
+    Encoding.find(n=h.fetch(n=x["name"].downcase,n))rescue next
+    x["labels"].each{|y|H[y]=n}
+  }
+  puts "{"
+  H.each{|k,v|puts %[  #{k.dump}=>#{v.dump},]}
+  puts "}"
+'
+=end
   WEB_ENCODINGS_ = {
     "unicode-1-1-utf-8"=>"utf-8",
     "utf-8"=>"utf-8",
@@ -693,7 +710,7 @@ module URI https://github.com/ruby/ruby/blob/trunk/lib/uri/common.rb#L710
     "windows-949"=>"euc-kr",
     "utf-16be"=>"utf-16be",
     "utf-16"=>"utf-16le",
-    "utf-16le"=>"utf-16le"
+    "utf-16le"=>"utf-16le",
   } # :nodoc:
 
   # :nodoc:

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

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