diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-06 02:04:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-06 02:04:28 +0000 |
commit | a566bc0a38d103baf4598b73ed94bcfe021f6216 (patch) | |
tree | f8fce07e0a947f81603c995289efe4c4e29f6219 /lib/uri/common.rb | |
parent | 48f9118253859969d0f300dcb13b84a99c2f5bd4 (diff) |
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
Diffstat (limited to 'lib/uri/common.rb')
-rw-r--r-- | lib/uri/common.rb | 21 |
1 files changed, 19 insertions, 2 deletions
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: |