From c6ab1595cff4c59910b2f897d2fe3bb72892eed3 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 6 Oct 2016 02:04:28 +0000 Subject: uri/common.rb: Update URI::WEB_ENCODINGS_ [ci skip] * lib/uri/common.rb (WEB_ENCODINGS_): split command lines and append a trailing comma. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/uri/common.rb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'lib/uri') diff --git a/lib/uri/common.rb b/lib/uri/common.rb index a6ca3365a7..3fb1a6dbda 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -487,7 +487,24 @@ module URI 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 "windows-949"=>"euc-kr", "utf-16be"=>"utf-16be", "utf-16"=>"utf-16le", - "utf-16le"=>"utf-16le" + "utf-16le"=>"utf-16le", } # :nodoc: # :nodoc: -- cgit v1.2.3