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 | |
parent | 48f9118253859969d0f300dcb13b84a99c2f5bd4 (diff) | |
download | ruby-a566bc0a38d103baf4598b73ed94bcfe021f6216.tar.gz |
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
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | lib/uri/common.rb | 21 |
2 files changed, 21 insertions, 3 deletions
@@ -1,6 +1,7 @@ Thu Oct 6 11:01:49 2016 Tieg Zaharia <tieg.zaharia@gmail.com> - + * 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@ruby-lang.org> 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: |