From a770e1c1d27f3a451a11a2c7c6c24af86785c1d0 Mon Sep 17 00:00:00 2001 From: Reed Loden Date: Fri, 24 Jun 2016 18:30:21 +0200 Subject: [PATCH 0001/3171] Ruby now uses HackerOne for managing incoming security vuln reports Update security documentation to point to https://hackerone.com/ruby. --- en/security/index.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/en/security/index.md b/en/security/index.md index 3d34f46133..6cfadb7854 100644 --- a/en/security/index.md +++ b/en/security/index.md @@ -9,9 +9,21 @@ Here you will find information about security issues of Ruby. ## Reporting Security Vulnerabilities -Security vulnerabilities should be reported via an email to -security@ruby-lang.org ([the PGP public key](/security.asc)), which is a -private mailing list. Reported problems will be published after fixes. +Security vulnerabilities in the Ruby programming language should be +reported through our [bounty program page at +HackerOne](https://hackerone.com/ruby). Please ensure you read the +specific details around the scope of our program before reporting +an issue. Any valid reported problems will be published after fixes. + +If you have found an issue affecting one of our websites, please +report it [via GitHub](https://github.com/ruby/www.ruby-lang.org/issues/new). + +If you have found an issue that affects a specific Ruby gem, follow the +[instructions on RubyGems.org](http://guides.rubygems.org/security/#reporting-security-vulnerabilities). + +If you need to get in touch with the security team directly outside +of HackerOne, you can send email to security@ruby-lang.org +([the PGP public key](/security.asc)), which is a private mailing list. The members of the mailing list are people who provide Ruby (Ruby committers and authors of other Ruby implementations, From dfa2792d113afcc6c327c0f9f111f65d07754e6d Mon Sep 17 00:00:00 2001 From: David Padilla Date: Sat, 2 Jul 2016 00:29:15 -0500 Subject: [PATCH 0002/3171] Translate Ruby 2.4.0-preview1 release (es) (#1423) --- ...2016-06-20-ruby-2-4-0-preview1-released.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 es/news/_posts/2016-06-20-ruby-2-4-0-preview1-released.md diff --git a/es/news/_posts/2016-06-20-ruby-2-4-0-preview1-released.md b/es/news/_posts/2016-06-20-ruby-2-4-0-preview1-released.md new file mode 100644 index 0000000000..8ab9e197e7 --- /dev/null +++ b/es/news/_posts/2016-06-20-ruby-2-4-0-preview1-released.md @@ -0,0 +1,118 @@ +--- +layout: news_post +title: "Liberada la versión 2.4.0-preview1 de Ruby" +author: "naruse" +translator: David Padilla +date: 2016-06-20 18:00:00 +0900 +lang: es +--- + +Nos complace anunciar la entrega de Ruby 2.4.0-preview1. + +Esta versión es la primera vista previa a Ruby 2.4.0 y ha sido liberada antes +de lo usual porque incluye muchas mejoras y características nuevas. + +Por favor no olvides enviar [tus comentarios](https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport) +ya que aún estamos a buen tiempo de hacer cambios. + +## [Integrar Fixnum y Bignum en Integer](https://bugs.ruby-lang.org/issues/12005) + +A pesar de que en [ISO/IEC 30170:2012](http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579) +no se especifican los detalles de la clase Integer, +CRuby tiene dos clases de Integer visibles: Fixnum y Bignum. + +Ruby 2.4 unifica ambas en la clase Integer. + +## [Soporte en String de el empate de mayúsculas y minúsculas en caracteres Unicode](https://bugs.ruby-lang.org/issues/10085) + +La función `String/Symbol#upcase/downcase/swapcase/capitalize(!)` ahora puede +empatar mayúsculas y minúsculas de caracteres Unicode y no solo de caracteres ASCII. + +## Mejoras en el desempeño + +Ruby 2.4 también incluye las siguientes mejoras en el desempeño que incluye +algunos cambios en el lenguaje: + +### [Array#max, Array#min](https://bugs.ruby-lang.org/issues/12172) + +`[x, y].max` y `[x, y].min` han sido optimizados para no crear arreglos temporales +bajo ciertas circunstancias. + +### [Regexp#match?](https://bugs.ruby-lang.org/issues/8110) + +Se agregó `Regexp#match?`, que ejecuta la expresión regular sin crear una +referencia al objeto y mejora `$~` para reducir la creación de objetos innecesarios. + +### Otras mejoras en el desempeño + +* [acelerar el acceso a variables de instancia](https://bugs.ruby-lang.org/issues/12274) + +## Depuración + +### [Thread#report_on_exception y Thread.report_on_exception](https://bugs.ruby-lang.org/issues/6647) + +Ruby ignora las excepciones en threads a menos que otro thread se una explicitamente +a ese thread. + +Con `report_on_exception = true`, puedes darte cuenta si un thread se murió +debido a alguna excepción que no fue manejada adecuadamente. + +Por favor envía tu opinión acerca de cual debería ser el valor por defecto de +`report_on_exception` y de `report-on-GC`. + +### [La detección de puntos muertos en Thread ahora muestra los threads con sus dependencias y su traza inversa](https://bugs.ruby-lang.org/issues/8214) + +Ruby tiene detección de puntos muertos en threads, pero el reporte no incluye +suficiente información para depurar el error. + +La detección de puntos muertos en Ruby 2.4 ahora muestra los threads con su +traza inversa y los threads dependientes. + +Esperamos que disfrutes programar con Ruby 2.4.0-preview1 y no olvides +[enviar tus comentarios](https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport)! + +## Cambios significantes desde 2.3 + +Puedes ver [NOTICIAS](https://github.com/ruby/ruby/blob/v2_4_0_preview1/NEWS) +y la [Bitácora de cambios](https://github.com/ruby/ruby/blob/v2_4_0_preview1/ChangeLog) +para más detalles. + +Con estos cambios, +[1140 archivos cambiaron, 33126 inserciones(+), 50993 supresiones(-)](https://github.com/ruby/ruby/compare/v2_3_0...v2_4_0_preview1) +desde Ruby 2.3.0! + +## Descarga + +* + + * SIZE: 14108114 bytes + * SHA1: 7dcc42548d0724d83b6589ab98f34282845d7bcd + * SHA256: 17570f0b84215ca82252f10c167ee50bc075383c018420c6b2601ae1cade0649 + * SHA512: c9873e8686eb54dbde61d6e23cd5197beebccd6cb31fd12c82763ebe1fde17095d7514d9d93c2c82b238032c98691df5479dc2d666a8a590e0fc54450ec29cb5 + +* + + * SIZE: 17605452 bytes + * SHA1: 1003a1e57547d81f4bb979c0f40f242afc284cd5 + * SHA256: 80d02f49f40e7ce07b70bee7efda751b0595a349a017306e9fe8caad5da13e64 + * SHA512: 4b603ab4ff9ea7e8bb8053aa4b638839d534241466d7f0e4d5bca3f2ea416694c2ea391790f1ffdc07fa538918d27707621741eb0ddc7bd00eb9d7628622787a + +* + + * SIZE: 11155800 bytes + * SHA1: bc33085277266f5a09a143bf6817affcb77f8e7f + * SHA256: 62942c7300727469fe3d2b43e5a5c772d4836cf624a1d644bdece2afaca472c8 + * SHA512: dfc2c6642d49fa95383817a6dc82c416b3218ddfdaf882d6d2e5a7da22d0a5ac142e516a57aa96214070f3c7551d275044233ac052c82d67189b01c39847aad4 + +* + + * SIZE: 19904781 bytes + * SHA1: 25c16ee91bbcb0224f80e20d938f5c08832973f7 + * SHA256: fd588aea1558b1171f87a3dd342ee207b8995a2c0a8241d7aa15bcfa16036854 + * SHA512: f2fff35ff9157a4b31177b3d6b91bdaad04c22b3c626c3a5e5ec9a31b103f9607b31c909ef27880065cfdbcfa5d6901a6db89d22e0c645666d069c5b6dd1818b + +## Comentarios de la entrega + +Puedes ver la agenda de las entregas y otra información en: + +[ReleaseEngineering24](https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/ReleaseEngineering24) From 75928b6db3f11b5ef207838353884ea65c7ffbfc Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 6 Jul 2016 12:48:20 +0900 Subject: [PATCH 0003/3171] bundle update --- Gemfile.lock | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b85cf6253d..6294a401cb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,8 +2,8 @@ GEM remote: https://rubygems.org/ specs: colorator (0.1) - ffi (1.9.10) - jekyll (3.1.5) + ffi (1.9.12) + jekyll (3.1.6) colorator (~> 0.1) jekyll-sass-converter (~> 1.0) jekyll-watch (~> 1.1) @@ -26,11 +26,13 @@ GEM rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) mercenary (0.3.6) - mini_portile2 (2.0.0) + mini_portile2 (2.1.0) multipart_body (0.2.1) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) + nokogiri (1.6.8) + mini_portile2 (~> 2.1.0) + pkg-config (~> 1.1.7) paint (0.9.0) + pkg-config (1.1.7) rack (1.6.4) rack-protection (1.5.3) rack @@ -42,7 +44,7 @@ GEM rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) - rouge (1.10.1) + rouge (1.11.1) safe_yaml (1.0.4) sass (3.4.22) spidr (0.5.0) @@ -74,4 +76,4 @@ RUBY VERSION ruby 2.3.1p112 BUNDLED WITH - 1.12.3 + 1.12.5 From 5a7b6e76b0d1146cf1382f753483534414ec35df Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Thu, 7 Jul 2016 20:54:42 +0200 Subject: [PATCH 0004/3171] Rewrap --- en/security/index.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/en/security/index.md b/en/security/index.md index 6cfadb7854..f5bf38591b 100644 --- a/en/security/index.md +++ b/en/security/index.md @@ -10,10 +10,11 @@ Here you will find information about security issues of Ruby. ## Reporting Security Vulnerabilities Security vulnerabilities in the Ruby programming language should be -reported through our [bounty program page at -HackerOne](https://hackerone.com/ruby). Please ensure you read the -specific details around the scope of our program before reporting -an issue. Any valid reported problems will be published after fixes. +reported through our +[bounty program page at HackerOne](https://hackerone.com/ruby). +Please ensure you read the specific details around the scope of +our program before reporting an issue. Any valid reported problems +will be published after fixes. If you have found an issue affecting one of our websites, please report it [via GitHub](https://github.com/ruby/www.ruby-lang.org/issues/new). From 76d0162bbde011a62009fdc84eafcf095018890f Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Thu, 7 Jul 2016 20:55:11 +0200 Subject: [PATCH 0005/3171] Small fixes in news post (es) --- .../_posts/2016-06-20-ruby-2-4-0-preview1-released.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/es/news/_posts/2016-06-20-ruby-2-4-0-preview1-released.md b/es/news/_posts/2016-06-20-ruby-2-4-0-preview1-released.md index 8ab9e197e7..366e742edf 100644 --- a/es/news/_posts/2016-06-20-ruby-2-4-0-preview1-released.md +++ b/es/news/_posts/2016-06-20-ruby-2-4-0-preview1-released.md @@ -2,7 +2,7 @@ layout: news_post title: "Liberada la versión 2.4.0-preview1 de Ruby" author: "naruse" -translator: David Padilla +translator: "David Padilla" date: 2016-06-20 18:00:00 +0900 lang: es --- @@ -11,8 +11,8 @@ Nos complace anunciar la entrega de Ruby 2.4.0-preview1. Esta versión es la primera vista previa a Ruby 2.4.0 y ha sido liberada antes de lo usual porque incluye muchas mejoras y características nuevas. - -Por favor no olvides enviar [tus comentarios](https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport) +Por favor no olvides enviar +[tus comentarios](https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport) ya que aún estamos a buen tiempo de hacer cambios. ## [Integrar Fixnum y Bignum en Integer](https://bugs.ruby-lang.org/issues/12005) @@ -20,7 +20,6 @@ ya que aún estamos a buen tiempo de hacer cambios. A pesar de que en [ISO/IEC 30170:2012](http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579) no se especifican los detalles de la clase Integer, CRuby tiene dos clases de Integer visibles: Fixnum y Bignum. - Ruby 2.4 unifica ambas en la clase Integer. ## [Soporte en String de el empate de mayúsculas y minúsculas en caracteres Unicode](https://bugs.ruby-lang.org/issues/10085) @@ -53,7 +52,6 @@ referencia al objeto y mejora `$~` para reducir la creación de objetos innecesa Ruby ignora las excepciones en threads a menos que otro thread se una explicitamente a ese thread. - Con `report_on_exception = true`, puedes darte cuenta si un thread se murió debido a alguna excepción que no fue manejada adecuadamente. @@ -64,7 +62,6 @@ Por favor envía tu opinión acerca de cual debería ser el valor por defecto de Ruby tiene detección de puntos muertos en threads, pero el reporte no incluye suficiente información para depurar el error. - La detección de puntos muertos en Ruby 2.4 ahora muestra los threads con su traza inversa y los threads dependientes. From 4b31e741fcfdba7689c9a60d0ff0402b241717b2 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Fri, 8 Jul 2016 04:02:06 +0900 Subject: [PATCH 0006/3171] Fix channel in link (#1422) --- ja/community/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ja/community/index.md b/ja/community/index.md index ee650de4e0..27cc3c08d8 100644 --- a/ja/community/index.md +++ b/ja/community/index.md @@ -31,7 +31,7 @@ Rubyコミュニティに興味があるのなら、ぜひ以下のコミュニ ## IRC -* IRCNetの[#ruby-ja](irc://irc.ircnet.ne.jp/%23ruby:*.jp?charset=iso-2022-jp) +* IRCNetの[#ruby-ja](irc://irc.ircnet.ne.jp/%23ruby-ja?charset=iso-2022-jp) * Rubyの開発用兼、簡単な質疑応答用のチャンネルです。 * ここでのログは公開する事ができます。 * 従来の#ruby:\*.jpとは違い、日本サーバーに接続しなくとも参加できるので、海外からの参加敷居が低くなっています。 From 47935c23dccf9e536c2a18d63ada58b54c89496f Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Fri, 8 Jul 2016 04:10:29 +0900 Subject: [PATCH 0007/3171] should be before (#1421) see https://code.google.com/archive/p/doctype-mirror/wikis/MetaCharsetAttribute.wiki --- _layouts/default.html | 3 ++- index.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 1aa504f748..603c5eea3c 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,13 +1,14 @@ <!DOCTYPE html> <html> <head> + <meta charset="utf-8"> + {% if page.title != null %} <title>{{ page.title }} {% else %} Ruby Programming Language {% endif %} - diff --git a/index.html b/index.html index 2eae11f9be..c5966bf502 100644 --- a/index.html +++ b/index.html @@ -1,8 +1,8 @@ - Ruby Programming Language + Ruby Programming Language From f2bf13ee6189fa4b9f033d5f2f3f3ac48b73b452 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 4 Mar 2019 11:10:41 +0900 Subject: [PATCH 1000/3171] update bundles --- Gemfile.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 594fb99a4e..57df945052 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,16 +1,16 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.5.2) + addressable (2.6.0) public_suffix (>= 2.0.2, < 4.0) colorator (1.1.0) - concurrent-ruby (1.1.3) + concurrent-ruby (1.1.4) crass (1.0.4) em-websocket (0.5.1) eventmachine (>= 0.12.9) http_parser.rb (~> 0.6.0) eventmachine (1.2.7) - ffi (1.9.25) + ffi (1.10.0) forwardable-extended (2.6.0) http_parser.rb (0.6.0) i18n (0.9.5) @@ -32,7 +32,7 @@ GEM sass (~> 3.4) jekyll-watch (2.1.2) listen (~> 3.0) - json (2.1.0) + json (2.2.0) kgio (2.11.2) kramdown (1.17.0) lanyon (0.4.0) @@ -44,29 +44,29 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) mercenary (0.3.6) - mini_portile2 (2.3.0) + mini_portile2 (2.4.0) minitest (5.11.3) - nokogiri (1.8.5) - mini_portile2 (~> 2.3.0) - paint (1.0.1) + nokogiri (1.10.1) + mini_portile2 (~> 2.4.0) + paint (2.1.0) pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (3.0.3) rack (2.0.6) - rack-protection (2.0.4) + rack-protection (2.0.5) rack rack-rewrite (1.5.1) rack-ssl (1.4.1) rack raindrops (0.19.0) - rake (12.3.1) + rake (12.3.2) rb-fsevent (0.10.3) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) + rb-inotify (0.10.0) + ffi (~> 1.0) rouge (1.11.1) ruby_dep (1.5.0) - safe_yaml (1.0.4) - sass (3.7.1) + safe_yaml (1.0.5) + sass (3.7.3) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) @@ -74,18 +74,18 @@ GEM slop (4.6.2) spidr (0.6.0) nokogiri (~> 1.3) - sq_mini_racer (0.2.3.sqreen4) - sqreen (1.15.3) - sq_mini_racer (~> 0.2.2.sqreen1) + sq_mini_racer (0.2.4.sqreen2) + sqreen (1.16.2) + sq_mini_racer (~> 0.2.4.sqreen2) tidy_ffi (0.1.6) ffi (~> 1.2) - unicorn (5.4.1) + unicorn (5.5.0) kgio (~> 2.6) raindrops (~> 0.7) - validate-website (1.8.1) + validate-website (1.9.0) crass (~> 1) - paint (~> 1) - slop (~> 4.2) + paint (~> 2) + slop (~> 4.6) spidr (~> 0.6) tidy_ffi (~> 0.1) w3c_validators (~> 1.3) @@ -114,4 +114,4 @@ RUBY VERSION ruby 2.5.1p57 BUNDLED WITH - 1.17.1 + 1.17.3 From d0cbdb32665864929c618ac1c80e223af31250c3 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Mon, 4 Mar 2019 11:22:18 +0900 Subject: [PATCH 1001/3171] Revive YAML front matter to enable liquid tags again. This partially reverts 2c8ff6b80a1d8fb2b8b86e38996fdd7e6b8c491d. --- admin/translation-status/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/translation-status/index.html b/admin/translation-status/index.html index 9d6886602f..bcf3c819e7 100644 --- a/admin/translation-status/index.html +++ b/admin/translation-status/index.html @@ -1,3 +1,6 @@ +--- +--- + From 3cac2f50c1384a25eb8b9296e5b746a56a9592c7 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Mon, 4 Mar 2019 15:48:38 +0100 Subject: [PATCH 1002/3171] Fix typo (en) --- en/documentation/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/documentation/index.md b/en/documentation/index.md index 4287c373d4..0c0c174ff8 100644 --- a/en/documentation/index.md +++ b/en/documentation/index.md @@ -4,7 +4,7 @@ title: "Documentation" lang: en --- -Guides, tutorials and reference material to help you learn more about Ruby +Guides, tutorials, and reference material to help you learn more about Ruby {: .summary} ### Installing Ruby From 455e796d20d93793022c90f67ca4e4a6ddef66c1 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Mon, 4 Mar 2019 16:05:57 +0100 Subject: [PATCH 1003/3171] Drop mention of specific Ruby versions (en) (#1681) --- en/documentation/installation/index.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/en/documentation/installation/index.md b/en/documentation/installation/index.md index 0b4321faa5..3df8d878d9 100644 --- a/en/documentation/installation/index.md +++ b/en/documentation/installation/index.md @@ -80,9 +80,6 @@ like this: $ sudo apt-get install ruby-full {% endhighlight %} -As of writing, the `ruby-full` package provides Ruby 2.3.1, which is an old -stable release, on Debian and Ubuntu. - ### yum (CentOS, Fedora, or RHEL) {: #yum} @@ -125,9 +122,7 @@ Gentoo uses the portage package manager. $ sudo emerge dev-lang/ruby {% endhighlight %} -By default, this will try to install versions 1.9 and 2.0, but more -versions are available. To install a specific version, set -`RUBY_TARGETS` in your `make.conf`. +To install a specific version, set `RUBY_TARGETS` in your `make.conf`. See the [Gentoo Ruby Project website][gentoo-ruby] for details. From 2bcc020a21c6603ba5b717991e51a23ade9eda05 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Mon, 4 Mar 2019 22:15:05 +0100 Subject: [PATCH 1004/3171] Remove HOST constant HOST was only used by validate-website-static via the check:markup task, but it has no significance, since the task checks the local files and not the specified URL. --- Rakefile | 3 +-- lib/markup_checker.rb | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index ba253742b6..dde8d11742 100644 --- a/Rakefile +++ b/Rakefile @@ -8,7 +8,6 @@ rescue LoadError => e exit -1 end -HOST = 'www.ruby-lang.org' LANGUAGES = %w[bg de en es fr id it ja ko pl pt ru tr vi zh_cn zh_tw] CONFIG = "_config.yml" @@ -127,6 +126,6 @@ namespace :check do desc 'Validate _site markup with validate-website' task :markup do require_relative "lib/markup_checker" - MarkupChecker.new.check(host: HOST) + MarkupChecker.new.check end end diff --git a/lib/markup_checker.rb b/lib/markup_checker.rb index 3a65fcb9e8..ac20f3519c 100644 --- a/lib/markup_checker.rb +++ b/lib/markup_checker.rb @@ -1,14 +1,14 @@ class MarkupChecker # Validate _site markup with validate-website - def check(host:) - url = "https://#{host}/" - + def check Dir.chdir("_site") do - system("validate-website-static", - "--verbose", - "--exclude", "examples", - "--site", "#{url}") + system( + "validate-website-static", + "--verbose", + "--exclude", "examples" + ) + exit($?.exitstatus) end end From 944a697e3a3d21c646ab3aaa422ec6d26057097a Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Mon, 4 Mar 2019 22:22:21 +0100 Subject: [PATCH 1005/3171] Use Ruby 2.6.1 --- .travis.yml | 2 +- Gemfile | 2 +- Gemfile.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 196754c222..d77a8875f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby sudo: false -rvm: 2.5.1 +rvm: 2.6.1 cache: bundler: true script: bundle exec rake ci diff --git a/Gemfile b/Gemfile index 6956a83ba8..347be3285e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" -ruby ENV['CUSTOM_RUBY_VERSION'] || '~> 2.5.1' +ruby ENV['CUSTOM_RUBY_VERSION'] || '~> 2.6.1' gem 'rake' gem 'jekyll', '~> 3.0' diff --git a/Gemfile.lock b/Gemfile.lock index 57df945052..91d1689af6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -111,7 +111,7 @@ DEPENDENCIES validate-website (~> 1.6) RUBY VERSION - ruby 2.5.1p57 + ruby 2.6.1p33 BUNDLED WITH 1.17.3 From e2f18e4bb2204d32f73b78412be0e8ff16627253 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 4 Mar 2019 11:11:09 +0900 Subject: [PATCH 1006/3171] Security Advisories for RubyGems Mar, 2019. --- ...05-multiple-vulnerabilities-in-rubygems.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md new file mode 100644 index 0000000000..3fe40469a5 --- /dev/null +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -0,0 +1,57 @@ +--- +layout: news_post +title: "Multiple vulnerabilities in RubyGems" +author: "hsbt" +translator: +date: 2018-03-05 00:00:00 +0000 +tags: security +lang: en +--- + +There are multiple vulnerabilities in RubyGems bundled by Ruby. +It is [reported at the official blog of RubyGems](http://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html). + +## Details + +The following vulnerabilities have been reported. + +* CVE-2019-8320: Delete directory using symlink when decompressing tar +* CVE-2019-8321: Escape sequence injection vulnerability in `verbose` +* CVE-2019-8322: Escape sequence injection vulnerability in `gem owner` +* CVE-2019-8323: Escape sequence injection vulnerability in API response handling +* CVE-2019-8324: Installing a malicious gem may lead to arbitrary code execution +* CVE-2019-8325: Escape sequence injection vulnerability in errors + +It is strongly recommended for Ruby users to upgrade your Ruby installation or take one of the following workarounds as soon as possible. + +## Affected Versions + +* Ruby 2.4 series: 2.4.5 and earlier +* Ruby 2.5 series: 2.5.3 and earlier +* Ruby 2.6 series: 2.6.1 and earlier +* prior to trunk revision XXXXXX + +## Workarounds + +In principle, you should upgrade your Ruby installation to the latest version. +RubyGems 2.7.8, 3.0.3 or later includes the fix for the vulnerabilities, so upgrade RubyGems to the latest version if you can't upgrade Ruby itself. + +``` +gem update --system +``` + +If you can't upgrade RubyGems, you can apply the following patches as a workaround. + +* [for Ruby 2.4.5]() +* [for Ruby 2.5.3]() +* [for Ruby 2.6.1]() + +About the trunk, update to the latest revision. + +## Credits + +This report is based on [the official blog of RubyGems](http://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html). + +## History + +* Originally published at 2019-03-05 00:00:00 UTC From 8f11fef7298968c5597283b0a0c252cb73001e31 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 4 Mar 2019 18:02:57 +0900 Subject: [PATCH 1007/3171] Revert to mention the released version of Ruby. --- .../2019-03-05-multiple-vulnerabilities-in-rubygems.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md index 3fe40469a5..1cac731ad6 100644 --- a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -22,7 +22,7 @@ The following vulnerabilities have been reported. * CVE-2019-8324: Installing a malicious gem may lead to arbitrary code execution * CVE-2019-8325: Escape sequence injection vulnerability in errors -It is strongly recommended for Ruby users to upgrade your Ruby installation or take one of the following workarounds as soon as possible. +It is strongly recommended for Ruby users to take one of the following workarounds as soon as possible. ## Affected Versions @@ -33,8 +33,7 @@ It is strongly recommended for Ruby users to upgrade your Ruby installation or t ## Workarounds -In principle, you should upgrade your Ruby installation to the latest version. -RubyGems 2.7.8, 3.0.3 or later includes the fix for the vulnerabilities, so upgrade RubyGems to the latest version if you can't upgrade Ruby itself. +RubyGems 2.7.6/3.0.3 or later includes the fix for the vulnerabilities, so upgrade RubyGems to the latest version. ``` gem update --system From ed4d7a21cd6b72e95694de814814b3d0bb83f9cf Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 5 Mar 2019 09:06:18 +0900 Subject: [PATCH 1008/3171] Update patch link with bugs.ruby-lang.org. --- .../2019-03-05-multiple-vulnerabilities-in-rubygems.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md index 1cac731ad6..fa3f512d09 100644 --- a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -41,9 +41,9 @@ gem update --system If you can't upgrade RubyGems, you can apply the following patches as a workaround. -* [for Ruby 2.4.5]() -* [for Ruby 2.5.3]() -* [for Ruby 2.6.1]() +* [for Ruby 2.4.5](https://bugs.ruby-lang.org/attachments/7662) +* [for Ruby 2.5.3](https://bugs.ruby-lang.org/attachments/7663) +* [for Ruby 2.6.1](https://bugs.ruby-lang.org/attachments/7664) About the trunk, update to the latest revision. From 02b7079b039f998bcf88957d1858c817c2424719 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 5 Mar 2019 09:16:30 +0900 Subject: [PATCH 1009/3171] oops --- .../_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md index fa3f512d09..deebd65cf1 100644 --- a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -3,7 +3,7 @@ layout: news_post title: "Multiple vulnerabilities in RubyGems" author: "hsbt" translator: -date: 2018-03-05 00:00:00 +0000 +date: 2019-03-05 00:00:00 +0000 tags: security lang: en --- From bc7c7ecad4cef92c6980bd43e4f55de3ec7a3e74 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 5 Mar 2019 12:34:43 +0900 Subject: [PATCH 1010/3171] Update the wrong version of RG 2.7.x and the revision of trunk branch. --- .../_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md index deebd65cf1..c63b9ac054 100644 --- a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -29,11 +29,11 @@ It is strongly recommended for Ruby users to take one of the following workaroun * Ruby 2.4 series: 2.4.5 and earlier * Ruby 2.5 series: 2.5.3 and earlier * Ruby 2.6 series: 2.6.1 and earlier -* prior to trunk revision XXXXXX +* prior to trunk revision 67168 ## Workarounds -RubyGems 2.7.6/3.0.3 or later includes the fix for the vulnerabilities, so upgrade RubyGems to the latest version. +RubyGems 2.7.9/3.0.3 or later includes the fix for the vulnerabilities, so upgrade RubyGems to the latest version. ``` gem update --system From cf032c821d0e85a0a4b396d026eccb39f67aabaa Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Tue, 5 Mar 2019 21:35:08 +0100 Subject: [PATCH 1011/3171] Small fix in news post (en) --- .../_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md index c63b9ac054..4d7b2aac88 100644 --- a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -8,7 +8,7 @@ tags: security lang: en --- -There are multiple vulnerabilities in RubyGems bundled by Ruby. +There are multiple vulnerabilities in RubyGems bundled with Ruby. It is [reported at the official blog of RubyGems](http://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html). ## Details From 379e180226bacd54ddeb6a4dafa56241382104ff Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Tue, 5 Mar 2019 21:49:21 +0100 Subject: [PATCH 1012/3171] Use named link reference for recently added link --- en/documentation/index.md | 4 ++-- ko/documentation/index.md | 4 ++-- zh_tw/documentation/index.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/en/documentation/index.md b/en/documentation/index.md index 0c0c174ff8..d0a691d4c7 100644 --- a/en/documentation/index.md +++ b/en/documentation/index.md @@ -61,7 +61,7 @@ the [installation guide](installation/) for help on installing Ruby. ### Reference Documentation -[Official API Documentation][40] +[Official API Documentation][docs-rlo-en] : The official Ruby API documentation for different versions including the currently unreleased (trunk) version. @@ -170,6 +170,6 @@ If you have questions about Ruby the [37]: http://www.sublimetext.com/ [38]: http://ruby.learncodethehardway.org/ [39]: http://kapeli.com/dash -[40]: https://docs.ruby-lang.org/en/ +[docs-rlo-en]: https://docs.ruby-lang.org/en/ [atom]: https://atom.io/ [vscode]: https://code.visualstudio.com/ diff --git a/ko/documentation/index.md b/ko/documentation/index.md index 22f8022ef5..3d7d3a578b 100644 --- a/ko/documentation/index.md +++ b/ko/documentation/index.md @@ -69,7 +69,7 @@ lang: ko ### 참조 -[공식 API 문서][40] +[공식 API 문서][docs-rlo-en] : 아직 릴리스되지 않은 트렁크를 포함한 여러 루비 버전의 공식 API 문서입니다. [루비 코어 레퍼런스][13] (영문) @@ -172,7 +172,7 @@ lang: ko [37]: http://www.sublimetext.com/ [38]: http://ruby.learncodethehardway.org/ [39]: http://kapeli.com/dash -[40]: https://docs.ruby-lang.org/en/ +[docs-rlo-en]: https://docs.ruby-lang.org/en/ [atom]: https://atom.io/ [vscode]: https://code.visualstudio.com/ diff --git a/zh_tw/documentation/index.md b/zh_tw/documentation/index.md index 3ec01d65dc..3f00e24b2c 100644 --- a/zh_tw/documentation/index.md +++ b/zh_tw/documentation/index.md @@ -49,7 +49,7 @@ lang: zh_tw ### 參考文件 -[Official API Documentation][40] +[Official API Documentation][docs-rlo-en] : 各種版本的 Ruby 官方 API 文件,包含當前未釋出的版本(trunk)。 [Ruby Core Reference][13] @@ -143,7 +143,7 @@ lang: zh_tw [37]: http://www.sublimetext.com/ [38]: http://ruby.learncodethehardway.org/ [39]: http://kapeli.com/dash -[40]: https://docs.ruby-lang.org/en/ +[docs-rlo-en]: https://docs.ruby-lang.org/en/ [atom]: https://atom.io/ [vscode]: https://code.visualstudio.com/ From 167e93910936ae3b8fc134d2176f7791d0b610ba Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Tue, 5 Mar 2019 22:06:10 +0100 Subject: [PATCH 1013/3171] Small improvements on installation page (en) Remove reference to latest macOS to avoid having to update it; improve snap section; other small fixes. --- en/documentation/installation/index.md | 27 ++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/en/documentation/installation/index.md b/en/documentation/installation/index.md index 3df8d878d9..2c28f2c9fe 100644 --- a/en/documentation/installation/index.md +++ b/en/documentation/installation/index.md @@ -21,9 +21,9 @@ This should output some information on the installed Ruby version. There are several ways to install Ruby: -* On a UNIX-like operating system, using your system's **package - manager** is easiest. However, the packaged Ruby version may not be - the newest one. +* On a UNIX-like operating system, using your system's + **package manager** is easiest. + However, the packaged Ruby version may not be the newest one. * **Installers** can be used to install a specific or multiple Ruby versions. There is also an installer for Windows. * **Managers** help you to switch between multiple Ruby versions @@ -64,7 +64,7 @@ third-party tool, you can use your system's package manager to install Ruby. Some members of the Ruby community feel that you should avoid package managers to install Ruby and that you should use dedicated tools instead. -It's possible that major package managers will install older Ruby +It is possible that major package managers will install older Ruby versions instead of the latest release. To use the latest Ruby release, check that the package name matches its version number. Or use a dedicated [installer][installers]. @@ -95,17 +95,20 @@ The installed version is typically the latest version of Ruby available at the release time of the specific distribution version. -### snap (Ubuntu or other linux distribution) +### snap (Ubuntu or other Linux distributions) {: #snap} -Snap is a package manager developed by Canonical. It's available out-of-the-box on Ubuntu, but snap also works on many Linux distributions. -You can use it like this. +Snap is a package manager developed by Canonical. +It is available out-of-the-box on Ubuntu, but snap also works +on many other Linux distributions. +You can use it like this: {% highlight sh %} $ sudo snap install ruby --classic {% endhighlight %} -We have several channels per Ruby minor series. For instance, the following commands switch to Ruby 2.3: +We have several channels per Ruby minor series. +For instance, the following commands switch to Ruby 2.3: {% highlight sh %} $ sudo snap switch ruby --channel=2.3/stable @@ -143,7 +146,7 @@ This should install the latest stable Ruby version. {: #homebrew} Ruby versions 2.0 and above are included by default in macOS releases -since at least El Capitan (10.11) all the way through Mojave (10.14). +since at least El Capitan (10.11). [Homebrew][homebrew] is a commonly used package manager on macOS. Installing Ruby using Homebrew is easy: @@ -225,7 +228,7 @@ Linux, and other UNIX-like operating systems. [ruby-install][ruby-install] allows you to compile and install different versions of Ruby into arbitrary directories. [chruby](#chruby) is a -complimentary tool used to switch between Ruby versions. It's available +complimentary tool used to switch between Ruby versions. It is available for macOS, Linux, and other UNIX-like operating systems. @@ -308,8 +311,8 @@ $ sudo make install By default, this will install Ruby into `/usr/local`. To change, pass the `--prefix=DIR` option to the `./configure` script. -You can find more information about building from source in the [Ruby -README file][readme]. +You can find more information about building from source in the +[Ruby README file][readme]. Using the third-party tools or package managers might be a better idea, though, because the installed Ruby won't be managed by any tools. From ffe9e474fe3255a292faac8fcf6514ddfff29b22 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Tue, 5 Mar 2019 22:24:36 +0100 Subject: [PATCH 1014/3171] Small improvements on blogs page (en) Fix questionable statement in summary (replacing "past year" with "past years"), and typos. --- en/community/weblogs/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/en/community/weblogs/index.md b/en/community/weblogs/index.md index 3693b57cd5..5acfeb5ea2 100644 --- a/en/community/weblogs/index.md +++ b/en/community/weblogs/index.md @@ -4,7 +4,7 @@ title: "Blogs" lang: en --- -Ruby blogs have exploded over the past year and given sufficient +Ruby blogs have exploded over the past years and given sufficient hunting, you can unearth hundreds of blogs sharing bits of Ruby code, describing new techniques, or speculating on Ruby’s future. {: .summary} @@ -22,7 +22,7 @@ describing new techniques, or speculating on Ruby’s future. A few notable blogs stand out for the frequency and immediacy of their updates. -* [**Ruby Weekly**][ruby-weekly] Although more of a newsletter than a +* [**Ruby Weekly**][ruby-weekly]: Although more of a newsletter than a blog, Ruby Weekly is a distillation of the most interesting Ruby articles and news each week. * [**Riding Rails**][riding-rails] is the official group blog of the @@ -35,7 +35,7 @@ updates. If you're interested in writing for any of the above blogs, you should contact the authors. -Ruby is also a common topic on [reddit][reddit], and [Hacker News][hn], +Ruby is also a common topic on [reddit][reddit] and [Hacker News][hn], in their respective programming news. If you find some brilliant code out there, be sure to share! From 18e17f9e4119c48bac39be02235660c764a8f8b0 Mon Sep 17 00:00:00 2001 From: Alax Alves Date: Tue, 5 Mar 2019 22:28:42 -0300 Subject: [PATCH 1015/3171] Paralleling Travis jobs to shorten build duration --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d77a8875f6..887775bc3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,11 @@ sudo: false rvm: 2.6.1 cache: bundler: true -script: bundle exec rake ci +env: + matrix: + - SCRIPT="bundle exec rake build" + - SCRIPT="bundle exec rake test" +script: $SCRIPT # Notifications, used by our Gitter channel. notifications: webhooks: From e3caede3377cfb6618091e3a2d1697b4c9e747b8 Mon Sep 17 00:00:00 2001 From: Alax Alves Date: Tue, 5 Mar 2019 22:44:59 -0300 Subject: [PATCH 1016/3171] Making bundle cache work properly --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 887775bc3a..80bf6d60ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ language: ruby sudo: false rvm: 2.6.1 -cache: - bundler: true +cache: bundler env: matrix: - SCRIPT="bundle exec rake build" From b72499bcfe2645ff19fcd82a722841da35fcfdf8 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 6 Mar 2019 14:26:27 +0900 Subject: [PATCH 1017/3171] Update urls for the latest patch --- .../2019-03-05-multiple-vulnerabilities-in-rubygems.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md index 4d7b2aac88..55b9b70eda 100644 --- a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -41,9 +41,9 @@ gem update --system If you can't upgrade RubyGems, you can apply the following patches as a workaround. -* [for Ruby 2.4.5](https://bugs.ruby-lang.org/attachments/7662) -* [for Ruby 2.5.3](https://bugs.ruby-lang.org/attachments/7663) -* [for Ruby 2.6.1](https://bugs.ruby-lang.org/attachments/7664) +* [for Ruby 2.4.5](https://bugs.ruby-lang.org/attachments/7669) +* [for Ruby 2.5.3](https://bugs.ruby-lang.org/attachments/7670) +* [for Ruby 2.6.1](https://bugs.ruby-lang.org/attachments/7671) About the trunk, update to the latest revision. From faaecfc5c5c0f6beb06f1001ffd8c3c793353c0a Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Thu, 7 Mar 2019 19:37:42 +0100 Subject: [PATCH 1018/3171] Mention updated patches in news post history --- .../_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md | 1 + 1 file changed, 1 insertion(+) diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md index 55b9b70eda..1775225dc9 100644 --- a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -54,3 +54,4 @@ This report is based on [the official blog of RubyGems](http://blog.rubygems.org ## History * Originally published at 2019-03-05 00:00:00 UTC +* Link to updated patches at 2019-03-06 05:26:27 UTC From e2b3274573cfeb94f8f003f6ef5ef15647c4f319 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Fri, 8 Mar 2019 08:29:40 +0100 Subject: [PATCH 1019/3171] Use untranslated 'SIZE' in download section (es) --- es/news/_posts/2013-05-14-ruby-1-9-3-p429-is-released.md | 6 +++--- es/news/_posts/2013-05-14-ruby-2-0-0-p195-is-released.md | 6 +++--- es/news/_posts/2018-10-17-ruby-2-3-8-released.md | 8 ++++---- es/news/_posts/2018-10-17-ruby-2-4-5-released.md | 8 ++++---- es/news/_posts/2018-10-17-ruby-2-5-2-released.md | 8 ++++---- es/news/_posts/2018-11-06-ruby-2-6-0-preview3-released.md | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/es/news/_posts/2013-05-14-ruby-1-9-3-p429-is-released.md b/es/news/_posts/2013-05-14-ruby-1-9-3-p429-is-released.md index 5e87f573c6..8808d2c03c 100644 --- a/es/news/_posts/2013-05-14-ruby-1-9-3-p429-is-released.md +++ b/es/news/_posts/2013-05-14-ruby-1-9-3-p429-is-released.md @@ -27,19 +27,19 @@ Puedes descargar esta version de: * [https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.bz2](https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.bz2) - TAMAÑO: 10042323 bytes + SIZE: 10042323 bytes MD5: c2b2de5ef15ea9b1aaa3152f9112af1b SHA256: 9d8949c24cf6fe810b65fb466076708b842a3b0bac7799f79b7b6a8791dc2a70 * [https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz](https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz) - TAMAÑO: 12553234 bytes + SIZE: 12553234 bytes MD5: 993c72f7f805a9eb453f90b0b7fe0d2b SHA256: d192d1afc46a7ef27b9d0a3c7a67b509048984db2c38907aa82641bdf980acf4 * [https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.zip](https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.zip) - TAMAÑO: 13869978 bytes + SIZE: 13869978 bytes MD5: 1986f3934e61b999873d21a79d69d88d SHA256: 8bd0ecc2dd8eec471aa44f88abdcd82f4b398e9110ca06f76eff066b653b8b90 diff --git a/es/news/_posts/2013-05-14-ruby-2-0-0-p195-is-released.md b/es/news/_posts/2013-05-14-ruby-2-0-0-p195-is-released.md index 417ba5e37d..bfa03dbd07 100644 --- a/es/news/_posts/2013-05-14-ruby-2-0-0-p195-is-released.md +++ b/es/news/_posts/2013-05-14-ruby-2-0-0-p195-is-released.md @@ -19,19 +19,19 @@ Y muchas otras correcciones, optimizaciones y actualizaciones de documentación. * [https://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.tar.bz2](https://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.tar.bz2) - TAMAÑO: 10807456 bytes + SIZE: 10807456 bytes MD5: 2f54faea6ee1ca500632ec3c0cb59cb6 SHA256: 0be32aef7a7ab6e3708cc1d65cd3e0a99fa801597194bbedd5799c11d652eb5b * [https://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.tar.gz](https://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.tar.gz) - TAMAÑO: 13641558 bytes + SIZE: 13641558 bytes MD5: 0672e5af309ae99d1703d0e96eff8ea5 SHA256: a2fe8d44eac3c27d191ca2d0ee2d871f9aed873c74491b2a8df229bfdc4e5a93 * [https://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.zip](https://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.zip) - TAMAÑO: 15092199 bytes + SIZE: 15092199 bytes MD5: 924fe4bea72b1b258655211998631791 SHA256: 81a4dc6cc09e491d417a51e5983c4584eff849e2a186ec3affdbe5bc15cd7db5 diff --git a/es/news/_posts/2018-10-17-ruby-2-3-8-released.md b/es/news/_posts/2018-10-17-ruby-2-3-8-released.md index b94dc0a27b..5e9dd348fa 100644 --- a/es/news/_posts/2018-10-17-ruby-2-3-8-released.md +++ b/es/news/_posts/2018-10-17-ruby-2-3-8-released.md @@ -29,28 +29,28 @@ las versiones más recientes de Ruby, tales como 2.5 o 2.4. * [https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2](https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2) - TAMAÑO: 14418609 bytes + SIZE: 14418609 bytes SHA1: 91b31abdba00a346c155fd32bd32d3cec3b73bc4 SHA256: 4d1a3a88e8cf9aea624eb73843fbfc60a9a281582660f86d5e4e00870397407c SHA512: 6d79e0d25757fd37188a8db3e630a52539bce7927fcb779a2ce9a97b9e5f330753035c16843552f1a1fb6c9a1e5c0f916b3cc8b5c0bfe81e20f35f8442e40ae8 * [https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.gz](https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.gz) - TAMAÑO: 17858806 bytes + SIZE: 17858806 bytes SHA1: 69311991a9cd2c8e3c86a0dbbaaf915ae91f0bec SHA256: b5016d61440e939045d4e22979e04708ed6c8e1c52e7edb2553cf40b73c59abf SHA512: 43b02f2f9de6baf281f09a49fd07367127b4de1fb14473380d06bfa7667990d8f722ae2d33cf7d15b02f7e799515f21aebd308897c4c2a5461ebab4049d6c7ef * [https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.xz](https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.xz) - TAMAÑO: 11465792 bytes + SIZE: 11465792 bytes SHA1: 9771acdad851bbf0ef349bb7da5d0ffc91a860ed SHA256: 910f635d84fd0d81ac9bdee0731279e6026cb4cd1315bbbb5dfb22e09c5c1dfe SHA512: 06373050e6c1af9cb6a5863aef878b21c8a45fd0e68414e3d546cb73ec3028207d3acc0a9326428f172b9347a30bbe69a16f9dc0bdb739161d677adb2d888095 * [https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.zip](https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.zip) - TAMAÑO: 19911652 bytes + SIZE: 19911652 bytes SHA1: ad9e0ec7c874701832c9e224eb5b9e2258f3a041 SHA256: ec9792d0473a22954ad25cd0c531fc672679c1a5eaeefa08caf9e1288852796f SHA512: 732d69cd55f1c273a02005306720fd8fc9d77398177db9509452be31820976b54b30319d9e6bc36fb6bcd7af656f807ef6c26d8955012c8b20424912a2f51bf8 diff --git a/es/news/_posts/2018-10-17-ruby-2-4-5-released.md b/es/news/_posts/2018-10-17-ruby-2-4-5-released.md index c8f11100d3..954dd0e77c 100644 --- a/es/news/_posts/2018-10-17-ruby-2-4-5-released.md +++ b/es/news/_posts/2018-10-17-ruby-2-4-5-released.md @@ -22,28 +22,28 @@ Ver detalles en las [bitácoras de commits](https://github.com/ruby/ruby/compare * [https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.bz2](https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.bz2) - TAMAÑO: 12667524 bytes + SIZE: 12667524 bytes SHA1: 0e1f184556507c22bc59054496c0af7cf28fb188 SHA256: 276c8e73e51e4ba6a0fe81fb92669734e741ccea86f01c45e99f2c7ef7bcd1e3 SHA512: 7034fcaeaee41f14bc0ecce0d3d93bd1abe95310e1a0b95fac66eaba867adfb2bf7ba4d0d70d67a15ce8df16052dee405c38cdb18987602e64a2f701d37d3df0 * [https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.gz](https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.gz) - TAMAÑO: 14232887 bytes + SIZE: 14232887 bytes SHA1: 4d650f302f1ec00256450b112bb023644b6ab6dd SHA256: 6737741ae6ffa61174c8a3dcdd8ba92bc38827827ab1d7ea1ec78bc3cefc5198 SHA512: 39863b404b02bb3d2430fd19fb057bdded5e816842a1a1f00092de69cc360db836225b2186e18b6ee099ec5e8c60f89178a4297b2d221234b4962c70594c2b8e * [https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.xz](https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.xz) - TAMAÑO: 10064712 bytes + SIZE: 10064712 bytes SHA1: b5be590b37487248da3a85541a62fb81f7f7e29a SHA256: 2f0cdcce9989f63ef7c2939bdb17b1ef244c4f384d85b8531d60e73d8cc31eeb SHA512: 658f676c623109f4c7499615e191c98c3dd72cfcaeeaf121337d0b8a33c5243145edd50ec5e2775f988e3cd19788984f105fa165e3049779066566f67172c1b4 * [https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.zip](https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.zip) - TAMAÑO: 15694028 bytes + SIZE: 15694028 bytes SHA1: 0bded7dfabfce5615162a1acd1341966a63e40f4 SHA256: 33694b03ac178cf96aa728b74de7b0bc5d848fcfabc64a7c74ea093198142601 SHA512: 9baec2b33604d5b2180b83bef9b39349d3f73b2eb5a7d44410572d893f76e6a0e1c39c572e6084a4e2466ca148ff2f377b5458144fe9b859a80cdf7b41fd5d72 diff --git a/es/news/_posts/2018-10-17-ruby-2-5-2-released.md b/es/news/_posts/2018-10-17-ruby-2-5-2-released.md index 5b9b4fc894..eee4462495 100644 --- a/es/news/_posts/2018-10-17-ruby-2-5-2-released.md +++ b/es/news/_posts/2018-10-17-ruby-2-5-2-released.md @@ -22,28 +22,28 @@ Ver detalles en las [bitácoras de commits](https://github.com/ruby/ruby/compare * - TAMAÑO: 13592827 bytes + SIZE: 13592827 bytes SHA1: 562d6b8be5a0804ed7617bb0465b288d44b2defc SHA256: ea3bcecc3b30cee271b4decde5e9ff3e17369d5fd1ed828d321c198307c9f0df SHA512: 9f9388a162a3ae9c14ec8999fa3b12ff5397de14f55996cc8761d21c757113db37ace4d326b9606de7ad3a5875aa94fec900dd9b81b2fb0dff558c39422f4aa1 * - TAMAÑO: 15600481 bytes + SIZE: 15600481 bytes SHA1: 7e503e75621b69cedb1d8b3fa2bee5aef2f1a714 SHA256: b32340e64a0c7ecbf31486c41fe429a55c7984d980eca7a78138367d9209f471 SHA512: 9aee69d2ac6aefe2d81649055ba7b99e4e58cf203ac75083ba1b35b3a4fd7f72ee257e26ca80460da5c2a7817fd507aecec9c143f170e16980625e95eeb31686 * - TAMAÑO: 11071052 bytes + SIZE: 11071052 bytes SHA1: ea352c9bcaa47ab094cdec0f4946c62b1a1769d7 SHA256: 8be6b6afdf09957a6e2c2a6ada4b1982a391a828b34e49072c4beb60febb678d SHA512: b6b805b18ba6da7b28c7e2bdf3da7eaf1dcc15ae22744228d032e8ddec2fbba4cc4fb822b9ef7f6b561052113a4f28dc50ccfa4f00e3728a35ce27137f4a70e6 * - TAMAÑO: 18786735 bytes + SIZE: 18786735 bytes SHA1: 98fdbae195bbbc3f131d49d9e60bf3fbb8b56111 SHA256: f148947fee070f30826ef0bda77228b9c374b388050db81ad07f5cd8608e3624 SHA512: 1b804337099ecfa045eecf1a4e3f35fa786bd6e835dc50267d6a3792a782b193ec9708564e3ac5169a95ef4afc2c131782af937dafd8122117e8cff577736c0f diff --git a/es/news/_posts/2018-11-06-ruby-2-6-0-preview3-released.md b/es/news/_posts/2018-11-06-ruby-2-6-0-preview3-released.md index e2c72c3a81..4fc34afbb1 100644 --- a/es/news/_posts/2018-11-06-ruby-2-6-0-preview3-released.md +++ b/es/news/_posts/2018-11-06-ruby-2-6-0-preview3-released.md @@ -118,28 +118,28 @@ Disfrute programar con Ruby 2.6.0-preview3! * - TAMAÑO: 17071670 bytes + SIZE: 17071670 bytes SHA1: 67836fda11fa91e0b988a6cc07989fbceda025b4 SHA256: 60243e3bd9661e37675009ab66ba63beacf5dec748885b9b93916909f965f27a SHA512: 877278cd6e9b947f5bb6ed78136efb232dcc9c5c218b7236576171e7c3cd7f6b7d10d07d8402014a14aba1fcd1913a4370f0725c561ead41d8a3fe92029f7f76 * - TAMAÑO: 21537655 bytes + SIZE: 21537655 bytes SHA1: 45f3c90dfffe03b746f21f24152666e361cbb41a SHA256: 9152af9e700349dcfa2eec196dd91587d42d70a6837fa2c415ebba1167587be1 SHA512: 335de36cf56706326f4acc4bbd35be01e0ac5fff30d0a69b2e1630ba4c78f0e711822d1623d0099a517c824b154917d2f60be192dfb143a422cf1d17b38e1183 * - TAMAÑO: 14973451 bytes + SIZE: 14973451 bytes SHA1: 5f2df5d8c5a3888ccb915d36a3532ba32cda8791 SHA256: 1f09a2ac1ab26721923cbf4b9302a66d36bb302dc45e72112b41d6fccc5b5931 SHA512: d1693625723796e8902f3e4c4fae444f2912af9173489f7cf18c99db2a217afc971b082fce7089e39f8edd54d762d2b4e72843c8306ed29b05ccb15ac03dbb5b * - TAMAÑO: 12291692 bytes + SIZE: 12291692 bytes SHA1: 7f8216247745215e9645568e7a02140f9a029b31 SHA256: 9856d9e0e32df9e5cdf01928eec363d037f1a76dab2abbf828170647beaf64fe SHA512: b4d3b17ecf96272c43cd7518c0b54dee63fc1150ad143e1d9c9d708506fe78676c80eb96cc47b8d46d1128bd483a53f16c944963a03d1f99f00131b74714df7b From a3b31d305ef74e6d22672408a120d2ccfb65ccfd Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Fri, 8 Mar 2019 08:30:16 +0100 Subject: [PATCH 1020/3171] Add newline after YAML front matter --- en/conduct/index.md | 1 + ja/news/_posts/2018-08-28-rubyist-magazine-0058-published.md | 1 + ja/news/_posts/2019-01-27-rubyist-magazine-0059-published.md | 1 + ko/conduct/index.md | 1 + 4 files changed, 4 insertions(+) diff --git a/en/conduct/index.md b/en/conduct/index.md index 30e1064711..7dbdc22974 100644 --- a/en/conduct/index.md +++ b/en/conduct/index.md @@ -3,6 +3,7 @@ layout: page title: "The Ruby Community Conduct Guideline" lang: en --- + We have picked the following conduct guideline based on an early proposed draft of the PostgreSQL CoC, for Ruby developers community for safe, productive collaboration. diff --git a/ja/news/_posts/2018-08-28-rubyist-magazine-0058-published.md b/ja/news/_posts/2018-08-28-rubyist-magazine-0058-published.md index 70b1b6bbf0..27f8b91502 100644 --- a/ja/news/_posts/2018-08-28-rubyist-magazine-0058-published.md +++ b/ja/news/_posts/2018-08-28-rubyist-magazine-0058-published.md @@ -6,6 +6,7 @@ translator: date: 2018-08-28 21:30:00 +0000 lang: ja --- + [日本Rubyの会][1]有志による、ウェブ雑誌[Rubyist Magazine][2]の[0058号][3]がリリースされました([\[ruby-list:50698\]][4])。 今号は、 diff --git a/ja/news/_posts/2019-01-27-rubyist-magazine-0059-published.md b/ja/news/_posts/2019-01-27-rubyist-magazine-0059-published.md index 23d58ca7f9..9456a0bcd4 100644 --- a/ja/news/_posts/2019-01-27-rubyist-magazine-0059-published.md +++ b/ja/news/_posts/2019-01-27-rubyist-magazine-0059-published.md @@ -6,6 +6,7 @@ translator: date: 2019-01-27 09:30:00 +0000 lang: ja --- + [日本Rubyの会][1]有志による、ウェブ雑誌[Rubyist Magazine][2]の[0059号][3]がリリースされました([\[ruby-list:50745\]][4])。 今号は、 diff --git a/ko/conduct/index.md b/ko/conduct/index.md index 13dfa92818..0904f3e6a9 100644 --- a/ko/conduct/index.md +++ b/ko/conduct/index.md @@ -3,6 +3,7 @@ layout: page title: "루비 커뮤니티 행동 지침" lang: ko --- + 루비 개발자 커뮤니티의 안전하고, 생산적인 공동 작업을 위해서 PostgreSQL CoC로 제출된 안으로부터 다음을 골랐습니다. 루비와 관련이 있는 각 커뮤니티(콘퍼런스 등)는 해당 커뮤니티에 적합한 행동 지침을 사용할 수 있습니다. From 3901bf1d4a97e03084dec948321d9bb0d7a38a03 Mon Sep 17 00:00:00 2001 From: Olivier Lacan Date: Fri, 8 Mar 2019 08:34:25 +0100 Subject: [PATCH 1021/3171] Use named link references on community page (en) --- en/community/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/en/community/index.md b/en/community/index.md index af8113244b..8ed9239ded 100644 --- a/en/community/index.md +++ b/en/community/index.md @@ -43,12 +43,12 @@ to start: the Ruby community. General Ruby Information -: * [Ruby Central][3] - * [Ruby at Open Directory Project][4] - * [Rails at Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby at Open Directory Project][ruby-opendir] + * [Rails at Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ From 118909f9021a77d67508cc5bbffbac7bc16ca8fa Mon Sep 17 00:00:00 2001 From: BannerGames Date: Fri, 20 Jul 2018 21:28:12 +0100 Subject: [PATCH 1022/3171] Translate Ruby 2.2 EOL post (pt) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #1818 Co-authored-by: Marcus Stollsteimer Co-authored-by: Júlio Campos Co-authored-by: Alax Alves --- ...018-06-20-support-of-ruby-2-2-has-ended.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pt/news/_posts/2018-06-20-support-of-ruby-2-2-has-ended.md diff --git a/pt/news/_posts/2018-06-20-support-of-ruby-2-2-has-ended.md b/pt/news/_posts/2018-06-20-support-of-ruby-2-2-has-ended.md new file mode 100644 index 0000000000..20447936d5 --- /dev/null +++ b/pt/news/_posts/2018-06-20-support-of-ruby-2-2-has-ended.md @@ -0,0 +1,49 @@ +--- +layout: news_post +title: "O suporte do Ruby 2.2 acabou" +author: "antonpaisov" +translator: "bannergames" +date: 2018-06-20 00:00:00 +0000 +lang: pt +--- + +Anunciamos que todo o suporte da série 2.2 do Ruby acabou. + +Após o lançamento do Ruby 2.2.7 em 28 de março de 2017, +o suporte da série 2.2 do Ruby estava em fase de manutenção de segurança. +Agora, após um ano, essa fase acabou. +Assim sendo, em 31 de março de 2018, todo o suporte da série 2.2 do Ruby +acabou. Correções de bugs e de segurança das versões mais recentes do Ruby +não serão exportados para a versão 2.2, e não haverão mais lançamentos de +patch da versão 2.2. +Nós recomendamos altamente que atualize para o Ruby 2.5 ou 2.4 o mais +rápido possível. + + +## Sobre as versões do Ruby atualmente suportadas + +### Série Ruby 2.5 + +Atualmente em fase de manunteção normal. +Nós vamos exportar correções de bugs e lançar com as correções sempre +que necessário. +E se um problema crítico de segurança for encontrado iremos lançar +uma correção urgente para resolvê-lo. + +### Série Ruby 2.4 + +Atualmente em fase de manunteção normal. +Nós vamos exportar correções de bugs e lançar com as correções sempre +que necessário. +E se um problema crítico de segurança for encontrado iremos lançar +uma correção urgente para resolvê-lo. + +### Série Ruby 2.3 + +Atualmente em fase de manunteção de segurança. +Nós nunca exportaremos quaisquer correções de bugs para a versão 2.3 +exceto correções de segurança. +Se um problema crítico de segurança for encontrado iremos lançar +uma correção urgente para resolvê-lo. +Estamos planeando para acabar com o suporte das séries 2.3 do Ruby +no final de março de 2019. From 9124a20b4f78bd615f0213c95bf0c9a8c3b8cdbf Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Fri, 8 Mar 2019 21:58:26 +0100 Subject: [PATCH 1023/3171] Use named link references on community page --- bg/community/index.md | 12 ++++++------ de/community/index.md | 12 ++++++------ es/community/index.md | 12 ++++++------ fr/community/index.md | 12 ++++++------ id/community/index.md | 12 ++++++------ it/community/index.md | 12 ++++++------ ko/community/index.md | 12 ++++++------ pl/community/index.md | 12 ++++++------ pt/community/index.md | 12 ++++++------ ru/community/index.md | 12 ++++++------ tr/community/index.md | 12 ++++++------ vi/community/index.md | 12 ++++++------ zh_cn/community/index.md | 12 ++++++------ zh_tw/community/index.md | 12 ++++++------ 14 files changed, 84 insertions(+), 84 deletions(-) diff --git a/bg/community/index.md b/bg/community/index.md index f1e17ba225..7d7c246284 100644 --- a/bg/community/index.md +++ b/bg/community/index.md @@ -40,12 +40,12 @@ Oбщността, която се образува около един език обществото. Обща информация за Ruby -: * [Ruby Central][3] - * [Ruby в Open Directory Project][4] - * [Rails в Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby в Open Directory Project][ruby-opendir] + * [Rails в Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/de/community/index.md b/de/community/index.md index 4096e9cae9..44007cff02 100644 --- a/de/community/index.md +++ b/de/community/index.md @@ -74,12 +74,12 @@ Für den, der sich gerne einbringen möchte, ist die folgende Liste ein guter Ei in die Ruby-Community zu integrieren. Allgemeine Information zu Ruby -: * [Ruby Central][3] - * [Ruby beim Open Directory Project][4] - * [Rails beim Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby beim Open Directory Project][ruby-opendir] + * [Rails beim Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/es/community/index.md b/es/community/index.md index 93de504312..25b0c98046 100644 --- a/es/community/index.md +++ b/es/community/index.md @@ -45,12 +45,12 @@ donde empezar: dar una bienvenida a los recién llegados a la comunidad Ruby. Información general sobre Ruby -: * [Ruby Central][3] - * [Ruby en el Open Directory Project][4] - * [Rails en el Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby en el Open Directory Project][ruby-opendir] + * [Rails en el Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/fr/community/index.md b/fr/community/index.md index 7a3915e0fa..d83c50a125 100644 --- a/fr/community/index.md +++ b/fr/community/index.md @@ -46,12 +46,12 @@ Quelques liens à visiter: arrivants dans la communauté. Informations générales -: * [Ruby Central][3] - * [Ruby sur le projet Open Directory][4] - * [Rails sur le projet Open Directory][5] +: * [Ruby Central][ruby-central] + * [Ruby sur le projet Open Directory][ruby-opendir] + * [Rails sur le projet Open Directory][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/id/community/index.md b/id/community/index.md index 1094d13fc7..1fa7d43cc8 100644 --- a/id/community/index.md +++ b/id/community/index.md @@ -57,14 +57,14 @@ untuk memulai petualangan Anda: dengan komunitas. Informasi Umum Tentang Ruby -: * [Ruby Central][3] - * [Ruby at Open Directory Project][4] - * [Rails at Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby at Open Directory Project][ruby-opendir] + * [Rails at Open Directory Project][rails-opendir] [2]: http://tech.groups.yahoo.com/group/id-ruby/ -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ [6]: http://ruby.id/slack/ diff --git a/it/community/index.md b/it/community/index.md index e35fe23bb6..c98795ec7e 100644 --- a/it/community/index.md +++ b/it/community/index.md @@ -45,12 +45,12 @@ cominciare: discutere il futuro di Ruby, e dare il benvenuto ai nuovi arrivati. Informazioni generali su Ruby -: * [Ruby Central][3] - * [Ruby su Open Directory Project][4] - * [Rails su Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby su Open Directory Project][ruby-opendir] + * [Rails su Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/ko/community/index.md b/ko/community/index.md index 0c099aeaa3..57dd8d07b6 100644 --- a/ko/community/index.md +++ b/ko/community/index.md @@ -44,10 +44,10 @@ lang: ko 커뮤니티의 뉴비의 환영 등을 함께합니다. 일반적인 루비 정보(영문) -: * [Ruby Central][3] - * [Ruby at Open Directory Project][4] - * [Rails at Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby at Open Directory Project][ruby-opendir] + * [Rails at Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/pl/community/index.md b/pl/community/index.md index 2363da87aa..42e004b631 100644 --- a/pl/community/index.md +++ b/pl/community/index.md @@ -47,13 +47,13 @@ poniżej znajdziesz kilka propozycji: projekcie i przywitać nowe osoby w społeczności. Ogólne informacje o Rubim -: * [Ruby Central][3] - * [Ruby w Open Directory Project][4] - * [Rails w Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby w Open Directory Project][ruby-opendir] + * [Rails w Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ [6]: http://forum.rubyonrails.pl/ diff --git a/pt/community/index.md b/pt/community/index.md index 8c3b5cdf01..63f9e34c5c 100644 --- a/pt/community/index.md +++ b/pt/community/index.md @@ -42,12 +42,12 @@ Se está interessado em colaborar, seguem alguns lugares para começar: membros da comunidade. Informação gerais sobre o Ruby -: * [Ruby Central][3] - * [Ruby no Open Directory Project][4] - * [Rails no Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby no Open Directory Project][ruby-opendir] + * [Rails no Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/ru/community/index.md b/ru/community/index.md index 13fda56841..2e1925806a 100644 --- a/ru/community/index.md +++ b/ru/community/index.md @@ -42,12 +42,12 @@ lang: ru будущее Ruby и приветствуют новичков в сообществе Ruby. Основная информация о Ruby -: * [Ruby Central][3] - * [Ruby на Open Directory Project][4] - * [Rails на Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby на Open Directory Project][ruby-opendir] + * [Rails на Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/tr/community/index.md b/tr/community/index.md index d6706c0c31..6ec7f1eec4 100644 --- a/tr/community/index.md +++ b/tr/community/index.md @@ -53,12 +53,12 @@ başlangıç önerisi var: gelenlerle kaynaşıyorlar. Genel Ruby Kaynakları -: * [Ruby Central][3] - * [Açık Dizin Projesinde Ruby][4] - * [Açık Dizin Projesinde Rails][5] +: * [Ruby Central][ruby-central] + * [Açık Dizin Projesinde Ruby][ruby-opendir] + * [Açık Dizin Projesinde Rails][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/vi/community/index.md b/vi/community/index.md index d49615f5df..ac01907610 100644 --- a/vi/community/index.md +++ b/vi/community/index.md @@ -43,12 +43,12 @@ Nếu bạn muốn tham gia thì dưới đây là một vài nơi để bắt đồng Ruby. Thông tin chung về Ruby -: * [Ruby Central][3] - * [Ruby at Open Directory Project][4] - * [Rails at Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby at Open Directory Project][ruby-opendir] + * [Rails at Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ diff --git a/zh_cn/community/index.md b/zh_cn/community/index.md index 662ade757b..6855123428 100644 --- a/zh_cn/community/index.md +++ b/zh_cn/community/index.md @@ -32,13 +32,13 @@ lang: zh_cn : 遍及世界的 Ruby 程序员正在参与越来越多的会议,在会议上他们一起分享工作成果,讨论 Ruby 的未来,欢迎新成员加入到 Ruby 社区。 Ruby 的一般信息 -: * [Ruby Central][3] - * [Ruby at Open Directory Project][4] - * [Rails at Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby at Open Directory Project][ruby-opendir] + * [Rails at Open Directory Project][rails-opendir] -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ [ruby-china]: https://ruby-china.org diff --git a/zh_tw/community/index.md b/zh_tw/community/index.md index 730bbff94c..dbe73f7ced 100644 --- a/zh_tw/community/index.md +++ b/zh_tw/community/index.md @@ -35,14 +35,14 @@ lang: zh_tw Ruby 年度研討會為 [RubyConf Taiwan](http://rubyconf.tw)。 Ruby 的一般消息 -: * [Ruby Central][3] - * [Ruby at Open Directory Project][4] - * [Rails at Open Directory Project][5] +: * [Ruby Central][ruby-central] + * [Ruby at Open Directory Project][ruby-opendir] + * [Rails at Open Directory Project][rails-opendir] [1]: http://ruby.tw [2]: http://ruby.tw/about [railsfun]: http://railsfun.tw/index.php -[3]: http://rubycentral.org/ -[4]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ -[5]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ +[ruby-central]: http://rubycentral.org/ +[ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ +[rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ From b0fc2a7098ba42c6eee308aa86bafc1b59d7e3e2 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Fri, 8 Mar 2019 22:06:16 +0100 Subject: [PATCH 1024/3171] Remove dead link to blastwave.org Closes #1860 --- bg/documentation/installation/index.md | 3 +-- de/documentation/installation/index.md | 3 +-- es/documentation/installation/index.md | 3 +-- fr/documentation/installation/index.md | 3 +-- id/documentation/installation/index.md | 3 +-- it/documentation/installation/index.md | 3 +-- ja/documentation/installation/index.md | 3 +-- ko/documentation/installation/index.md | 3 +-- pl/documentation/installation/index.md | 3 +-- pt/documentation/installation/index.md | 3 +-- ru/documentation/installation/index.md | 3 +-- vi/documentation/installation/index.md | 3 +-- zh_tw/documentation/installation/index.md | 3 +-- 13 files changed, 13 insertions(+), 26 deletions(-) diff --git a/bg/documentation/installation/index.md b/bg/documentation/installation/index.md index e6439a8256..59e2c066dd 100644 --- a/bg/documentation/installation/index.md +++ b/bg/documentation/installation/index.md @@ -136,7 +136,7 @@ $ brew install ruby {: #solaris} Ruby 1.8.7 е наличен за Solaris от версия 8 до 10 на -[Sunfreeware][sunfreeware] и на [Blastwave][blastwave]. +[Sunfreeware][sunfreeware] и на Blastwave. Ruby 1.9.2p0 също може да бъде инсталиран от [Sunfreeware][sunfreeware], но е стара версия. @@ -282,7 +282,6 @@ $ sudo make install [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/de/documentation/installation/index.md b/de/documentation/installation/index.md index ce3853c92a..0c1341065f 100644 --- a/de/documentation/installation/index.md +++ b/de/documentation/installation/index.md @@ -199,7 +199,7 @@ neuer Ruby-Versionen. {: #solaris} Ruby 1.8.7 ist für Solaris 8 bis Solaris 10 unter [Sunfreeware][sunfreeware] -verfügbar und Ruby 1.8.7 ist bei [Blastwave][blastwave] erhältlich. +verfügbar und Ruby 1.8.7 ist bei Blastwave erhältlich. Ruby 1.9.2-p0 kann ebenfalls bei [Sunfreeware][sunfreeware] gefunden werden, jedoch ist diese Version veraltet. Die neueste Version kann mit Drittanbieter-Werkzeugen installiert werden. @@ -251,7 +251,6 @@ verwaltet wird. [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/es/documentation/installation/index.md b/es/documentation/installation/index.md index 00e984d831..67a2241071 100644 --- a/es/documentation/installation/index.md +++ b/es/documentation/installation/index.md @@ -140,7 +140,7 @@ Este comando debería instalar la versión más actual de Ruby. Ruby 1.8.7 está disponible para Solaris 8 a 10 en [Sunfreeware][sunfreeware] y Ruby 1.8.7 está disponible en -[Blastwave][blastwave]. +Blastwave. Ruby 1.9.2p0 también está disponible en [Sunfreeware][sunfreeware], pero esta es una versión desactualizada. @@ -290,7 +290,6 @@ herramienta. [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/fr/documentation/installation/index.md b/fr/documentation/installation/index.md index 3588186a99..b5e4ddacc3 100644 --- a/fr/documentation/installation/index.md +++ b/fr/documentation/installation/index.md @@ -144,7 +144,7 @@ La version la plus récente de Ruby sera installée. Ruby 1.8.7 est disponible de Solaris 8 à Solaris 10 sur [Sunfreeware][sunfreeware] et Ruby 1.8.7 est disponible sur -[Blastwave][blastwave]. +Blastwave. Ruby 1.9.2p0 est aussi disponible sur [Sunfreeware][sunfreeware], mais il est obsolète. @@ -312,7 +312,6 @@ Ruby ne pourront pas être gérées par un gestionnaire de versions. [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/id/documentation/installation/index.md b/id/documentation/installation/index.md index 6f52f12d9e..0dd715c380 100644 --- a/id/documentation/installation/index.md +++ b/id/documentation/installation/index.md @@ -159,7 +159,7 @@ dapat ditemukan di [FreeBSD Ruby Project website][freebsd-ruby]. Ruby 1.8.7 tersedia untuk Solaris 8 hingga Solaris 10 di [Sunfreeware][sunfreeware] dan Ruby 1.8.7 tersedia di -[Blastwave][blastwave]. +Blastwave. Ruby 1.9.2p0 juga tersedia di [Sunfreeware][sunfreeware], namun sudah tidak diperbarui lagi. @@ -309,7 +309,6 @@ karena Ruby yang terpasang tidak akan diatur oleh kakas apapun. [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/it/documentation/installation/index.md b/it/documentation/installation/index.md index 7dcef0fd0a..1d6a0269e4 100644 --- a/it/documentation/installation/index.md +++ b/it/documentation/installation/index.md @@ -187,7 +187,7 @@ probabilmente una buona ida utilizzare i tool di terze parti. {: #solaris} Ruby 1.8.7 è disponibile per Solaris 8 fino a Solaris 10 su -[Sunfreeware][sunfreeware] e Ruby 1.8.7 è disponibile su [Blastwave][blastwave]. +[Sunfreeware][sunfreeware] e Ruby 1.8.7 è disponibile su Blastwave. Ruby 1.9.2p0 è disponibile su [Sunfreeware][sunfreeware], ma è outdate. Si possono avere le ultime versioni di Ruby utilizzando i tool di terze parti. @@ -236,7 +236,6 @@ perchè la versione installata non verrebbe gestita da nessun tool. [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/ja/documentation/installation/index.md b/ja/documentation/installation/index.md index ec2ce5e0e9..7808456b83 100644 --- a/ja/documentation/installation/index.md +++ b/ja/documentation/installation/index.md @@ -187,7 +187,7 @@ macOS 上で新しい Ruby のバージョンをインストールする手助 {: #solaris} [Sunfreeware][sunfreeware] で Solaris 8 から 10 用の Ruby 1.8.7 が使用できます。 -[Blastwave][blastwave] で Ruby 1.8.7 が使用できます。 +Blastwave で Ruby 1.8.7 が使用できます。 [Sunfreeware][sunfreeware] で Ruby 1.9.2p0 も使用できますが、これは古いバージョンです。 サードパーティ製ツールを使用することで最新バージョンの Ruby を手に入れることができます。 @@ -234,7 +234,6 @@ $ sudo make install [rubyinstaller]: https://rubyinstaller.org/ [railsinstaller]: http://railsinstaller.org/ [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/ko/documentation/installation/index.md b/ko/documentation/installation/index.md index c3bf276ec9..a967e45407 100644 --- a/ko/documentation/installation/index.md +++ b/ko/documentation/installation/index.md @@ -177,7 +177,7 @@ FreeBSD 상의 루비와 그 환경에 대해서 더 자세한 정보는 {: #solaris} Solaris 8에서 Solaris 10까지 [Sunfreeware][sunfreeware]에서 루비 1.8.7을 사용 가능하며 -[Blastwave][blastwave]에서 루비 1.8.7을 사용 가능합니다. +Blastwave에서 루비 1.8.7을 사용 가능합니다. [Sunfreeware][sunfreeware]에서 루비 1.9.2p0을 사용 가능하지만, 이는 구 버전입니다. [OpenIndiana][openindiana]에서 루비를 설치하려면, @@ -322,7 +322,6 @@ $ sudo make install [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ [freebsd-ruby]: https://wiki.freebsd.org/Ruby diff --git a/pl/documentation/installation/index.md b/pl/documentation/installation/index.md index e052b8fb24..4ac97d91cf 100644 --- a/pl/documentation/installation/index.md +++ b/pl/documentation/installation/index.md @@ -184,7 +184,7 @@ nowej wersji Rubiego w macOS dobrym pomysłem jest użycie narzędzi osób trzec {: #solaris} Ruby 1.8.7 jest dostępny dla Solarisa 8 do Solarisa 10 na -[Sunfreeware][sunfreeware] i Ruby 1.8.7 jest dostępny na [Blastwave][blastwave]. +[Sunfreeware][sunfreeware] i Ruby 1.8.7 jest dostępny na Blastwave. Ruby 1.9.2p0 jest także dostępny na [Sunfreeware][sunfreeware], ale przestarzały. Użycie RVM umożliwi ci skorzystanie z najnowszej wersji Rubiego. @@ -230,7 +230,6 @@ pomysłem, ponieważ zainstalowany Ruby nie będzie zarządzany przez żadne z n [rbenv]: https://github.com/rbenv/rbenv [rubyinstaller]: https://rubyinstaller.org/ [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/pt/documentation/installation/index.md b/pt/documentation/installation/index.md index d5b6c5af91..cfc5dcbd41 100644 --- a/pt/documentation/installation/index.md +++ b/pt/documentation/installation/index.md @@ -140,7 +140,7 @@ Este comando deve instalar a versão mais recente do Ruby. O Ruby 1.8.7 está disponível do Solaris 8 até o Solaris 10 no [Sunfreeware][sunfreeware] e o Ruby 1.8.7 está disponível no -[Blastwave][blastwave]. O Ruby 1.9.2p0 também está disponível no +Blastwave. O Ruby 1.9.2p0 também está disponível no [Sunfreeware][sunfreeware], mas está desatualizado. Para instalar o Ruby no [OpenIndiana][openindiana], por favor use o @@ -290,7 +290,6 @@ por nenhuma ferramenta. [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/ru/documentation/installation/index.md b/ru/documentation/installation/index.md index 2de0b726a9..62aab5eaa0 100644 --- a/ru/documentation/installation/index.md +++ b/ru/documentation/installation/index.md @@ -141,7 +141,7 @@ $ brew install ruby {: #solaris} Ruby 1.8.7 доступен для Solaris 8-10 на [Sunfreeware][sunfreeware] и -[Blastwave][blastwave]. Ruby 1.9.2p0 также доступен на [Sunfreeware][sunfreeware], +Blastwave. Ruby 1.9.2p0 также доступен на [Sunfreeware][sunfreeware], но это все уже устарело. Чтобы установить Ruby на [OpenIndiana][openindiana], пожалуйста, используйте @@ -288,7 +288,6 @@ $ sudo make install [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/vi/documentation/installation/index.md b/vi/documentation/installation/index.md index 11472b51d9..05c1b913c2 100644 --- a/vi/documentation/installation/index.md +++ b/vi/documentation/installation/index.md @@ -142,7 +142,7 @@ Lệnh trên sẽ cài đặt phiên bản mới nhất của Ruby. Ruby 1.8.7 có sẵn từ Solaris 8 đến Solaris 10 trên [Sunfreeware][sunfreeware] và Ruby 1.8.7 có sẵn ở -[Blastwave][blastwave]. +Blastwave. Ruby 1.9.2p0 cũng có sẵn tại [Sunfreeware][sunfreeware], nhưng đây là phiên bản đã lỗi thời. @@ -296,7 +296,6 @@ bất kỳ công cụ nào. [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ diff --git a/zh_tw/documentation/installation/index.md b/zh_tw/documentation/installation/index.md index 55b30a8e47..844aee3b1e 100644 --- a/zh_tw/documentation/installation/index.md +++ b/zh_tw/documentation/installation/index.md @@ -118,7 +118,7 @@ $ brew install ruby ### Solaris 和 OpenIndiana 平台 {: #solaris} -[Sunfreeware][sunfreeware] 上的 Solaris 8 到 10 版有 Ruby 1.8.7 可用,同時 [Blastwave][blastwave] 上也有 Ruby 1.8.7。Ruby 1.9.2p0 在 [Sunfreeware][sunfreeware] 也有,但版本已經過時了。 +[Sunfreeware][sunfreeware] 上的 Solaris 8 到 10 版有 Ruby 1.8.7 可用,同時 Blastwave 上也有 Ruby 1.8.7。Ruby 1.9.2p0 在 [Sunfreeware][sunfreeware] 也有,但版本已經過時了。 要在 [OpenIndiana][openindiana] 安裝 Ruby,請使用: [Image Packaging System (IPS)][opensolaris-pkg] 客戶端。 @@ -234,7 +234,6 @@ $ sudo make install [railsinstaller]: http://railsinstaller.org/ [rubystack]: http://bitnami.com/stack/ruby/installer [sunfreeware]: http://www.sunfreeware.com -[blastwave]: http://www.blastwave.org [openindiana]: http://openindiana.org/ [opensolaris-pkg]: http://opensolaris.org/os/project/pkg/ [gentoo-ruby]: http://www.gentoo.org/proj/en/prog_lang/ruby/ From da7c5408a5a6fb2d5c79555cb28700c096d578ba Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Fri, 8 Mar 2019 22:15:24 +0100 Subject: [PATCH 1025/3171] Remove defunct conference sites (en) Closes #1958 Co-authored-by: Jacob Herrington --- en/community/conferences/index.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/en/community/conferences/index.md b/en/community/conferences/index.md index f7a49f2de0..227d37bbc2 100644 --- a/en/community/conferences/index.md +++ b/en/community/conferences/index.md @@ -37,12 +37,6 @@ event dates, location, CFP (Call For Proposals) and Registration information. including Armin Roehrl and Michael Neumann, EuRuKo emerged as the second annual Ruby event, starting two years after RubyConf. -[Open Source Developer Conference][5] -: This is an annual open source development conference that is held each - year in Australia. While not specifically a Ruby conference, each year - we do get a number of Ruby papers and we are always interested in more - Ruby content. - ### Regional Ruby Conferences [Ruby Central][2] administers a [Regional Conference Grant Program][6], @@ -59,19 +53,8 @@ Virginia, Maryland, and Washington, DC areas. Ruby on Rails. The Chicago-based conference has served the Ruby community since 2008. -[Madison Ruby][15]: Madison, WI - [Steel City Ruby][16]: Pittsburg, PA -[Ruby on Ales][17] is an annual two-day conference inspired by Ruby, microbrews, -and snow. Listen to engaging speakers, enjoy delicious food and enjoy the -wonderful scenery around Bend Oregon. - -[Burlington Ruby Conference][18]: A summertime Ruby conference that happens -annually in Burlington, VT. The conference is two days long and follows a -single track. The focus of the conference is on creating an environment to -learn, have fun and meet fellow Rubyists. - [GoRuCo][19]: New York City's annual Ruby conference. A one-day single-track conference. [DeccanRubyConf][20]: Pune's (India) annual Ruby conference, @@ -95,7 +78,6 @@ O’Reilly), and Canada on Rails. [2]: http://rubycentral.org [3]: http://rubykaigi.org/ [4]: http://euruko.org -[5]: http://www.osdc.com.au/ [6]: http://rubycentral.org/community/grant [7]: http://www.svforum.org [8]: http://rubynation.org/ @@ -105,9 +87,6 @@ O’Reilly), and Canada on Rails. [12]: http://www.railsconf.org [13]: http://europe.railsconf.org [14]: http://www.skillsmatter.com -[15]: http://madisonruby.org/ [16]: http://steelcityruby.org/ -[17]: http://ruby.onales.com/ -[18]: http://burlingtonrubyconference.com [19]: http://goruco.com/ [20]: http://www.deccanrubyconf.org/ From 69b5892bf6c65d2d8bf3b25e8581189bc3dc21db Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Fri, 8 Mar 2019 22:47:51 +0100 Subject: [PATCH 1026/3171] Simplify build matrix for Travis CI --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80bf6d60ba..0cc0fa0c01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,9 @@ sudo: false rvm: 2.6.1 cache: bundler env: - matrix: - - SCRIPT="bundle exec rake build" - - SCRIPT="bundle exec rake test" -script: $SCRIPT + - TASK=build + - TASK=test +script: bundle exec rake $TASK # Notifications, used by our Gitter channel. notifications: webhooks: From 32f55d6f8b47ba0263fa30cf3525942745fd24ae Mon Sep 17 00:00:00 2001 From: Sho Hashimoto Date: Sun, 10 Mar 2019 16:56:01 +0900 Subject: [PATCH 1027/3171] Add a link to rurema for Ruby 2.6.0 (ja) --- ja/documentation/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ja/documentation/index.md b/ja/documentation/index.md index 67df7719cd..c179abf26a 100644 --- a/ja/documentation/index.md +++ b/ja/documentation/index.md @@ -23,6 +23,7 @@ Rubyでプログラミングする際に役立つドキュメントを紹介し * [Rubyリファレンスマニュアル Ruby 2.3.0版][man-230] * [Rubyリファレンスマニュアル Ruby 2.4.0版][man-240] * [Rubyリファレンスマニュアル Ruby 2.5.0版][man-250] +* [Rubyリファレンスマニュアル Ruby 2.6.0版][man-260] * [るりまサーチ][man-search] またこのリファレンスマニュアルをまとめてダウンロードすることもできます。 @@ -117,6 +118,7 @@ Posted by Shugo Maeda on 26 May 2006 [man-230]: https://docs.ruby-lang.org/ja/2.3.0/doc/index.html [man-240]: https://docs.ruby-lang.org/ja/2.4.0/doc/index.html [man-250]: https://docs.ruby-lang.org/ja/2.5.0/doc/index.html +[man-260]: https://docs.ruby-lang.org/ja/2.6.0/doc/index.html [man-search]: https://docs.ruby-lang.org/ja/search/ [man-xz]: https://cache.ruby-lang.org/pub/ruby/doc/ruby-refm-1.9.3-dynamic-20120829.tar.xz [man-gz]: https://cache.ruby-lang.org/pub/ruby/doc/ruby-refm-1.9.3-dynamic-20120829.tar.gz From 7b7bdec0c17663ebdcfb6c0ce8be4293589f587b Mon Sep 17 00:00:00 2001 From: Sho Hashimoto Date: Mon, 11 Mar 2019 09:42:24 +0900 Subject: [PATCH 1028/3171] Change listing order. Make newer versions upper. --- ja/documentation/index.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ja/documentation/index.md b/ja/documentation/index.md index c179abf26a..d1efc17c4a 100644 --- a/ja/documentation/index.md +++ b/ja/documentation/index.md @@ -15,15 +15,15 @@ Rubyでプログラミングする際に役立つドキュメントを紹介し また、現在有志の手により[リファレンスマニュアルの整備][rurema-wiki]が進行中です。 成果物を[<URL:https://docs.ruby-lang.org/ja/>][doc-r-l-o]から閲覧できます。 -* [Rubyリファレンスマニュアル Ruby 1.8.7版][man-187] -* [Rubyリファレンスマニュアル Ruby 1.9.3版][man-193] -* [Rubyリファレンスマニュアル Ruby 2.0.0版][man-200] -* [Rubyリファレンスマニュアル Ruby 2.1.0版][man-210] -* [Rubyリファレンスマニュアル Ruby 2.2.0版][man-220] -* [Rubyリファレンスマニュアル Ruby 2.3.0版][man-230] -* [Rubyリファレンスマニュアル Ruby 2.4.0版][man-240] -* [Rubyリファレンスマニュアル Ruby 2.5.0版][man-250] * [Rubyリファレンスマニュアル Ruby 2.6.0版][man-260] +* [Rubyリファレンスマニュアル Ruby 2.5.0版][man-250] +* [Rubyリファレンスマニュアル Ruby 2.4.0版][man-240] +* [Rubyリファレンスマニュアル Ruby 2.3.0版][man-230] +* [Rubyリファレンスマニュアル Ruby 2.2.0版][man-220] +* [Rubyリファレンスマニュアル Ruby 2.1.0版][man-210] +* [Rubyリファレンスマニュアル Ruby 2.0.0版][man-200] +* [Rubyリファレンスマニュアル Ruby 1.9.3版][man-193] +* [Rubyリファレンスマニュアル Ruby 1.8.7版][man-187] * [るりまサーチ][man-search] またこのリファレンスマニュアルをまとめてダウンロードすることもできます。 From 02464a8ca9391fece68eef26855eb99caf902b83 Mon Sep 17 00:00:00 2001 From: jacobherrington Date: Mon, 11 Mar 2019 01:36:14 -0500 Subject: [PATCH 1029/3171] Add a CTA to the podcasts page I really like the "Spreading the Word" CTA on the Ruby blogs page and wanted to add something similar to the podcasts page. --- en/community/podcasts/index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/en/community/podcasts/index.md b/en/community/podcasts/index.md index 187c76cafe..ae67b44f8c 100644 --- a/en/community/podcasts/index.md +++ b/en/community/podcasts/index.md @@ -14,5 +14,12 @@ Listen to news, interviews, and discussions about Ruby and its community. : The Ruby on Rails Podcast, a weekly conversation about Ruby on Rails, open source software, and the programming profession. +### Getting Involved + +Podcast hosts are always looking for guests. If you have some Ruby +wisdom to share, get in touch with the creators of these shows. + +You can also start your own Ruby podcast and get added to this list! + [rorpodcast]: http://5by5.tv/rubyonrails [rogues]: https://devchat.tv/ruby-rogues From 0116d24224abcb9b5dbfcc1db0a58cbffdf8c526 Mon Sep 17 00:00:00 2001 From: jacobherrington Date: Mon, 11 Mar 2019 01:45:43 -0500 Subject: [PATCH 1030/3171] Improve podcast section copy The phrasing for this was a little confusing and there were one or two grammar issues. --- en/community/index.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/en/community/index.md b/en/community/index.md index 2c2fc2a80d..95f0b2dda7 100644 --- a/en/community/index.md +++ b/en/community/index.md @@ -43,9 +43,10 @@ to start: the Ruby community. [Podcasts](podcasts/) -: If you like to hear about Ruby rather than read about you can listen - to podcasts which cover new Ruby or gem releases, interviews and - discussions between Ruby programmers, contributors, and maintainers. +: If you prefer to listen to discussions about Ruby rather than read, + you can tune into one of these awesome Ruby podcasts. These Rubyists + use their podcasts to cover new releases, community news, and + interview their fellow Ruby developers. General Ruby Information : * [Ruby Central][ruby-central] From 7560b1bdda368f683ff9d819fe8a225f6df4fa55 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Mon, 11 Mar 2019 20:31:04 +0100 Subject: [PATCH 1031/3171] Remove dead link to MORPHA The site of the MORPHA project is no longer available under this URL and the domain is not even related to the project anymore. Closes #1845 --- bg/documentation/success-stories/index.md | 3 +-- de/documentation/success-stories/index.md | 3 +-- en/documentation/success-stories/index.md | 3 +-- fr/documentation/success-stories/index.md | 3 +-- id/documentation/success-stories/index.md | 3 +-- it/documentation/success-stories/index.md | 3 +-- ko/documentation/success-stories/index.md | 3 +-- pl/documentation/success-stories/index.md | 3 +-- pt/documentation/success-stories/index.md | 3 +-- ru/documentation/success-stories/index.md | 3 +-- tr/documentation/success-stories/index.md | 3 +-- vi/documentation/success-stories/index.md | 3 +-- zh_cn/documentation/success-stories/index.md | 3 +-- zh_tw/documentation/success-stories/index.md | 3 +-- 14 files changed, 14 insertions(+), 28 deletions(-) diff --git a/bg/documentation/success-stories/index.md b/bg/documentation/success-stories/index.md index f1cdba4f57..9a80b7cf16 100644 --- a/bg/documentation/success-stories/index.md +++ b/bg/documentation/success-stories/index.md @@ -29,7 +29,7 @@ lang: bg #### Роботика -* В [MORPHA][5] се използва Ruby за имплементирането на реактивната +* В MORPHA се използва Ruby за имплементирането на реактивната контролна част за сервизния робот на Siemens. #### Мрежи @@ -62,7 +62,6 @@ lang: bg [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/de/documentation/success-stories/index.md b/de/documentation/success-stories/index.md index 153c738587..9a519f194f 100644 --- a/de/documentation/success-stories/index.md +++ b/de/documentation/success-stories/index.md @@ -23,7 +23,7 @@ Projekten, die Ruby nutzen. #### Robotics -* Im [MORPHA][3] Projekt, wurde Ruby eingesetzt, um für den Siemens +* Im MORPHA Projekt, wurde Ruby eingesetzt, um für den Siemens Service Roboter die Reaktionskontrolle zu implementieren. #### Netzwerke @@ -57,7 +57,6 @@ Projekten, die Ruby nutzen. [1]: http://www.motorola.com [2]: https://www.uhn.ca/TorontoRehab -[3]: http://www.morpha.de/php_d/index.php3 [4]: http://ods.org/ [5]: http://www.lucent.com/ [6]: http://www.level3.com/ diff --git a/en/documentation/success-stories/index.md b/en/documentation/success-stories/index.md index 8653e81217..5d8d4454ab 100644 --- a/en/documentation/success-stories/index.md +++ b/en/documentation/success-stories/index.md @@ -28,7 +28,7 @@ you’ll find a small sample of real world usage of Ruby. #### Robotics -* At [MORPHA][5] project, Ruby was used to implement the reactive +* At MORPHA project, Ruby was used to implement the reactive control part for the Siemens service robot. #### Networking @@ -77,7 +77,6 @@ you’ll find a small sample of real world usage of Ruby. [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/fr/documentation/success-stories/index.md b/fr/documentation/success-stories/index.md index fc36e61b01..2d2dc34bb7 100644 --- a/fr/documentation/success-stories/index.md +++ b/fr/documentation/success-stories/index.md @@ -31,7 +31,7 @@ témoignages du « monde réel. » #### Robotique -* Le projet [MORPHA][6] a utilisé Ruby pour implémenter la partie de +* Le projet MORPHA a utilisé Ruby pour implémenter la partie de contrôle réactif du robot de service Siemens. #### Réseaux @@ -66,7 +66,6 @@ témoignages du « monde réel. » [3]: http://www.motorola.com [4]: http://www.sketchup.com/ [5]: https://www.uhn.ca/TorontoRehab -[6]: http://www.morpha.de/php_e/index.php3 [7]: http://ods.org/ [8]: http://www.lucent.com/ [9]: http://www.level3.com/ diff --git a/id/documentation/success-stories/index.md b/id/documentation/success-stories/index.md index 0acf8425b9..7c1bb96279 100644 --- a/id/documentation/success-stories/index.md +++ b/id/documentation/success-stories/index.md @@ -31,7 +31,7 @@ kecil contoh dari berbagai penggunaan Ruby di dunia nyata. #### Robotika -* Proyek [MORPHA][5] menggunakan Ruby untuk mengimplementasikan bagian +* Proyek MORPHA menggunakan Ruby untuk mengimplementasikan bagian pengendali reaktif dari robot Siemens yang digunakan. #### Jaringan Komputer @@ -81,7 +81,6 @@ kecil contoh dari berbagai penggunaan Ruby di dunia nyata. [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/it/documentation/success-stories/index.md b/it/documentation/success-stories/index.md index 5533d2f9fb..91ae4d2bf2 100644 --- a/it/documentation/success-stories/index.md +++ b/it/documentation/success-stories/index.md @@ -29,7 +29,7 @@ alcuni esempi reali di come viene utilizzato Ruby nel mondo. #### Robotica -* Il progetto [MORPHA][5] utilizza Ruby per implementare il controllo +* Il progetto MORPHA utilizza Ruby per implementare il controllo della reattività dei componenti della Simens service robot. #### Networking @@ -75,7 +75,6 @@ alcuni esempi reali di come viene utilizzato Ruby nel mondo. [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/ko/documentation/success-stories/index.md b/ko/documentation/success-stories/index.md index 9fcc4a17af..6cf55108dc 100644 --- a/ko/documentation/success-stories/index.md +++ b/ko/documentation/success-stories/index.md @@ -28,7 +28,7 @@ lang: ko #### 로봇공학 -* [MORPHA][5] 프로젝트에서는, 루비는 Siemens 서비스 로봇의 반응 컨트롤 +* MORPHA 프로젝트에서는, 루비는 Siemens 서비스 로봇의 반응 컨트롤 부분에 사용되고 있습니다. #### 네트워킹 @@ -72,7 +72,6 @@ lang: ko [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/pl/documentation/success-stories/index.md b/pl/documentation/success-stories/index.md index e4da876efa..642b738b07 100644 --- a/pl/documentation/success-stories/index.md +++ b/pl/documentation/success-stories/index.md @@ -25,7 +25,7 @@ Rubiego w rzeczywistości. #### Robotyka -* W projekcie [MORPHA][5] , Ruby został użyty do implementacji systemu +* W projekcie MORPHA, Ruby został użyty do implementacji systemu kontroli reakcji Robota usługowego firmy Siemens. #### Sieci @@ -83,7 +83,6 @@ Rubiego w rzeczywistości. [2]: http://www-106.ibm.com/developerworks/linux/library/l-oslab/ [3]: http://www.motorola.com [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/pt/documentation/success-stories/index.md b/pt/documentation/success-stories/index.md index 478a6c120e..ad17dddc0d 100644 --- a/pt/documentation/success-stories/index.md +++ b/pt/documentation/success-stories/index.md @@ -29,7 +29,7 @@ Aqui você encontrará uma pequena amostra do uso de Ruby no mundo real. #### Robótica -* No projeto [MORPHA][5] , Ruby foi usado para implementar a parte do +* No projeto MORPHA, Ruby foi usado para implementar a parte do controle reativo do robô de serviços da Siemens. #### Redes @@ -76,7 +76,6 @@ Aqui você encontrará uma pequena amostra do uso de Ruby no mundo real. [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/ru/documentation/success-stories/index.md b/ru/documentation/success-stories/index.md index 62923d6aa6..43d933a77f 100644 --- a/ru/documentation/success-stories/index.md +++ b/ru/documentation/success-stories/index.md @@ -31,7 +31,7 @@ lang: ru #### Робототехника -* В проекте [MORPHA][5], Ruby был задействован для создания реактивных +* В проекте MORPHA, Ruby был задействован для создания реактивных элементов управления для обслуживающего робота Siemens. #### Сеть @@ -79,7 +79,6 @@ lang: ru [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/tr/documentation/success-stories/index.md b/tr/documentation/success-stories/index.md index e20ecc1ede..a7eb918993 100644 --- a/tr/documentation/success-stories/index.md +++ b/tr/documentation/success-stories/index.md @@ -30,7 +30,7 @@ olarak. Burada Ruby’nin gerçek dünyadan örneklerini görebilirsiniz. #### Robotik -* [MORPHA][4] projesinde, Ruby Siemens servis robotunun reaktif denetim +* MORPHA projesinde, Ruby Siemens servis robotunun reaktif denetim kısmını uygulamak için kullanıldı. #### Ağ @@ -76,7 +76,6 @@ olarak. Burada Ruby’nin gerçek dünyadan örneklerini görebilirsiniz. [1]: http://www.larc.nasa.gov/ [2]: http://www.sketchup.com/ [3]: https://www.uhn.ca/TorontoRehab -[4]: http://www.morpha.de/php_e/index.php3 [5]: http://ods.org/ [6]: http://www.lucent.com/ [7]: http://www.level3.com/ diff --git a/vi/documentation/success-stories/index.md b/vi/documentation/success-stories/index.md index 74ff0418e9..94de3eed89 100644 --- a/vi/documentation/success-stories/index.md +++ b/vi/documentation/success-stories/index.md @@ -29,7 +29,7 @@ nó như thứ tiêu khiển. Trong trang này, bạn sẽ tìm thấy những v #### Robotics -* Dự án [MORPHA][5] dùng Ruby để triển khai phần tương tác phản hồi của cho rô-bô dịch vụ của Siemens. +* Dự án MORPHA dùng Ruby để triển khai phần tương tác phản hồi của cho rô-bô dịch vụ của Siemens. #### Mạng @@ -71,7 +71,6 @@ nó như thứ tiêu khiển. Trong trang này, bạn sẽ tìm thấy những v [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/zh_cn/documentation/success-stories/index.md b/zh_cn/documentation/success-stories/index.md index 7e4eef219b..68c1ea752d 100644 --- a/zh_cn/documentation/success-stories/index.md +++ b/zh_cn/documentation/success-stories/index.md @@ -25,7 +25,7 @@ lang: zh_cn #### 机器人学 -* 在 [MORPHA][5] 项目,Ruby 用来实现西门子服务机器人的反应控制部分。 +* 在 MORPHA 项目,Ruby 用来实现西门子服务机器人的反应控制部分。 #### 网络 @@ -57,7 +57,6 @@ lang: zh_cn [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ diff --git a/zh_tw/documentation/success-stories/index.md b/zh_tw/documentation/success-stories/index.md index 133231a99c..a273b7b706 100644 --- a/zh_tw/documentation/success-stories/index.md +++ b/zh_tw/documentation/success-stories/index.md @@ -23,7 +23,7 @@ lang: zh_tw #### 機器人 -* 在 [MORPHA][5] 計畫中,使用 Ruby 來實作西門子公司服務型機器人的反應控制部份。 +* 在 MORPHA 計畫中,使用 Ruby 來實作西門子公司服務型機器人的反應控制部份。 #### 網路 @@ -52,7 +52,6 @@ lang: zh_tw [2]: http://www.motorola.com [3]: http://www.sketchup.com/ [4]: https://www.uhn.ca/TorontoRehab -[5]: http://www.morpha.de/php_e/index.php3 [6]: http://ods.org/ [7]: http://www.lucent.com/ [8]: http://www.level3.com/ From 6076694972892cb1a1693134fee72b0be5f33a7c Mon Sep 17 00:00:00 2001 From: Chikanaga Tomoyuki Date: Wed, 13 Mar 2019 19:33:32 +0900 Subject: [PATCH 1032/3171] Add fixed rubygems version 2.7.6.2 in Workarounds section. --- .../_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md index 1775225dc9..8378d66196 100644 --- a/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md +++ b/en/news/_posts/2019-03-05-multiple-vulnerabilities-in-rubygems.md @@ -33,7 +33,7 @@ It is strongly recommended for Ruby users to take one of the following workaroun ## Workarounds -RubyGems 2.7.9/3.0.3 or later includes the fix for the vulnerabilities, so upgrade RubyGems to the latest version. +RubyGems 2.7.6.2/2.7.9/3.0.3 or later includes the fix for the vulnerabilities, so upgrade RubyGems to the latest version. ``` gem update --system From ed3a28378a37f6b40ef06de5a4e80795e79c2462 Mon Sep 17 00:00:00 2001 From: Chikanaga Tomoyuki Date: Wed, 13 Mar 2019 19:38:34 +0900 Subject: [PATCH 1033/3171] Add release notes for ruby 2.5.4. --- .../_posts/2019-03-13-ruby-2-5-4-released.md | 53 +++++++++++++++++++ .../_posts/2019-03-13-ruby-2-5-4-released.md | 49 +++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 en/news/_posts/2019-03-13-ruby-2-5-4-released.md create mode 100644 ja/news/_posts/2019-03-13-ruby-2-5-4-released.md diff --git a/en/news/_posts/2019-03-13-ruby-2-5-4-released.md b/en/news/_posts/2019-03-13-ruby-2-5-4-released.md new file mode 100644 index 0000000000..d2152fed28 --- /dev/null +++ b/en/news/_posts/2019-03-13-ruby-2-5-4-released.md @@ -0,0 +1,53 @@ +--- +layout: news_post +title: "Ruby 2.5.4 Released" +author: "nagachika" +translator: +date: 2019-03-13 11:30:00 +0000 +lang: en +--- + +Ruby 2.5.4 has been released. + +This release includes some bug fixes and update of bundled rubygems which contains some secirity fiexes. +See details in [Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/). + +There are also some bug fixes. +See the [commit logs](https://github.com/ruby/ruby/compare/v2_5_3...v2_5_4) +for more details. + +## Download + +* + + SIZE: 14167366 bytes + SHA1: ac3248a055b5317cec53d3f922559c5b4a67d410 + SHA256: 8a16566207b2334a6904a10a1f093befc3aaf9b2e6cf01c62b1c4ac15cb7d8fc + SHA512: 3c4f54f38ee50914a44d07e4fd299e53dddd045f2d38da2140586b8a9c45d1172fec2ad5b0411c228a9b31f5e161214820903a65b98caf3b0dfeeaabf2cab6ad + +* + + SIZE: 15995815 bytes + SHA1: 330bb5472f565b683c7f8c9091d4ee0cc155b51b + SHA256: 0e4042bce749352dfcf1b9e3013ba7c078b728f51f8adaf6470ce37675e3cb1f + SHA512: 6e58006c30d8ae561967e051ec0a34f34f899eee1b039abb65c9a63dc65965e210d238fff19fa7c7411893df25dfc40426887a195993153fb9e09bbf769dfc14 + +* + + SIZE: 11493016 bytes + SHA1: 221b8538e75a8d04af8b9a09f56343e463bf94f8 + SHA256: 46f6eff655a6be1939f70c7a4c1bf58f76663e7e804738bc52f4d47ca31dee3d + SHA512: e72294e549d09510f20c808d26a0d21ef0ee2616d8598980a42db260d45340e5c259ac65e5478a8b086042ff6ba7d8447a6c8115454ffe977c4f63175ab89062 + +* + + SIZE: 19186174 bytes + SHA1: 855be9a5a43a1e0621ad2e81c27de9370d2abcc8 + SHA256: 823a6a2c9c7baa18554fd78d430837a01ab33cc16ad1759c9842bdd9523e9cea + SHA512: a83f90514b09c217fbbd154cfc09c804553353a97cbff7df24185b613e1c7be69a965fe9ec925ac3f4bd6170f2c3d0d60be7ea4ab1037ce64300d7443b6e08e8 + +## Release Comment + +Many committers, developers, and users who provided bug reports helped +us to make this release. +Thanks for their contributions. diff --git a/ja/news/_posts/2019-03-13-ruby-2-5-4-released.md b/ja/news/_posts/2019-03-13-ruby-2-5-4-released.md new file mode 100644 index 0000000000..478e5c6ef4 --- /dev/null +++ b/ja/news/_posts/2019-03-13-ruby-2-5-4-released.md @@ -0,0 +1,49 @@ +--- +layout: news_post +title: "Ruby 2.5.4 リリース" +author: "nagachika" +translator: +date: 2019-03-13 11:30:00 +0000 +lang: ja +--- + +Ruby 2.5.4 がリリースされました。 + +このリリースには同梱しているRubyGemsの脆弱性修正が含まれています。 +詳細は[Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/)を参照してください。 + +その他いくつかの不具合修正も含まれます。詳細は [commit log](https://github.com/ruby/ruby/compare/v2_5_3...v2_5_4) を参照してください。 + +## ダウンロード + +* + + SIZE: 14167366 bytes + SHA1: ac3248a055b5317cec53d3f922559c5b4a67d410 + SHA256: 8a16566207b2334a6904a10a1f093befc3aaf9b2e6cf01c62b1c4ac15cb7d8fc + SHA512: 3c4f54f38ee50914a44d07e4fd299e53dddd045f2d38da2140586b8a9c45d1172fec2ad5b0411c228a9b31f5e161214820903a65b98caf3b0dfeeaabf2cab6ad + +* + + SIZE: 15995815 bytes + SHA1: 330bb5472f565b683c7f8c9091d4ee0cc155b51b + SHA256: 0e4042bce749352dfcf1b9e3013ba7c078b728f51f8adaf6470ce37675e3cb1f + SHA512: 6e58006c30d8ae561967e051ec0a34f34f899eee1b039abb65c9a63dc65965e210d238fff19fa7c7411893df25dfc40426887a195993153fb9e09bbf769dfc14 + +* + + SIZE: 11493016 bytes + SHA1: 221b8538e75a8d04af8b9a09f56343e463bf94f8 + SHA256: 46f6eff655a6be1939f70c7a4c1bf58f76663e7e804738bc52f4d47ca31dee3d + SHA512: e72294e549d09510f20c808d26a0d21ef0ee2616d8598980a42db260d45340e5c259ac65e5478a8b086042ff6ba7d8447a6c8115454ffe977c4f63175ab89062 + +* + + SIZE: 19186174 bytes + SHA1: 855be9a5a43a1e0621ad2e81c27de9370d2abcc8 + SHA256: 823a6a2c9c7baa18554fd78d430837a01ab33cc16ad1759c9842bdd9523e9cea + SHA512: a83f90514b09c217fbbd154cfc09c804553353a97cbff7df24185b613e1c7be69a965fe9ec925ac3f4bd6170f2c3d0d60be7ea4ab1037ce64300d7443b6e08e8 + +## リリースコメント + +このリリースにあたり、多くのコミッター、開発者、バグ報告をしてくれたユーザーの皆様に感謝を申し上げます。 From 20a399fd447b20b35e3cebd20a20edb95d6515f4 Mon Sep 17 00:00:00 2001 From: Chikanaga Tomoyuki Date: Wed, 13 Mar 2019 19:42:41 +0900 Subject: [PATCH 1034/3171] Update _data/releases.yml and _data/downloads.yml --- _data/downloads.yml | 2 +- _data/releases.yml | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/_data/downloads.yml b/_data/downloads.yml index 994e336d29..7d80f6595f 100644 --- a/_data/downloads.yml +++ b/_data/downloads.yml @@ -8,7 +8,7 @@ preview: stable: - 2.6.1 - - 2.5.3 + - 2.5.4 - 2.4.5 # optional diff --git a/_data/releases.yml b/_data/releases.yml index 23fe0818b9..3ffa49b536 100644 --- a/_data/releases.yml +++ b/_data/releases.yml @@ -121,6 +121,20 @@ # 2.5 series +- version: 2.5.4 + date: 2019-03-13 + post: /en/news/2019/03/13/ruby-2-5-4-released/ + url: + bz2: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.4.tar.bz2 + gz: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.4.tar.gz + xz: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.4.tar.xz + zip: https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.4.zip + sha256: + bz2: 8a16566207b2334a6904a10a1f093befc3aaf9b2e6cf01c62b1c4ac15cb7d8fc + gz: 0e4042bce749352dfcf1b9e3013ba7c078b728f51f8adaf6470ce37675e3cb1f + xz: 46f6eff655a6be1939f70c7a4c1bf58f76663e7e804738bc52f4d47ca31dee3d + zip: 823a6a2c9c7baa18554fd78d430837a01ab33cc16ad1759c9842bdd9523e9cea + - version: 2.5.3 date: 2018-10-18 post: /en/news/2018/10/18/ruby-2-5-3-released/ From dced8d87d3981db3f4981a814326530e3232a1db Mon Sep 17 00:00:00 2001 From: Chikanaga Tomoyuki Date: Wed, 13 Mar 2019 19:58:13 +0900 Subject: [PATCH 1035/3171] Fix typos. --- en/news/_posts/2019-03-13-ruby-2-5-4-released.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/en/news/_posts/2019-03-13-ruby-2-5-4-released.md b/en/news/_posts/2019-03-13-ruby-2-5-4-released.md index d2152fed28..e5a6e704b2 100644 --- a/en/news/_posts/2019-03-13-ruby-2-5-4-released.md +++ b/en/news/_posts/2019-03-13-ruby-2-5-4-released.md @@ -9,12 +9,9 @@ lang: en Ruby 2.5.4 has been released. -This release includes some bug fixes and update of bundled rubygems which contains some secirity fiexes. -See details in [Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/). - -There are also some bug fixes. -See the [commit logs](https://github.com/ruby/ruby/compare/v2_5_3...v2_5_4) -for more details. +This release includes bug fixes and security update of bundled RubyGems. +See details in [Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/) +and [commit logs](https://github.com/ruby/ruby/compare/v2_5_3...v2_5_4). ## Download @@ -49,5 +46,5 @@ for more details. ## Release Comment Many committers, developers, and users who provided bug reports helped -us to make this release. +us make this release. Thanks for their contributions. From 1c8a85805eb027320dc2119d2ce5eb1cff9ad334 Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Wed, 13 Mar 2019 20:08:34 +0900 Subject: [PATCH 1036/3171] Ruby 2.6.2 released --- _data/downloads.yml | 2 +- _data/releases.yml | 14 ++++++ .../_posts/2019-03-13-ruby-2-6-2-released.md | 48 +++++++++++++++++++ .../_posts/2019-03-13-ruby-2-6-2-released.md | 46 ++++++++++++++++++ 4 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 en/news/_posts/2019-03-13-ruby-2-6-2-released.md create mode 100644 ja/news/_posts/2019-03-13-ruby-2-6-2-released.md diff --git a/_data/downloads.yml b/_data/downloads.yml index 7d80f6595f..7c5a63b8c0 100644 --- a/_data/downloads.yml +++ b/_data/downloads.yml @@ -7,7 +7,7 @@ preview: stable: - - 2.6.1 + - 2.6.2 - 2.5.4 - 2.4.5 diff --git a/_data/releases.yml b/_data/releases.yml index 3ffa49b536..6dcbef9bdd 100644 --- a/_data/releases.yml +++ b/_data/releases.yml @@ -21,6 +21,20 @@ # 2.6 series +- version: 2.6.2 + date: 2019-03-13 + post: /en/news/2019/03/13/ruby-2-6-2-released/ + url: + gz: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.2.tar.gz + zip: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.2.zip + bz2: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.2.tar.bz2 + xz: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.2.tar.xz + sha256: + gz: a0405d2bf2c2d2f332033b70dff354d224a864ab0edd462b7a413420453b49ab + zip: 65b862e5c86346d6bda05fc193c6f2cd728ddfd357f4b0a19d54d48a50984d13 + bz2: d126ada7f4147ce1029a80c2a37a0c4bfb37e9e82da8816662241a43faeb8915 + xz: 91fcde77eea8e6206d775a48ac58450afe4883af1a42e5b358320beb33a445fa + - version: 2.6.1 date: 2019-01-30 post: /en/news/2019/01/30/ruby-2-6-1-released/ diff --git a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md new file mode 100644 index 0000000000..53154f1075 --- /dev/null +++ b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md @@ -0,0 +1,48 @@ +--- +layout: news_post +title: "Ruby 2.6.2 Released" +author: "nagachika" +translator: +date: 2019-03-13 11:30:00 +0000 +lang: en +--- + +Ruby 2.6.2 has been released. + +This release includes bug fixes and security update of bundled RubyGems. + +See details in [Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/) +and [commit logs](https://github.com/ruby/ruby/compare/v2_6_1...v2.6.2). + +## Download + +* + + SIZE: 16777765 bytes + SHA1: 44c6634a41f63ebdc1f3ce6ddcf48a4766bb4df7 + SHA256: a0405d2bf2c2d2f332033b70dff354d224a864ab0edd462b7a413420453b49ab + SHA512: bc96a6793a1e3111598b82b0aad98dc5b465e39cdb5b788c4259818752e028a44545c6489c02c323db0f43a362c26f0900acfba0277d6e2201587d7252f6125f +* + + SIZE: 20601169 bytes + SHA1: fce5c289842e6e4c4bc7950214d82c0858086baa + SHA256: 65b862e5c86346d6bda05fc193c6f2cd728ddfd357f4b0a19d54d48a50984d13 + SHA512: 60ccabbca50d51186b6715edcd8e4fa704e8b9159a23f073e8d3aafef3858a98ade416156af94a479d1af5555c4c4b5b71267f0f563a518e5e6112ce9921bb8b +* + + SIZE: 14634343 bytes + SHA1: 5839fc6e6568ac4f26a20382bd8fe0d998dffbb0 + SHA256: d126ada7f4147ce1029a80c2a37a0c4bfb37e9e82da8816662241a43faeb8915 + SHA512: cad678d2ced4085e99009e4fef83c067dd0e6ead27a8695bc212c0e5112a7fa09ceb27f82638faf91932ef8bdd090f844e0a878ffdf6845a891da4b858588aa0 +* + + SIZE: 11889840 bytes + SHA1: b7b3432519f80ea50adc9bfb937c7a46865a93d5 + SHA256: 91fcde77eea8e6206d775a48ac58450afe4883af1a42e5b358320beb33a445fa + SHA512: 13f7d7b483a037378eac4bf4bebddc21d69f4e19e6bbb397dd53e7518037ae9a3aa5b41fc20bf1fe410803c6efc3a6a65a65af47648d3a93713f75cfe885326a + +## Release Comment + +Many committers, developers, and users who provided bug reports helped +us make this release. +Thanks for their contributions. diff --git a/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md b/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md new file mode 100644 index 0000000000..b9f9a0872c --- /dev/null +++ b/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md @@ -0,0 +1,46 @@ +--- +layout: news_post +title: "Ruby 2.6.2 リリース" +author: "naruse" +translator: +date: 2019-03-13 11:30:00 +0000 +lang: ja +--- + +Ruby 2.6.2 がリリースされました。 + +このリリースには同梱しているRubyGemsの脆弱性修正が含まれています。 +詳細は[Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/)を参照してください。 + +その他いくつかの不具合修正も含まれます。詳細は [commit log](https://github.com/ruby/ruby/compare/v2_6_1...v2.6.2) を参照してください。 + +## ダウンロード + +* + + SIZE: 16777765 bytes + SHA1: 44c6634a41f63ebdc1f3ce6ddcf48a4766bb4df7 + SHA256: a0405d2bf2c2d2f332033b70dff354d224a864ab0edd462b7a413420453b49ab + SHA512: bc96a6793a1e3111598b82b0aad98dc5b465e39cdb5b788c4259818752e028a44545c6489c02c323db0f43a362c26f0900acfba0277d6e2201587d7252f6125f +* + + SIZE: 20601169 bytes + SHA1: fce5c289842e6e4c4bc7950214d82c0858086baa + SHA256: 65b862e5c86346d6bda05fc193c6f2cd728ddfd357f4b0a19d54d48a50984d13 + SHA512: 60ccabbca50d51186b6715edcd8e4fa704e8b9159a23f073e8d3aafef3858a98ade416156af94a479d1af5555c4c4b5b71267f0f563a518e5e6112ce9921bb8b +* + + SIZE: 14634343 bytes + SHA1: 5839fc6e6568ac4f26a20382bd8fe0d998dffbb0 + SHA256: d126ada7f4147ce1029a80c2a37a0c4bfb37e9e82da8816662241a43faeb8915 + SHA512: cad678d2ced4085e99009e4fef83c067dd0e6ead27a8695bc212c0e5112a7fa09ceb27f82638faf91932ef8bdd090f844e0a878ffdf6845a891da4b858588aa0 +* + + SIZE: 11889840 bytes + SHA1: b7b3432519f80ea50adc9bfb937c7a46865a93d5 + SHA256: 91fcde77eea8e6206d775a48ac58450afe4883af1a42e5b358320beb33a445fa + SHA512: 13f7d7b483a037378eac4bf4bebddc21d69f4e19e6bbb397dd53e7518037ae9a3aa5b41fc20bf1fe410803c6efc3a6a65a65af47648d3a93713f75cfe885326a + +## リリースコメント + +このリリースにあたり、多くのコミッター、開発者、バグ報告をしてくれたユーザーの皆様に感謝を申し上げます。 From e218bf24326b177270bc1ae102bb2fdc704fda65 Mon Sep 17 00:00:00 2001 From: nagachika Date: Wed, 13 Mar 2019 20:16:06 +0900 Subject: [PATCH 1037/3171] Update en/news/_posts/2019-03-13-ruby-2-6-2-released.md fix author Co-Authored-By: nurse --- en/news/_posts/2019-03-13-ruby-2-6-2-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md index 53154f1075..eec037ea6c 100644 --- a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md +++ b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md @@ -1,7 +1,7 @@ --- layout: news_post title: "Ruby 2.6.2 Released" -author: "nagachika" +author: "naruse" translator: date: 2019-03-13 11:30:00 +0000 lang: en From da7c635db790d6ed246ce2883b5ba116a1591cb5 Mon Sep 17 00:00:00 2001 From: Chikanaga Tomoyuki Date: Wed, 13 Mar 2019 21:24:58 +0900 Subject: [PATCH 1038/3171] Fix typo in commit log links. --- en/news/_posts/2019-03-13-ruby-2-6-2-released.md | 2 +- ja/news/_posts/2019-03-13-ruby-2-6-2-released.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md index eec037ea6c..ec615c91a8 100644 --- a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md +++ b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md @@ -12,7 +12,7 @@ Ruby 2.6.2 has been released. This release includes bug fixes and security update of bundled RubyGems. See details in [Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/) -and [commit logs](https://github.com/ruby/ruby/compare/v2_6_1...v2.6.2). +and [commit logs](https://github.com/ruby/ruby/compare/v2_6_1...v2_6_2). ## Download diff --git a/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md b/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md index b9f9a0872c..e18d555cb9 100644 --- a/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md +++ b/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md @@ -12,7 +12,7 @@ Ruby 2.6.2 がリリースされました。 このリリースには同梱しているRubyGemsの脆弱性修正が含まれています。 詳細は[Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/)を参照してください。 -その他いくつかの不具合修正も含まれます。詳細は [commit log](https://github.com/ruby/ruby/compare/v2_6_1...v2.6.2) を参照してください。 +その他いくつかの不具合修正も含まれます。詳細は [commit log](https://github.com/ruby/ruby/compare/v2_6_1...v2_6_2) を参照してください。 ## ダウンロード From 38e65bfa5a49cc8d068757d95609bb1b5355c2d7 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Wed, 13 Mar 2019 14:40:43 +0100 Subject: [PATCH 1039/3171] Add newlines --- en/news/_posts/2019-03-13-ruby-2-6-2-released.md | 3 +++ ja/news/_posts/2019-03-13-ruby-2-6-2-released.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md index ec615c91a8..8f4aefa182 100644 --- a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md +++ b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md @@ -22,18 +22,21 @@ and [commit logs](https://github.com/ruby/ruby/compare/v2_6_1...v2_6_2). SHA1: 44c6634a41f63ebdc1f3ce6ddcf48a4766bb4df7 SHA256: a0405d2bf2c2d2f332033b70dff354d224a864ab0edd462b7a413420453b49ab SHA512: bc96a6793a1e3111598b82b0aad98dc5b465e39cdb5b788c4259818752e028a44545c6489c02c323db0f43a362c26f0900acfba0277d6e2201587d7252f6125f + * SIZE: 20601169 bytes SHA1: fce5c289842e6e4c4bc7950214d82c0858086baa SHA256: 65b862e5c86346d6bda05fc193c6f2cd728ddfd357f4b0a19d54d48a50984d13 SHA512: 60ccabbca50d51186b6715edcd8e4fa704e8b9159a23f073e8d3aafef3858a98ade416156af94a479d1af5555c4c4b5b71267f0f563a518e5e6112ce9921bb8b + * SIZE: 14634343 bytes SHA1: 5839fc6e6568ac4f26a20382bd8fe0d998dffbb0 SHA256: d126ada7f4147ce1029a80c2a37a0c4bfb37e9e82da8816662241a43faeb8915 SHA512: cad678d2ced4085e99009e4fef83c067dd0e6ead27a8695bc212c0e5112a7fa09ceb27f82638faf91932ef8bdd090f844e0a878ffdf6845a891da4b858588aa0 + * SIZE: 11889840 bytes diff --git a/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md b/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md index e18d555cb9..48470c6bc5 100644 --- a/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md +++ b/ja/news/_posts/2019-03-13-ruby-2-6-2-released.md @@ -22,18 +22,21 @@ Ruby 2.6.2 がリリースされました。 SHA1: 44c6634a41f63ebdc1f3ce6ddcf48a4766bb4df7 SHA256: a0405d2bf2c2d2f332033b70dff354d224a864ab0edd462b7a413420453b49ab SHA512: bc96a6793a1e3111598b82b0aad98dc5b465e39cdb5b788c4259818752e028a44545c6489c02c323db0f43a362c26f0900acfba0277d6e2201587d7252f6125f + * SIZE: 20601169 bytes SHA1: fce5c289842e6e4c4bc7950214d82c0858086baa SHA256: 65b862e5c86346d6bda05fc193c6f2cd728ddfd357f4b0a19d54d48a50984d13 SHA512: 60ccabbca50d51186b6715edcd8e4fa704e8b9159a23f073e8d3aafef3858a98ade416156af94a479d1af5555c4c4b5b71267f0f563a518e5e6112ce9921bb8b + * SIZE: 14634343 bytes SHA1: 5839fc6e6568ac4f26a20382bd8fe0d998dffbb0 SHA256: d126ada7f4147ce1029a80c2a37a0c4bfb37e9e82da8816662241a43faeb8915 SHA512: cad678d2ced4085e99009e4fef83c067dd0e6ead27a8695bc212c0e5112a7fa09ceb27f82638faf91932ef8bdd090f844e0a878ffdf6845a891da4b858588aa0 + * SIZE: 11889840 bytes From e94406b23ba3e27d7267f15b43691af628414e90 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Wed, 13 Mar 2019 14:45:20 +0100 Subject: [PATCH 1040/3171] Fix grammar in news posts (en) --- en/news/_posts/2019-03-13-ruby-2-5-4-released.md | 4 ++-- en/news/_posts/2019-03-13-ruby-2-6-2-released.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/en/news/_posts/2019-03-13-ruby-2-5-4-released.md b/en/news/_posts/2019-03-13-ruby-2-5-4-released.md index e5a6e704b2..5a1e553677 100644 --- a/en/news/_posts/2019-03-13-ruby-2-5-4-released.md +++ b/en/news/_posts/2019-03-13-ruby-2-5-4-released.md @@ -9,9 +9,9 @@ lang: en Ruby 2.5.4 has been released. -This release includes bug fixes and security update of bundled RubyGems. +This release includes bug fixes and a security update of the bundled RubyGems. See details in [Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/) -and [commit logs](https://github.com/ruby/ruby/compare/v2_5_3...v2_5_4). +and the [commit logs](https://github.com/ruby/ruby/compare/v2_5_3...v2_5_4). ## Download diff --git a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md index 8f4aefa182..673c421657 100644 --- a/en/news/_posts/2019-03-13-ruby-2-6-2-released.md +++ b/en/news/_posts/2019-03-13-ruby-2-6-2-released.md @@ -9,10 +9,10 @@ lang: en Ruby 2.6.2 has been released. -This release includes bug fixes and security update of bundled RubyGems. +This release includes bug fixes and a security update of the bundled RubyGems. See details in [Multiple vulnerabilities in RubyGems](/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/) -and [commit logs](https://github.com/ruby/ruby/compare/v2_6_1...v2_6_2). +and the [commit logs](https://github.com/ruby/ruby/compare/v2_6_1...v2_6_2). ## Download From e19302df6c4d5c5b09a185e89298980e186c4cbf Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Wed, 13 Mar 2019 14:56:25 +0100 Subject: [PATCH 1041/3171] Update gem bundle --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 91d1689af6..0b81e5b018 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,7 +38,7 @@ GEM lanyon (0.4.0) jekyll (>= 2.0, < 4.0) rack (>= 1.6, < 3.0) - liquid (4.0.1) + liquid (4.0.2) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -82,7 +82,7 @@ GEM unicorn (5.5.0) kgio (~> 2.6) raindrops (~> 0.7) - validate-website (1.9.0) + validate-website (1.9.2) crass (~> 1) paint (~> 2) slop (~> 4.6) From 218d5569e9dbf7219e657acefcef0f6061ae1bad Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Wed, 13 Mar 2019 21:38:29 +0100 Subject: [PATCH 1042/3171] Remove unmaintained notice for id --- id/index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/id/index.html b/id/index.html index 278da9f569..d434525a9e 100644 --- a/id/index.html +++ b/id/index.html @@ -24,5 +24,3 @@

Ruby adalah...

--- - -{% include unmaintained.html %} From 405929d8f38bab4fe4147222b353537c9058e70c Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Wed, 13 Mar 2019 21:38:39 +0100 Subject: [PATCH 1043/3171] Remove unmaintained notice for pt --- _plugins/translation_status.rb | 2 +- pt/index.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/_plugins/translation_status.rb b/_plugins/translation_status.rb index b0215c17c4..24941bea3d 100644 --- a/_plugins/translation_status.rb +++ b/_plugins/translation_status.rb @@ -8,7 +8,7 @@ module Jekyll # Outputs HTML. module TranslationStatus - LANGS = %w{en de es fr id it ja ko ru vi zh_cn zh_tw} + LANGS = %w{en de es fr id it ja ko pt ru vi zh_cn zh_tw} START_DATE = '2013-04-01' OK_CHAR = '✓' diff --git a/pt/index.html b/pt/index.html index cc15889662..e02c575645 100644 --- a/pt/index.html +++ b/pt/index.html @@ -25,7 +25,7 @@

Ruby é...

--- - +{% comment %}

@@ -38,3 +38,4 @@

Ruby é...

Se você deseja contribuir ou ajudar a melhorar esse site, favor visitar a página do projeto no GitHub.

+{% endcomment %} From baefd72dbabe5c59a08eef28c94e40a073bf1320 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Wed, 13 Mar 2019 21:38:48 +0100 Subject: [PATCH 1044/3171] Do not redirect to unmaintained translations Do not automatically redirect from /index.html to unmaintained or outdated translations. Currently this affects pl, tr. Related to #1828. --- index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.html b/index.html index 18be31eb27..63073fa12d 100644 --- a/index.html +++ b/index.html @@ -13,10 +13,8 @@ "it": "it", "ja": "ja", "ko": "ko", - "pl": "pl", "pt": "pt", "ru": "ru", - "tr": "tr", "vi": "vi", "zh-CN": "zh_cn", "zh-TW": "zh_tw" From fa3ef0dcd70a3a589be23321fe133f206b7139b3 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Wed, 13 Mar 2019 21:39:00 +0100 Subject: [PATCH 1045/3171] Mark bg, fr, it, ru, vi as unmaintained * add unmaintained notice * do not redirect there from /index.html * update language list for translation_status tag --- _plugins/translation_status.rb | 2 +- bg/index.html | 2 ++ fr/index.html | 2 ++ index.html | 5 ----- it/index.html | 2 ++ ru/index.html | 2 ++ vi/index.html | 2 ++ 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/_plugins/translation_status.rb b/_plugins/translation_status.rb index 24941bea3d..d7a7801725 100644 --- a/_plugins/translation_status.rb +++ b/_plugins/translation_status.rb @@ -8,7 +8,7 @@ module Jekyll # Outputs HTML. module TranslationStatus - LANGS = %w{en de es fr id it ja ko pt ru vi zh_cn zh_tw} + LANGS = %w[en de es id ja ko pt zh_cn zh_tw] START_DATE = '2013-04-01' OK_CHAR = '✓' diff --git a/bg/index.html b/bg/index.html index a1e8616daf..cacca4bd20 100644 --- a/bg/index.html +++ b/bg/index.html @@ -25,3 +25,5 @@

Ruby e...

--- + +{% include unmaintained.html %} diff --git a/fr/index.html b/fr/index.html index 3136976e86..89cbdc00fd 100644 --- a/fr/index.html +++ b/fr/index.html @@ -25,3 +25,5 @@

Ruby...

--- + +{% include unmaintained.html %} diff --git a/index.html b/index.html index 63073fa12d..4af58b1ad3 100644 --- a/index.html +++ b/index.html @@ -5,17 +5,12 @@ Ruby Programming Language diff --git a/_layouts/default.html b/_layouts/default.html index 1dcd676b34..e963a7ce7a 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -78,7 +78,5 @@

{{ site.data.locales[page.lang].slogan }}

{% include credits.html %} - - {% include analytics.html %} From 16c3252e6cf2144eafc605d573d76a36740b6a15 Mon Sep 17 00:00:00 2001 From: Alexander Ilyin Date: Tue, 2 Nov 2021 23:17:00 +0300 Subject: [PATCH 2130/3171] Prepare ru locale maintained (ru) - set locale to admin/translation-status page - do redirect to locale from /index.html - see #2721 for more details --- _plugins/translation_status.rb | 2 +- index.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/_plugins/translation_status.rb b/_plugins/translation_status.rb index 65732e316b..0e7d1d53d8 100644 --- a/_plugins/translation_status.rb +++ b/_plugins/translation_status.rb @@ -8,7 +8,7 @@ module Jekyll # Outputs HTML. module TranslationStatus - LANGS = %w[en de es id ja ko pt tr zh_cn zh_tw].freeze + LANGS = %w[en de es id ja ko pt ru tr zh_cn zh_tw].freeze START_DATE = "2013-04-01" OK_CHAR = "✓" diff --git a/index.html b/index.html index a3024b2082..ee0dfd348b 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,7 @@ "ja": "ja", "ko": "ko", "pt": "pt", + "ru": "ru", "tr": "tr", "zh-CN": "zh_cn", "zh-TW": "zh_tw" From f5f196e99cf93c820adb4152e876846f9fae240a Mon Sep 17 00:00:00 2001 From: Andrias Meisyal Date: Sat, 30 Oct 2021 19:24:34 +0700 Subject: [PATCH 2131/3171] Translate CVE-2021-31799: A command injection vulnerability in RDoc (id) --- ...2021-05-02-os-command-injection-in-rdoc.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 id/news/_posts/2021-05-02-os-command-injection-in-rdoc.md diff --git a/id/news/_posts/2021-05-02-os-command-injection-in-rdoc.md b/id/news/_posts/2021-05-02-os-command-injection-in-rdoc.md new file mode 100644 index 0000000000..1fedaee221 --- /dev/null +++ b/id/news/_posts/2021-05-02-os-command-injection-in-rdoc.md @@ -0,0 +1,54 @@ +--- +layout: news_post +title: "CVE-2021-31799: Sebuah kerentanan command injection pada RDoc" +author: "aycabta" +translator: "meisyal" +date: 2021-05-02 09:00:00 +0000 +tags: security +lang: id +--- + +Ada sebuah kerentanan *Command Injection* pada RDoc yang di-*bundle* dengan +Ruby. Semua pengguna Ruby direkomendasikan untuk memperbarui RDoc ke versi +terbaru untuk memperbaiki kerentanan ini. + +## Detail + +Berikut adalah kerentanan yang telah dilaporkan. + +* [CVE-2021-31799](https://nvd.nist.gov/vuln/detail/CVE-2021-31799) + +RDoc sebelumnya memanggil `Kernel#open` untuk membuat sebuah berkas lokal. Jika +sebuah proyek Ruby memiliki sebuah berkas yang mana nama berkas dimulai dengan +`|` dan diakhiri `tags`, perintah yang mengikuti karater pipa akan dieksekusi. +Sebuah proyek Ruby yang berbahaya bisa saja memanfaatkan ini untuk menjalankan +sebuah perintah yang tidak seharusnya pada seorang pengguna yang mencoba untuk +menjalankan perintah `rdoc`. + +Pengguna Ruby yang terimbas dengan kerentanan ini seharusnya memperbarui RDoc +ke versi terbaru. + +## Versi Terimbas + +* Semua rilis RDoc dari 3.11 sampai 6.3.0 + +## Cara Memperbarui + +Jalankan perintah berikut untuk memperbarui RDoc ke versi terbaru (6.3.1 atau +setelahnya). + +``` +gem install rdoc +``` + +Jika Anda menggunakan *bundler*, mohon tambahkan `gem "rdoc", ">= 6.3.1"` pada +`Gemfile` Anda. + +## Rujukan + +Terima kasih kepada [Alexandr Savca](https://hackerone.com/chinarulezzz) yang +telah melaporkan kerentanan ini. + +## Riwayat + +* Semula dipublikasikan pada 2021-05-02 09:00:00 UTC From b7add26280870083b6eed0d79e18d5ae8da7e5a2 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sun, 7 Nov 2021 12:51:22 +0900 Subject: [PATCH 2132/3171] CVE-2021-41817: ReDoS of date parsing methods --- ...arsing-method-regexp-dos-cve-2021-41817.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md diff --git a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md new file mode 100644 index 0000000000..6918d96ff1 --- /dev/null +++ b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -0,0 +1,34 @@ +--- +layout: news_post +title: "CVE-2021-41817: Regular Expression Denial of Service Vunlerability of Date Parsing Methods" +author: "mame" +translator: +date: 2021-11-15 12:00:00 +0000 +tags: security +lang: en +--- + +Regular expression denial of service vulnerability of date parsing methods was found. An attacker can exploit this vulnerability to cause an effective denial of service. + +## Details + +Date's parsing methods including `Date.parse` are using Regexps internally, some of which are vulnerable against regular expression denial of service. Applications and libraries that apply such methods to untrusted input may be affected. + +The fix limits the input length up to 128 bytes by default instead of changing the regexps. This is because Date gem uses many Regexps and it is possible that there are still undiscovered vulnerable Regexps. For compatibility, it is allowed to remove the limitation by explicitly passing `limit` keywords as `nil` like `Date.parse(str, limit: nil)`, but note that it may take a long time to parse. + +Please update the date gem to version 3.2.1, 3.1.2, 3.0.2, and 2.0.1, or later. You can use `gem update date` to update it. If you are using bundler, please add `gem "date", ">= 3.2.1"` to your `Gemfile`. + +## Affected versions + +* date gem 2.0.0 or prior (which are bundled versions with Ruby 2.6 series) +* date gem 3.0.1 or prior (which are bundled versions with Ruby 2.7 series) +* date gem 3.1.1 or prior (which are bundled versions with Ruby 3.0 series) +* date gem 3.2.0 or prior + +## Credits + +Thanks to [svalkanov](https://hackerone.com/svalkanov) for discovering this issue. + +## History + +* Originally published at 2021-11-15 12:00:00 (UTC) From ac0344657d370cb1d7d2fad64521ebac11b87e05 Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Tue, 9 Nov 2021 18:51:11 +0900 Subject: [PATCH 2133/3171] Ruby 3.1.0 Preview 1 Released (#2726) * Ruby 3.1.0 Preview 1 Released * Apply suggestions from code review Co-authored-by: Koichi ITO Co-authored-by: Koichi ITO --- _data/branches.yml | 5 + _data/downloads.yml | 1 + _data/releases.yml | 26 +++ ...2021-11-09-ruby-3-1-0-preview1-released.md | 218 ++++++++++++++++++ 4 files changed, 250 insertions(+) create mode 100644 en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md diff --git a/_data/branches.yml b/_data/branches.yml index 76ed04e496..ebd2220b93 100644 --- a/_data/branches.yml +++ b/_data/branches.yml @@ -8,6 +8,11 @@ # date: date of first stable release (YYYY-MM-DD) # eol_date: date of EOL (YYYY-MM-DD) +- name: 3.1 + status: preview + date: + eol_date: + - name: 3.0 status: normal maintenance date: 2020-12-25 diff --git a/_data/downloads.yml b/_data/downloads.yml index f0926cb30d..ff61bd1094 100644 --- a/_data/downloads.yml +++ b/_data/downloads.yml @@ -4,6 +4,7 @@ # optional preview: + - 3.1.0-preview1 stable: diff --git a/_data/releases.yml b/_data/releases.yml index 2a33bc205c..b9517dda24 100644 --- a/_data/releases.yml +++ b/_data/releases.yml @@ -19,6 +19,32 @@ # In order to get the release listed on the downloads page, # you also need to add an entry to `_data/downloads.yml'. +# 3.1 series + +- version: 3.1.0-preview1 + date: 2021-11-09 + post: /en/news/2021/11/09/ruby-3-1-0-preview1-released/ + url: + gz: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0-preview1.tar.gz + zip: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0-preview1.zip + xz: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0-preview1.tar.xz + size: + gz: 20821221 + zip: 25019629 + xz: 15742844 + sha1: + gz: 40dfd3db076a49fab9a0eee51e89d9b3d16a4e23 + zip: ef5fa22890e55935db4b96b3089a8aea1335bd85 + xz: 22aa861b17031cd1b163b7443f5f2f5897c5895e + sha256: + gz: 540f49f4c3aceb1a5d7fb0b8522a04dd96bc4a22f9660a6b59629886c8e010d4 + zip: 4e8d118b2365164873148ac545a8fa36c098b846a9b19ebb9037f8ee9adb4414 + xz: 86a836ad42f6a7a469fce71ffec48fd3184af55bf79e488b568a4f64adee551d + sha512: + gz: 63f528f20905827d03649ed9804e4a4e5c15078f9c6c8efcfb306baa7baafa17a406eb09a2c08b42e151e14af33b1aadbd9fb1cc84f9353d070b54bbf1ff950d + zip: 917803aac0848e00871614a09740b5c9cca26f200d68580dde61666633f1b7fee506e25ea4ed0c38eb20149417bf9f1ed449a4d2aec5b726de670e7177e5c07a + xz: bdbd7c624197ca478658280d84123a8c12ae72425bc566dcc75989c5b5ef114dd57e64efc09e2413ed615d9b47621a70ace0f3612e8ca7ba853822ad9e88c0b0 + # 3.0 series - version: 3.0.2 diff --git a/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md b/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md new file mode 100644 index 0000000000..4011a2da87 --- /dev/null +++ b/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md @@ -0,0 +1,218 @@ +--- +layout: news_post +title: "Ruby 3.1.0 Preview 1 Released" +author: "naruse" +translator: +date: 2021-11-09 00:00:00 +0000 +lang: en +--- + +We are pleased to announce the release of Ruby {{ release.version }}. + +{% assign release = site.data.releases | where: "version", "3.1.0-preview1" | first %} + + +## YJIT: New experimental in-process JIT compiler + + +Ruby 3.1 merges YJIT, a new in-process JIT compiler developed by Shopify. + +Since [Ruby 2.6 introduced MJIT in 2018](https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/), its performance greatly improved, and finally [we achieved Ruby3x3 last year](https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/). But even though Optcarrot has shown impressive speedups, the JIT hasn't benefited real world business applications. + +Recently Shopify contributed many Ruby improvements to speed up their Rails application. YJIT is an important contribution, and aims to improve the performance of Rails applications. + +Though MJIT is a method-based JIT compiler and uses an external C compiler, YJIT uses Basic Block Versioning and includes JIT compiler inside it. With Lazy Basic Block Versioning (LBBV) it first compiles the beginning of a method, and incrementally compiles the rest when the type of arguments and variables are dynamically determined. See [YJIT: a basic block versioning JIT compiler for CRuby](https://dl.acm.org/doi/10.1145/3486606.3486781) for a detailed introduction. + +With this technology, YJIT achieves both fast warmup time and performance improvements on most real-world software, up to 22% on railsbench, 39% on liquid-render. + + + +YJIT is still an experimental feature, and as such, it is disabled by default. If you want to use this, specify the `--yjit` command-line option to enable YJIT. It is also limited to macOS & Linux on x86-64 platforms for now. + +* https://bugs.ruby-lang.org/issues/18229 +* https://shopify.engineering/yjit-just-in-time-compiler-cruby +* https://www.youtube.com/watch?v=PBVLf3yfMs8 + +## debug gem: A new debugger + +A new debugger [debug.gem](https://github.com/ruby/debug) is bundled. debug.gem is fast debugger implementation and it provides many features like remote debugging, colorful REPL, IDE (VSCode) integration and more. It replaces `lib/debug.rb` standard library. + +## error_highlight: Fine-grained error location in backtrace + +A built-in gem, error_highlight, has been introduced. It includes fine-grained error location in backtrace: + +``` +$ ruby test.rb +test.rb:1:in `
': undefined method `time' for 1:Integer (NoMethodError) + +1.time {} + ^^^^^ +Did you mean? times +``` + +This gem is enabled by default. You can disable it by using a command-line option `--disable-error_highlight`. See [the repository](https://github.com/ruby/error_highlight) in detail. + +## Irb improvement + +To be described in next preview. + +## Other Notable New Features + +### Language + +* Values in Hash literals and keyword arguments can be omitted. [Feature #14579] + * `{x:, y:}` is a syntax sugar of `{x: x, y: y}`. + * `foo(x:, y:)` is a syntax sugar of `foo(x: x, y: y)`. + +* Pin operator in pattern matching now takes an expression. [Feature #17411] + +```ruby +Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a +#=> [[3, 5], [5, 7], [11, 13]] +``` + + +### RBS + +RBS is a language to describe the structure of Ruby programs. See [the repository](https://github.com/ruby/rbs) for detail. + +Updates since Ruby 3.0.0: + +* `rbs collection` has been introduced to manage gems' RBSs. [doc](https://github.com/ruby/rbs/blob/master/docs/collection.md) +* Many signatures for built-in and standard libraries have been added/updated. +* It includes many bug fixes and performance improvements too. + +See [the CHANGELOG.md](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) for more information. + +### TypeProf + +TypeProf is a static type analyzer for Ruby. It generates a prototype of RBS from non-type-annotated Ruby code. See [the document](https://github.com/ruby/typeprof/blob/master/doc/doc.md) for detail. + +Updates since Ruby 3.0.0: + +* [Experimental IDE support](https://github.com/ruby/typeprof/blob/master/doc/ide.md) has been implemented. +* Many bug fixes and performance improvements. + +## Performance improvements + +* MJIT + * For workloads like Rails, the default `--jit-max-cache` is changed from 100 to 10000. + The JIT compiler no longer skips compilation of methods longer than 1000 instructions. + * To support Zeitwerk of Rails, JIT-ed code is no longer cancelled + when a TracePoint for class events is enabled. + +## Other notable changes since 3.0 + +* One-line pattern matching, e.g., `ary => [x, y, z]`, is no longer experimental. +* Multiple assignment evaluation order has been changed slightly. [Bug #4443]] + * `foo[0], bar[0] = baz, qux` was evaluated in order `baz`, `qux`, `foo`, and then `bar` in Ruby 3.0. In Ruby 3.1, it is evaluated in order `foo`, `bar`, `baz`, and then `qux`. +* Variable Width Allocation: Strings (experimental) [[Bug #18239]](https://bugs.ruby-lang.org/issues/18239) + +### Standard libraries updates + +* Some standard libraries are updated. + * RubyGems + * Bundler + * RDoc 6.4.0 + * ReLine + * JSON 2.6.0 + * Psych 4.0.2 + * FileUtils 1.6.0 + * Fiddle + * StringIO 3.0.1 + * IO::Console 0.5.9 + * IO::Wait 0.2.0 + * CSV + * Etc 1.3.0 + * Date 3.2.0 + * Zlib 2.1.1 + * StringScanner + * IpAddr + * Logger 1.4.4 + * OStruct 0.5.0 + * Irb + * Racc 1.6.0 + * Delegate 0.2.0 + * Benchmark 0.2.0 + * CGI 0.3.0 + * Readline(C-ext) 0.1.3 + * Timeout 0.2.0 + * YAML 0.2.0 + * URI 0.11.0 + * OpenSSL + * DidYouMean + * Weakref 0.1.1 + * Tempfile 0.1.2 + * TmpDir 0.1.2 + * English 0.7.1 + * Net::Protocol 0.1.2 + * Net::Http 0.2.0 + * BigDecimal + * OptionParser 0.2.0 + * Set + * Find 0.1.1 + * Rinda 0.1.1 + * Erb + * NKF 0.1.1 + * Base64 0.1.1 + * OpenUri 0.2.0 + * SecureRandom 0.1.1 + * Resolv 0.2.1 + * Resolv::Replace 0.1.0 + * Time 0.2.0 + * PP 0.2.1 + * Prettyprint 0.1.1 + * Drb 2.1.0 + * Pathname 0.2.0 + * Digest 3.1.0.pre2 + * Un 0.2.0 +* The following bundled gems are updated. + * minitest 5.14.4 + * power_assert 2.0.1 + * rake 13.0.6 + * test-unit 3.5.0 + * rbs 1.6.2 + * typeprof 0.20.0 +* The following default gems are now bundled gems. + * net-ftp + * net-imap + * net-pop + * net-smtp + * matrix + * prime + +See [NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md) +or [commit logs](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}) +for more details. + +With those changes, [{{ release.stats.files_changed }} files changed, {{ release.stats.insertions }} insertions(+), {{ release.stats.deletions }} deletions(-)](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}#file_bucket) +since Ruby 3.0.0! + +## Download + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## What is Ruby + +Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993, +and is now developed as Open Source. It runs on multiple platforms +and is used all over the world especially for web development. From 55cacc1594da88f81d3d2c753dbb102d67676fc3 Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Tue, 9 Nov 2021 19:15:52 +0900 Subject: [PATCH 2134/3171] fix _data/releases.yml (#2727) --- _data/releases.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_data/releases.yml b/_data/releases.yml index b9517dda24..1495ba54d1 100644 --- a/_data/releases.yml +++ b/_data/releases.yml @@ -24,6 +24,11 @@ - version: 3.1.0-preview1 date: 2021-11-09 post: /en/news/2021/11/09/ruby-3-1-0-preview1-released/ + tag: ruby_3_1_0_preview1 + stats: + files_changed: 2963 + insertions: 529321 + deletions: 92305 url: gz: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0-preview1.tar.gz zip: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0-preview1.zip From 0e3dc53ed5ce5d2051d4ce2183b640e0e2afaf5b Mon Sep 17 00:00:00 2001 From: Andrias Meisyal Date: Sat, 6 Nov 2021 18:34:26 +0700 Subject: [PATCH 2135/3171] Fix title and link to translated posts (id) --- id/news/_posts/2021-04-05-ruby-2-5-9-released.md | 2 +- id/news/_posts/2021-04-05-ruby-2-6-7-released.md | 4 ++-- id/news/_posts/2021-04-05-ruby-2-7-3-released.md | 2 +- id/news/_posts/2021-04-05-ruby-3-0-1-released.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/id/news/_posts/2021-04-05-ruby-2-5-9-released.md b/id/news/_posts/2021-04-05-ruby-2-5-9-released.md index 6b2b4412da..8fa7d895df 100644 --- a/id/news/_posts/2021-04-05-ruby-2-5-9-released.md +++ b/id/news/_posts/2021-04-05-ruby-2-5-9-released.md @@ -13,7 +13,7 @@ Rilis ini mencakup beberapa perbaikan keamanan. Mohon cek topik-topik di bawah ini untuk lebih detail. * [CVE-2020-25613: Potensi Kerentanan HTTP Request Smuggling pada WEBrick]({%link id/news/_posts/2020-09-29-http-request-smuggling-cve-2020-25613.md %}) -* [CVE-2021-28965: XML round-trip vulnerability in REXML]({% link en/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md %}) +* [CVE-2021-28965: Kerentanan XML round-trip pada REXML]({% link id/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md %}) Lihat [commit logs](https://github.com/ruby/ruby/compare/v2_5_8...v2_5_9) untuk detail. diff --git a/id/news/_posts/2021-04-05-ruby-2-6-7-released.md b/id/news/_posts/2021-04-05-ruby-2-6-7-released.md index 9eb9e5ef3f..82a0edb22d 100644 --- a/id/news/_posts/2021-04-05-ruby-2-6-7-released.md +++ b/id/news/_posts/2021-04-05-ruby-2-6-7-released.md @@ -13,7 +13,7 @@ Rilis ini memuat perbaikan keamanan. Mohon cek topik-topik di bawah ini untuk lebih detail. * [CVE-2020-25613: Potensi Kerentanan HTTP Request Smuggling pada WEBrick]({%link id/news/_posts/2020-09-29-http-request-smuggling-cve-2020-25613.md %}) -* [CVE-2021-28965: XML round-trip vulnerability in REXML]({% link id/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md %}) +* [CVE-2021-28965: Kerentanan XML round-trip pada REXML]({% link id/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md %}) Lihat [commit logs](https://github.com/ruby/ruby/compare/v2_6_6...v2_6_7) untuk detail. @@ -66,4 +66,4 @@ Banyak *committer*, pengembang, dan pengguna yang telah menyediakan laporan *bug* membantu kami membuat rilis ini. Terima kasih atas kontribusinya. Perawatan Ruby 2.6, termasuk rilis ini, didasarkan pada "Agreement for the Ruby -stable version" dari Ruby Associaction. +stable version" dari Ruby Association. diff --git a/id/news/_posts/2021-04-05-ruby-2-7-3-released.md b/id/news/_posts/2021-04-05-ruby-2-7-3-released.md index 72ab593135..b8f766b376 100644 --- a/id/news/_posts/2021-04-05-ruby-2-7-3-released.md +++ b/id/news/_posts/2021-04-05-ruby-2-7-3-released.md @@ -13,7 +13,7 @@ Rilis ini mencakup perbaikan keamanan. Mohon cek topik-topik di bawah ini untuk lebih detail. * [CVE-2021-28965: Kerentanan XML round-trip pada REXML]({% link id/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md %}) -* [CVE-2021-28966: Path traversal in Tempfile on Windows]({% link en/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md %}) +* [CVE-2021-28966: Path traversal pada Tempfile di Windows]({% link id/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md %}) Cek [commit logs](https://github.com/ruby/ruby/compare/v2_7_2...v2_7_3) untuk detail. diff --git a/id/news/_posts/2021-04-05-ruby-3-0-1-released.md b/id/news/_posts/2021-04-05-ruby-3-0-1-released.md index 282f9a5822..b18565ffdb 100644 --- a/id/news/_posts/2021-04-05-ruby-3-0-1-released.md +++ b/id/news/_posts/2021-04-05-ruby-3-0-1-released.md @@ -13,7 +13,7 @@ Rilis ini memuat perbaikan keamanan. Mohon cek topik-topik di bawah ini untuk lebih detail. * [CVE-2021-28965: Kerentanan XML round-trip pada REXML]({% link id/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md %}) -* [CVE-2021-28966: Path traversal in Tempfile on Windows]({% link en/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md %}) +* [CVE-2021-28966: Path traversal pada Tempfile di Windows]({% link id/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md %}) Lihat [commit logs](https://github.com/ruby/ruby/compare/v3_0_0...v3_0_1) untuk detail. From c0dc4a3aaad9815263d0aea8304d9d7091336024 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 11 Nov 2021 15:20:36 -0500 Subject: [PATCH 2136/3171] Fix tag name for Ruby 3.1.0-preview1 Links are broken in the release page because the release tag is `v3_1_0_preview1` and not `ruby_3_1_0_preview1`. --- _data/releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/releases.yml b/_data/releases.yml index 1495ba54d1..15878152b8 100644 --- a/_data/releases.yml +++ b/_data/releases.yml @@ -24,7 +24,7 @@ - version: 3.1.0-preview1 date: 2021-11-09 post: /en/news/2021/11/09/ruby-3-1-0-preview1-released/ - tag: ruby_3_1_0_preview1 + tag: v3_1_0_preview1 stats: files_changed: 2963 insertions: 529321 From 2ce5cd6c8a72592c8e36340ced264ed66e9acc3b Mon Sep 17 00:00:00 2001 From: vurtn Date: Thu, 11 Nov 2021 21:28:10 +0100 Subject: [PATCH 2137/3171] translation of ruby 3.1.0 preview1 (fr) --- ...2021-11-09-ruby-3-1-0-preview1-released.md | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 fr/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md diff --git a/fr/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md b/fr/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md new file mode 100644 index 0000000000..d80e6c8737 --- /dev/null +++ b/fr/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md @@ -0,0 +1,215 @@ +--- +layout: news_post +title: "Ruby 3.1.0 Preview 1 est disponible" +author: "naruse" +translator: "Kevin Rosaz" +date: 2021-11-09 00:00:00 +0000 +lang: fr +--- +{% assign release = site.data.releases | where: "version", "3.1.0-preview1" | first %} + +Nous avons le plaisir de vous annoncer la sortie de Ruby {{ release.version }}. + + +## YJIT: un nouveau compilateur JIT en cours de développement + + +Ruby 3.1 fusionne YJIT, un nouveau compilateur JIT développé par Shopify. + +Depuis que [Ruby 2.6 a introduit MJIT en 2018](https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/), ses performances se sont grandement améliorées et [nous sommes parvenus à Ruby3x3 l'année dernière](https://www.ruby-lang.org/fr/news/2020/12/25/ruby-3-0-0-released/). Même si Optcarrot a montré des accélérations impressionnantes, le JIT n'a pas profité aux applications du monde professionnel. + +Récemment, Shopify a apporté de nombreuses améliorations à Ruby pour accélérer son application Rails. YJIT est une contribution importante et vise à améliorer les performances des applications Rails. + +Bien que MJIT soit un compilateur JIT basé sur des méthodes et qu'il utilise un compilateur C externe, YJIT utilise le Basic Block Versioning et inclut le compilateur JIT à l'intérieur. Avec Lazy Basic Block Versioning (LBBV), cela compile d'abord le début d'une méthode et compile progressivement le reste lorsque le type des arguments et des variables est déterminé dynamiquement. Voir [YJIT: a basic block versioning JIT compiler for CRuby](https://dl.acm.org/doi/10.1145/3486606.3486781) pour une introduction détaillée. + +Avec cette technologie, YJIT permet d'avoir à la fois un temps de démarrage rapide et des améliorations de performance sur la plupart des logiciels, jusqu'à 22% sur railsbench et 39% sur le rendu liquid. + + + +YJIT est toujours une fonctionnalité expérimentale. En tant que telle, elle est désactivée par défaut. Si vous souhaitez l'utiliser, spécifiez l'option en ligne de commande `--yjit` pour activer YJIT. L'utilisation est pour le moment limitée à macOS et Linux sur les plateformes x86-64. + +* https://bugs.ruby-lang.org/issues/18229 +* https://shopify.engineering/yjit-just-in-time-compiler-cruby +* https://www.youtube.com/watch?v=PBVLf3yfMs8 + +## debug gem: un nouveau débogueur + +Un nouveau débogueur [debug.gem](https://github.com/ruby/debug) est inclu. debug.gem est une implémentation rapide du débogueur et fournit de nombreuses fonctionnalités telles que le débogage à distance, un REPL coloré, une intégration dans un IDE (VSCode) et bien plus encore. Cela remplace `lib/debug.rb` de la bibliothèque standard. + +## error_highlight: localisation des erreurs plus précise + +La gemme error_highlight a été ajoutée. Elle permet d'obtenir la localisation d'une erreur de manière plus précise dans la trace : + +``` +$ ruby test.rb +test.rb:1:in `
': undefined method `time' for 1:Integer (NoMethodError) + +1.time {} + ^^^^^ +Did you mean? times +``` + +Cette gemme est activée par défaut. Vous pouvez la désactiver en utilisant l'option en ligne de commande `--disable-error_highlight`. Voir [le dépôt](https://github.com/ruby/error_highlight) pour de plus amples informations. + +## Amélioration d'IRB + +À décrire dans le prochain aperçu. + +## Autres nouvelles fonctionnalités notables + +### Language + +* Les valeurs dans les littéraux de hachage peuvent être omis. [Feature #14579] + * `{x:, y:}` est un sucre syntaxique de `{x: x, y: y}`. + * `foo(x:, y:)` est un sucre syntaxique de `foo(x: x, y: y)`. + +* L'opérateur pin dans le filtrage par motif prend désormais une expression. [Feature #17411] + +```ruby +Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a +#=> [[3, 5], [5, 7], [11, 13]] +``` + + +### RBS + +RBS est un langage pour décrire la structure des programmes Ruby. Voir [le dépôt](https://github.com/ruby/rbs) pour de plus amples informations. + +Mises à jour depuis Ruby 3.0.0: + +* `rbs collection` a été introduite pour gérer les RBS des gemmes. [doc](https://github.com/ruby/rbs/blob/master/docs/collection.md) +* Plusieurs signatures pour des bibliothèques intégrées et standards ont été ajoutées/mises à jour. +* Il y a également de nombreuses corrections de bogues et d'améliorations de performance. + +Voir [le CHANGELOG.md](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) pour de plus amples informations. + +### TypeProf + +TypeProf est un analyseur de type statique pour Ruby. Il génère un prototype de RBS à partir de code Ruby non annoté de type. Voir [le document](https://github.com/ruby/typeprof/blob/master/doc/doc.md) pour de plus amples informations. + +Mises à jour depuis Ruby 3.0.0 : + +* [Le support expérimental pour IDE](https://github.com/ruby/typeprof/blob/master/doc/ide.md) a été implémenté. +* Il y a également de nombreuses corrections de bogues et d'améliorations de performance. + +## Amélioration de performance + +* MJIT + * Pour les charges de travail telles que Rails, la valeur par défaut `--jit-max-cache` passe de 100 à 10000. + Le compilateur JIT ne saute plus la compilation des méthodes de plus de 1000 instructions. + * Pour prendre en charge Zeitwerk de Rails, le code généré par le compilateur JIT n'est plus annulé + lorsqu'un TracePoint est activé pour les évènements de classe. + +## Autres changements notables depuis la version 3.0 + +* Le filtrage par motif en une ligne, e.g., `ary => [x, y, z]`, n'est plus au stade expérimental. +* L'ordre d'évaluation des affectations multiples a été légèrement modifié. [[Bug #4443]](https://bugs.ruby-lang.org/issues/4443) + * `foo[0], bar[0] = baz, qux` était évalué dans l'ordre `baz`, `qux`, `foo` puis `bar` dans Ruby 3.0. Dans Ruby 3.1, l'évaluation est dans l'ordre `foo`, `bar`, `baz` puis `qux`. +* Allocation de la taille d'une variable: Strings (expérimental) [[Bug #18239]](https://bugs.ruby-lang.org/issues/18239) + +### Mises à jour des bibliothèques standards + +* Plusieurs bibliothèques standards ont été mises à jour. + * RubyGems + * Bundler + * RDoc 6.4.0 + * ReLine + * JSON 2.6.0 + * Psych 4.0.2 + * FileUtils 1.6.0 + * Fiddle + * StringIO 3.0.1 + * IO::Console 0.5.9 + * IO::Wait 0.2.0 + * CSV + * Etc 1.3.0 + * Date 3.2.0 + * Zlib 2.1.1 + * StringScanner + * IpAddr + * Logger 1.4.4 + * OStruct 0.5.0 + * Irb + * Racc 1.6.0 + * Delegate 0.2.0 + * Benchmark 0.2.0 + * CGI 0.3.0 + * Readline(C-ext) 0.1.3 + * Timeout 0.2.0 + * YAML 0.2.0 + * URI 0.11.0 + * OpenSSL + * DidYouMean + * Weakref 0.1.1 + * Tempfile 0.1.2 + * TmpDir 0.1.2 + * English 0.7.1 + * Net::Protocol 0.1.2 + * Net::Http 0.2.0 + * BigDecimal + * OptionParser 0.2.0 + * Set + * Find 0.1.1 + * Rinda 0.1.1 + * Erb + * NKF 0.1.1 + * Base64 0.1.1 + * OpenUri 0.2.0 + * SecureRandom 0.1.1 + * Resolv 0.2.1 + * Resolv::Replace 0.1.0 + * Time 0.2.0 + * PP 0.2.1 + * Prettyprint 0.1.1 + * Drb 2.1.0 + * Pathname 0.2.0 + * Digest 3.1.0.pre2 + * Un 0.2.0 +* Les gemmes incluses suivantes ont été mises à jour. + * minitest 5.14.4 + * power_assert 2.0.1 + * rake 13.0.6 + * test-unit 3.5.0 + * rbs 1.6.2 + * typeprof 0.20.0 +* Les gemmes par défaut suivantes sont désormais incluses. + * net-ftp + * net-imap + * net-pop + * net-smtp + * matrix + * prime + +Voir [NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md) +ou les [logs de commit](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}) +pour de plus amples informations. + +Avec ces changements, [{{ release.stats.files_changed }} fichiers changés, {{ release.stats.insertions }} insertions(+), {{ release.stats.deletions }} suppressions(-)](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}#file_bucket) +depuis Ruby 3.0.0! + +## Téléchargement + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Ruby, c'est quoi ? + +Ruby a été initialement développé par Matz (Yukihiro Matsumoto) en 1993 puis est devenu open source. Il fonctionne sur de nombreuses plateformes et est utilisé partout dans le monde, en particulier pour le développement web. From d4d072d9f9afce6ab4018ceaab0f4b6a05eb2562 Mon Sep 17 00:00:00 2001 From: vurtn Date: Thu, 11 Nov 2021 21:33:28 +0100 Subject: [PATCH 2138/3171] Add link to bug#4443 --- en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md b/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md index 4011a2da87..7904833062 100644 --- a/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md +++ b/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md @@ -104,7 +104,7 @@ Updates since Ruby 3.0.0: ## Other notable changes since 3.0 * One-line pattern matching, e.g., `ary => [x, y, z]`, is no longer experimental. -* Multiple assignment evaluation order has been changed slightly. [Bug #4443]] +* Multiple assignment evaluation order has been changed slightly. [[Bug #4443]](https://bugs.ruby-lang.org/issues/4443) * `foo[0], bar[0] = baz, qux` was evaluated in order `baz`, `qux`, `foo`, and then `bar` in Ruby 3.0. In Ruby 3.1, it is evaluated in order `foo`, `bar`, `baz`, and then `qux`. * Variable Width Allocation: Strings (experimental) [[Bug #18239]](https://bugs.ruby-lang.org/issues/18239) From 4ba077e10411c2a2a1daa5f34c832012bf21d19a Mon Sep 17 00:00:00 2001 From: Jacob Herrington Date: Fri, 12 Nov 2021 18:22:26 +0000 Subject: [PATCH 2139/3171] Add Remote Ruby podcasts After 154 episodes released, I think it is safe to include Remote Ruby in this list. There is a ton of great Ruby-based content being created on the podcast and they were even included in the podcast panel at RubyConf 2021. --- en/community/podcasts/index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/en/community/podcasts/index.md b/en/community/podcasts/index.md index ae67b44f8c..0f533be95b 100644 --- a/en/community/podcasts/index.md +++ b/en/community/podcasts/index.md @@ -14,6 +14,10 @@ Listen to news, interviews, and discussions about Ruby and its community. : The Ruby on Rails Podcast, a weekly conversation about Ruby on Rails, open source software, and the programming profession. +[Remote Ruby][remote_ruby] +: Virtual meetup turned podcast, Remote Ruby celebrates and highlights + the Ruby community in an informal setting. + ### Getting Involved Podcast hosts are always looking for guests. If you have some Ruby @@ -21,5 +25,6 @@ wisdom to share, get in touch with the creators of these shows. You can also start your own Ruby podcast and get added to this list! +[remote_ruby]: https://remoteruby.transistor.fm/ [rorpodcast]: http://5by5.tv/rubyonrails [rogues]: https://devchat.tv/ruby-rogues From 4828a3839ad6e008884c2832efced9c1032beef7 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Mon, 15 Nov 2021 15:35:11 +0900 Subject: [PATCH 2140/3171] Fix the URL to the bug founder --- .../2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md index 6918d96ff1..68210bd080 100644 --- a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md +++ b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -27,7 +27,7 @@ Please update the date gem to version 3.2.1, 3.1.2, 3.0.2, and 2.0.1, or later. ## Credits -Thanks to [svalkanov](https://hackerone.com/svalkanov) for discovering this issue. +Thanks to [svalkanov](https://github.com/SValkanov/) for discovering this issue. ## History From 10676a0103540b93b4cf4d0fb6108da54156e226 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Mon, 15 Nov 2021 17:28:29 +0900 Subject: [PATCH 2141/3171] Update the release time --- ...021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md index 68210bd080..c60ae5f22b 100644 --- a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md +++ b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -3,7 +3,7 @@ layout: news_post title: "CVE-2021-41817: Regular Expression Denial of Service Vunlerability of Date Parsing Methods" author: "mame" translator: -date: 2021-11-15 12:00:00 +0000 +date: 2021-11-15 08:00:00 +0000 tags: security lang: en --- @@ -31,4 +31,4 @@ Thanks to [svalkanov](https://github.com/SValkanov/) for discovering this issue. ## History -* Originally published at 2021-11-15 12:00:00 (UTC) +* Originally published at 2021-11-15 08:00:00 (UTC) From b4785b44bb64686b56ee995243322b080ffcb491 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Mon, 15 Nov 2021 17:35:03 +0900 Subject: [PATCH 2142/3171] Improve English Co-authored-by: Sorah Fukumori --- .../2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md index c60ae5f22b..69ff12a426 100644 --- a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md +++ b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -8,7 +8,7 @@ tags: security lang: en --- -Regular expression denial of service vulnerability of date parsing methods was found. An attacker can exploit this vulnerability to cause an effective denial of service. +We have released date gem version 3.2.1, 3.1.2, 3.0.2, and 2.0.1 that include a security fix for a regular expression denial of service vulnerability (ReDoS) on date parsing methods. An attacker can exploit this vulnerability to cause an effective DoS attack. ## Details From 3ccb7c53d187fd0a6bbf6106f15dd174dd65c01d Mon Sep 17 00:00:00 2001 From: "Joseph D. Cohen" Date: Mon, 15 Nov 2021 06:10:31 -0800 Subject: [PATCH 2143/3171] Update 2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Fix typo in headline --- .../2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md index 69ff12a426..9306b21675 100644 --- a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md +++ b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -1,6 +1,6 @@ --- layout: news_post -title: "CVE-2021-41817: Regular Expression Denial of Service Vunlerability of Date Parsing Methods" +title: "CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods" author: "mame" translator: date: 2021-11-15 08:00:00 +0000 From d5843f78080620394364f9f58d20290a249fd162 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 16 Nov 2021 13:29:32 +0900 Subject: [PATCH 2144/3171] Fixes #2151 --- _data/locales/ja.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_data/locales/ja.yml b/_data/locales/ja.yml index d671aa0878..54543eef87 100644 --- a/_data/locales/ja.yml +++ b/_data/locales/ja.yml @@ -65,10 +65,10 @@ sidebar: text: 日本Rubyの会 url: http://ruby-no-kai.org/ description: Rubyの利用者/開発者の支援を目的としたグループです。 - weblogs: - text: 更新順リンク - url: http://www.rubyist.net/~kazu/samidare/ - description: Ruby関連のサイトのリンクを更新順に並べたものです。 + # weblogs: + # text: 更新順リンク + # url: http://www.rubyist.net/~kazu/samidare/ + # description: Ruby関連のサイトのリンクを更新順に並べたものです。 # ruby_core: # text: Ruby Core # url: /ja/community/ruby-core/ From fca1542763449250261863927fe1e455e7ca63c1 Mon Sep 17 00:00:00 2001 From: ytjmt <46666464+ytjmt@users.noreply.github.com> Date: Wed, 17 Nov 2021 00:21:45 +0900 Subject: [PATCH 2145/3171] Translate "CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods" (ja) --- ...arsing-method-regexp-dos-cve-2021-41817.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ja/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md diff --git a/ja/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/ja/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md new file mode 100644 index 0000000000..87f5fd3cfa --- /dev/null +++ b/ja/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -0,0 +1,34 @@ +--- +layout: news_post +title: "CVE-2021-41817: 日付をパースするメソッドにおける正規表現 Denial of Service の脆弱性について" +author: "mame" +translator: "ytjmt" +date: 2021-11-15 08:00:00 +0000 +tags: security +lang: ja +--- + +日付をパースするメソッドにおける正規表現 Denial of Service(ReDoS)脆弱性の修正を含む、date gem 3.2.1、3.1.2、3.0.2、2.0.1 をリリースしました。攻撃者はこの脆弱性を悪用し、効果的な DoS 攻撃を引き起こすことができます。 + +## 詳細 + +`Date.parse` を含む、日付をパースするメソッドの内部では正規表現を利用しており、これらには ReDoS 攻撃に対して脆弱なものがあります。信頼できない入力値に対してこれらのメソッドを適用しているアプリケーションおよびライブラリはこの脆弱性の影響を受ける可能性があります。 + +この修正では、正規表現を変更するのではなく、入力値をデフォルトで 128 バイトまでに制限するようにしています。date gem は多くの正規表現を利用しており、脆弱性のある正規表現が他にも潜んでいる可能性があるためです。互換性のため、`Date.parse(str, limit: nil)` のように、`limit` に `nil` を明示的に渡すことでこの制限を除外することができますが、パースに時間がかかる可能性があることに留意してください。 + +date gem を 3.2.1、3.1.2、3.0.2、2.0.1 かそれ以降のバージョンにアップデートしてください。`gem update date` でアップデートできます。もし bundler を使っている場合は、`Gemfile` に `gem "date", ">= 3.2.1"` を追加してください。 + +## 影響を受けるバージョン + +* date gem 2.0.0 およびそれ以前のバージョン(Ruby 2.6 系列にバンドルされているバージョン) +* date gem 3.0.1 およびそれ以前のバージョン(Ruby 2.7 系列にバンドルされているバージョン) +* date gem 3.1.1 およびそれ以前のバージョン(Ruby 3.0 系列にバンドルされているバージョン) +* date gem 3.2.0 およびそれ以前のバージョン + +## クレジット + +この脆弱性情報は、[svalkanov](https://github.com/SValkanov/) 氏によって報告されました。 + +## 更新履歴 + +* 2021-11-15 17:00:00 (JST) 初版 From e873b532af40e4aee365e897d2b0137a5d68fb34 Mon Sep 17 00:00:00 2001 From: Alexander Ilyin Date: Thu, 18 Nov 2021 14:04:20 +0300 Subject: [PATCH 2146/3171] Update link to es/community/ruby-core (es) (#2724) The following issue is completely resolved with #2708. close #2530 --- _data/locales/es.yml | 4 ++-- es/community/index.md | 2 +- es/community/ruby-core/writing-patches/index.md | 5 ++++- es/downloads/index.md | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/_data/locales/es.yml b/_data/locales/es.yml index e193c328f9..78e3defea1 100644 --- a/_data/locales/es.yml +++ b/_data/locales/es.yml @@ -67,8 +67,8 @@ sidebar: url: /en/community/weblogs/ description: Entérate de lo que está sucediendo en la comunidad. ruby_core: - text: Ruby Core (en inglés) - url: /en/community/ruby-core/ + text: Ruby Core + url: /es/community/ruby-core/ description: Ayuda a mejorar el futuro de Ruby. issue_tracking: text: Reportes de errores diff --git a/es/community/index.md b/es/community/index.md index 6519d5a42a..f7ddb68944 100644 --- a/es/community/index.md +++ b/es/community/index.md @@ -29,7 +29,7 @@ donde empezar: : El canal IRC The Ruby Language es un buen lugar para chatear con otros compañeros Rubyistas. -[El Core de Ruby](/en/community/ruby-core/) (en inglés) +[El Core de Ruby](/es/community/ruby-core/) : Con Ruby 2.0 en camino, ahora es un buen momento para seguir cómo va su desarrollo. Si estás interesado en ayudar con Ruby, comienza por aquí. diff --git a/es/community/ruby-core/writing-patches/index.md b/es/community/ruby-core/writing-patches/index.md index 4652a7aa21..e25b2acdd6 100644 --- a/es/community/ruby-core/writing-patches/index.md +++ b/es/community/ruby-core/writing-patches/index.md @@ -42,6 +42,9 @@ en la lista de distribución de Ruby-Core: Un parche que proporciona casos de prueba (preferiblemente un parche para `test/*/test_*.rb`) nos ayudaría a comprender el parche y su intención. -Podríamos pasar a un flujo de trabajo push/pull estilo Git en el futuro.. +Podríamos pasar a un flujo de trabajo push/pull estilo Git en el futuro. Pero hasta entonces, seguir las pautas anteriores te ayudaría a evitar una frustración. + + +[ruby-core-post]: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/25139 diff --git a/es/downloads/index.md b/es/downloads/index.md index 80eec23e09..f5fdf3886a 100644 --- a/es/downloads/index.md +++ b/es/downloads/index.md @@ -63,7 +63,7 @@ antes mencionadas. Pueden servirte de ayuda. Puede contener errores, ¡úsalo bajo tu responsabilidad! Para información sobre los repositorios de Subversion y Git, consulta -nuestra página [Ruby core](/en/community/ruby-core/) (en inglés). +nuestra página [Ruby Core](/es/community/ruby-core/). El código fuente de Ruby está disponible desde un conjunto de [sitios espejo][mirrors] a lo largo del mundo. From d68292788396b07e3bc124d1f7a8a253c2ce835e Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 24 Nov 2021 10:26:32 +0900 Subject: [PATCH 2147/3171] update bundles --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ebfc7e5301..a1468eaa52 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,14 +6,14 @@ GEM colorator (1.1.0) concurrent-ruby (1.1.9) crass (1.0.6) - em-websocket (0.5.2) + em-websocket (0.5.3) eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) + http_parser.rb (~> 0) eventmachine (1.2.7) ffi (1.15.4) forwardable-extended (2.6.0) - http_parser.rb (0.6.0) - i18n (1.8.10) + http_parser.rb (0.8.0) + i18n (1.8.11) concurrent-ruby (~> 1.0) jekyll (4.2.1) addressable (~> 2.4) @@ -122,4 +122,4 @@ RUBY VERSION ruby 3.0.2p107 BUNDLED WITH - 2.2.27 + 2.2.31 From 70f838f342d14b61c1b44b79c946594de485d053 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Tue, 16 Nov 2021 17:48:36 +0900 Subject: [PATCH 2148/3171] Add draft release announcements Two CVEs about cgi gem are included CVE-2021-41816: Buffer Overrun in CGI.escape_html CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse --- ...errun-in-cgi-escape_html-cve-2021-41816.md | 36 +++++++++++ ...fing-in-cgi-cookie-parse-cve-2021-41819.md | 47 +++++++++++++++ .../_posts/2021-11-24-ruby-2-6-9-released.md | 59 +++++++++++++++++++ .../_posts/2021-11-24-ruby-2-7-5-released.md | 58 ++++++++++++++++++ .../_posts/2021-11-24-ruby-3-0-3-released.md | 49 +++++++++++++++ 5 files changed, 249 insertions(+) create mode 100644 en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md create mode 100644 en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md create mode 100644 en/news/_posts/2021-11-24-ruby-2-6-9-released.md create mode 100644 en/news/_posts/2021-11-24-ruby-2-7-5-released.md create mode 100644 en/news/_posts/2021-11-24-ruby-3-0-3-released.md diff --git a/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md b/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md new file mode 100644 index 0000000000..295402c7bb --- /dev/null +++ b/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md @@ -0,0 +1,36 @@ +--- +layout: news_post +title: "CVE-2021-41816: Buffer Overrun in CGI.escape_html +author: "mame" +translator: +date: 2021-11-24 12:00:00 +0000 +tags: security +lang: en +--- + +A buffer overrun vulnerability was discovered in CGI.escape_html. +This vulnerability has been assigned the CVE identifier [CVE-2021-41816](https://nvd.nist.gov/vuln/detail/CVE-2021-41816). +We strongly recommend upgrading Ruby. + +## Details + +A security vulnerability that causes buffer overflow when you pass a very large string (> 700 MB) to `CGI.escape_html` on a platform where `long` type takes 4 bytes, typically, Windows. + +Please update the cgi gem to version 0.3.1, 0.2,1, and 0.1,1 or later. You can use `gem update cgi` to update it. If you are using bundler, please add `gem "cgi", ">= 0.3.1"` to your `Gemfile`. +Alternatively, please update Ruby to 2.7.5 or 3.0.3. + +This issue has been introduced since Ruby 2.7, so the cgi version bundled with Ruby 2.6 is not vulnerable. + +## Affected versions + +* cgi gem 0.1.0 or prior (which are bundled versions with Ruby 2.7 series) +* cgi gem 0.2.0 or prior (which are bundled versions with Ruby 3.0 series) +* cgi gem 0.3.0 or prior + +## Credits + +Thanks to [chamal](https://hackerone.com/chamal) for discovering this issue. + +## History + +* Originally published at 2021-11-24 12:00:00 (UTC) diff --git a/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md b/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md new file mode 100644 index 0000000000..819535495c --- /dev/null +++ b/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md @@ -0,0 +1,47 @@ +--- +layout: news_post +title: "CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse" +author: "mame" +translator: +date: 2021-11-24 12:00:00 +0000 +tags: security +lang: en +--- + +A cookie prefix spoofing vulnerability was discovered in CGI::Cookie.parse. +This vulnerability has been assigned the CVE identifier [CVE-2021-41819](https://nvd.nist.gov/vuln/detail/CVE-2021-41819). +We strongly recommend upgrading Ruby. + +## Details + +The old versions of `CGI::Cookie.parse` applied URL decoding to cookie names. +An attacker could exploit this vulnerability to spoof security prefixes in cookie names, which may be able to trick a vulnerable application. + +By this fix, `CGI::Cookie.parse` no longer decodes cookie names. +Note that this is an incompatibility if cookie names that you are using include non-alphanumeric characters that are URL-encoded. + +This is the same issue of [CVE-2020-8184](https://nvd.nist.gov/vuln/detail/CVE-2020-8184). + +If you are using Ruby 2.7 or 3.0: + +* Please update the cgi gem to version 0.3.1, 0.2,1, and 0.1,1 or later. You can use `gem update cgi` to update it. If you are using bundler, please add `gem "cgi", ">= 0.3.1"` to your `Gemfile`. +* Alternatively, please update Ruby to 2.7.5 or 3.0.3. + +If you are using Ruby 2.6: + +* Please update Ruby to 2.6.9. *You cannot use `gem update cgi` for Ruby 2.6 or prior.* + +## Affected versions + +* ruby 2.6.8 or prior (You can *not* use `gem update cgi` for this version.) +* cgi gem 0.1.0 or prior (which are bundled versions with Ruby 2.7 series) +* cgi gem 0.2.0 or prior (which are bundled versions with Ruby 3.0 series) +* cgi gem 0.3.0 or prior + +## Credits + +Thanks to [ooooooo_q](https://hackerone.com/ooooooo_q) for discovering this issue. + +## History + +* Originally published at 2021-11-24 12:00:00 (UTC) diff --git a/en/news/_posts/2021-11-24-ruby-2-6-9-released.md b/en/news/_posts/2021-11-24-ruby-2-6-9-released.md new file mode 100644 index 0000000000..c77b23e7ed --- /dev/null +++ b/en/news/_posts/2021-11-24-ruby-2-6-9-released.md @@ -0,0 +1,59 @@ +--- +layout: news_post +title: "Ruby 2.6.9 Released" +author: "usa" +translator: +date: 2021-11-24 12:00:00 +0000 +lang: en +--- + +Ruby 2.6.9 has been released. + +This release includes security fixes. +Please check the topics below for details. + +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link 2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link 2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) + +See the [commit logs](https://github.com/ruby/ruby/compare/v2_6_8...v2_6_9) for details. + +Ruby 2.6 is now under the state of the security maintenance phase, until the end of March of 2022. +After that date, maintenance of Ruby 2.6 will be ended. +We recommend you start planning the migration to newer versions of Ruby, such as 3.0 or 2.7. + +## Download + +{% assign release = site.data.releases | where: "version", "2.6.9" | first %} + +* <{{ release.url.bz2 }}> + + SIZE: {{ release.size.bz2 }} + SHA1: {{ release.sha1.bz2 }} + SHA256: {{ release.sha256.bz2 }} + SHA512: {{ release.sha512.bz2 }} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Release Comment + +Many committers, developers, and users who provided bug reports helped us make this release. +Thanks for their contributions. diff --git a/en/news/_posts/2021-11-24-ruby-2-7-5-released.md b/en/news/_posts/2021-11-24-ruby-2-7-5-released.md new file mode 100644 index 0000000000..f1ec0cfee1 --- /dev/null +++ b/en/news/_posts/2021-11-24-ruby-2-7-5-released.md @@ -0,0 +1,58 @@ +--- +layout: news_post +title: "Ruby 2.7.5 Released" +author: "usa" +translator: +date: 2021-11-24 12:00:00 +0000 +lang: en +--- + +Ruby 2.7.5 has been released. + +This release includes security fixes. +Please check the topics below for details. + +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link 2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41816: Buffer Overrun in CGI.escape_html]({%link 2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link 2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) + +See the [commit logs](https://github.com/ruby/ruby/compare/v2_7_4...v2_7_5) for details. + +## Download + +{% assign release = site.data.releases | where: "version", "2.7.5" | first %} + +* <{{ release.url.bz2 }}> + + SIZE: {{ release.size.bz2 }} + SHA1: {{ release.sha1.bz2 }} + SHA256: {{ release.sha256.bz2 }} + SHA512: {{ release.sha512.bz2 }} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Release Comment + +Many committers, developers, and users who provided bug reports helped us make this release. +Thanks for their contributions. + +The maintenance of Ruby 2.7, including this release, is based on the "Agreement for the Ruby stable version" of the Ruby Association. diff --git a/en/news/_posts/2021-11-24-ruby-3-0-3-released.md b/en/news/_posts/2021-11-24-ruby-3-0-3-released.md new file mode 100644 index 0000000000..cbfe661807 --- /dev/null +++ b/en/news/_posts/2021-11-24-ruby-3-0-3-released.md @@ -0,0 +1,49 @@ +--- +layout: news_post +title: "Ruby 3.0.3 Released" +author: "nagachika" +translator: +date: 2021-11-24 12:00:00 +0000 +lang: en +--- + +Ruby 3.0.3 has been released. + +This release includes security fixes. +Please check the topics below for details. + +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link 2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41816: Buffer Overrun in CGI.escape_html]({%link 2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link 2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) + +See the [commit logs](https://github.com/ruby/ruby/compare/v3_0_2...v3_0_3) for details. + +## Download + +{% assign release = site.data.releases | where: "version", "3.0.3" | first %} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Release Comment + +Many committers, developers, and users who provided bug reports helped us make this release. +Thanks for their contributions. From e0e0676c982108ac81c910bb6aba630bcd91430c Mon Sep 17 00:00:00 2001 From: nagachika Date: Wed, 24 Nov 2021 21:49:49 +0900 Subject: [PATCH 2149/3171] Update _data/downloads.yml and _data/releases.yml --- _data/downloads.yml | 6 ++-- _data/releases.yml | 82 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/_data/downloads.yml b/_data/downloads.yml index ff61bd1094..54a2601a06 100644 --- a/_data/downloads.yml +++ b/_data/downloads.yml @@ -8,13 +8,13 @@ preview: stable: - - 3.0.2 - - 2.7.4 + - 3.0.3 + - 2.7.5 # optional security_maintenance: - - 2.6.8 + - 2.6.9 # optional eol: diff --git a/_data/releases.yml b/_data/releases.yml index 15878152b8..82ff598065 100644 --- a/_data/releases.yml +++ b/_data/releases.yml @@ -52,6 +52,30 @@ # 3.0 series +- version: 3.0.3 + date: '2021-11-24' + post: "/en/news/2021/11/24/ruby-3-0-3-released/" + url: + gz: https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.3.tar.gz + xz: https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.3.tar.xz + zip: https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.3.zip + size: + gz: 20242729 + xz: 14991880 + zip: 24627744 + sha1: + gz: '049317b7c6246d6ea86564c3f73a629b766ff634' + xz: c1e6dac2b8c08afbbee39e25e325c84e1cab7c17 + zip: 5341ed1602a3289c4857560ead53191895e5c586 + sha256: + gz: 3586861cb2df56970287f0fd83f274bd92058872d830d15570b36def7f1a92ac + xz: 88cc7f0f021f15c4cd62b1f922e3a401697f7943551fe45b1fdf4f2417a17a9c + zip: 0b8370e404550bf736f46307a14eb9306a7868fb8d54e1418ecdaccbaa8ac06f + sha512: + gz: 39dab51a0d784a38302372b99f96205817d466245202586d22123745761e9cb39db128ec2b984ebc3919b9faf2adf828d19c97d3fb1e56d44be0a81dc5d11b87 + xz: bb9ea426278d5a7ac46595296f03b82d43df8b7db41045cdf85611e05e26c703c53f700494cd7cf5d4c27fa953bdc5c144317d7720812db0a6e3b6f4bc4d2e00 + zip: 24c2a4f455f90e54f85d9565e392519833b36aefce32dc707e6693994d175c82e84ee6c37ed4a9ddf8840479e7cdfaae714c12bc6923368bb00346d4edd434d8 + - version: 3.0.2 date: '2021-07-07' post: "/en/news/2021/07/07/ruby-3-0-2-released/" @@ -220,6 +244,35 @@ # 2.7 series +- version: 2.7.5 + date: '2021-11-24' + post: "/en/news/2021/11/24/ruby-2-7-5-released/" + url: + bz2: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.5.tar.bz2 + gz: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.5.tar.gz + xz: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.5.tar.xz + zip: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.5.zip + size: + bz2: 14805180 + gz: 16923709 + xz: 12072980 + zip: 20702176 + sha1: + bz2: 2a179b601f45172b1cb38e8f157c4e6ce272c22c + gz: c2d0f6c793f9e673f9fb22276d32f8c395ec5581 + xz: 1d04fbf24150eaa1297a7ef4c7057ec0a9dca527 + zip: 541b34fa5e7e55b6269a2bfa67e2a06ad0dcb571 + sha256: + bz2: d6b444341a5e06fcd6eaf1feb83a1c0c2da4705dbe4f275ee851761b185f4bd1 + gz: 2755b900a21235b443bb16dadd9032f784d4a88f143d852bc5d154f22b8781f1 + xz: d216d95190eaacf3bf165303747b02ff13f10b6cfab67a9031b502a49512b516 + zip: 3793d764ec8da68203eba1a7fe338fae9bafa8226cce911c8648c1b7c32ba9c2 + sha512: + bz2: 0aa2ac44bc22859a39c43d08b7c7f457df05c2dc36b2574fd70ca399143ef1000dc5e496212db9eb055bc4258523d47d26db3c57a1a5a5d63cf1b3de9f81645a + gz: '09e029b5cc15b6e4e37bcf15adb28213eaedec3ea22106d63095b37ea6b2a2b68e82e74e6b50746c87dd77e5185795d014e0db118bf0f45ffa0b0a307f5f65da' + xz: 21c8a713e3ce115fc4c405113ac691ddcefc3419f528b93ca1ac59e7052c1b6e9e241da0e570e291e567f28f3d840824dbcc5967b216cbe7d6ca7a05580fa311 + zip: fe9a706f8139e59a40ab205dc88cdc613c9c69186cb2daeb5adc80bdf45290a523fa7e3fd0866fa12325039ba413ff1e1f4233073d352da08079dc903063b31a + - version: 2.7.4 date: '2021-07-07' post: "/en/news/2021/07/07/ruby-2-7-4-released/" @@ -495,6 +548,35 @@ # 2.6 series +- version: 2.6.9 + date: '2021-11-24' + post: "/en/news/2021/11/24/ruby-2-6-9-released/" + url: + bz2: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.9.tar.bz2 + gz: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.9.tar.gz + xz: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.9.tar.xz + zip: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.9.zip + size: + bz2: 14137792 + gz: 16202802 + xz: 11590064 + zip: 19869379 + sha1: + bz2: a482c36645e7ff4596c6aca2cf96d15481fcfc5e + gz: 00e69747e7e2b87155c65b4003470313e4403b0a + xz: fc67ca162010aac4af49d73a8c48be5cb2fb5907 + zip: 41a60c783306f4b47b867bd19d16688b546b8e3a + sha256: + bz2: a0639060c4519572e51828eb742f09dd40f154c820f6007246de7a2090e3ee45 + gz: eb7bae7aac64bf9eb2153710a4cafae450ccbb62ae6f63d573e1786178b0efbb + xz: 6a041d82ae6e0f02ccb1465e620d94a7196489d8a13d6018a160da42ebc1eece + zip: 2480dbdc72d3dc832d8254e938e4861ca54a5337edd6f358e5202fd2a5339eec + sha512: + bz2: ff067ebc059094c0a9a0debf54a37aad2c85f7ed47be59299041c9c03a7701529f5063ff32a1b8c56d48ee8585015acba63602ed0176b2797d263d43d67aa241 + gz: 24bd6c8f528907349bcf392ed75a2d767b93a35a9f4c839267873d1dde862d3292d1682e0edc56c078a2690de76a045ef866f54eab8a330a18771f0b234c5993 + xz: f60aa89e685cea324185eb0d13e6b44caef4e4f761cbf9ea1386ae70e39faf3866ac01e4bb5354574f2583e74290b8c80eaf63d126040d52368be6c771476451 + zip: 9073e0fc5040434f15158f24c6a551286bc5f1c4c1cb54d6e3debb4ac039187a4f274a217bdb5c8489c72360c65d708f89eb0f2472a1f9232fcfee8e296dec57 + - version: 2.6.8 date: '2021-07-07' post: "/en/news/2021/07/07/ruby-2-6-8-released/" From 4bf4abd033de802876e8427560c3815160d81969 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Wed, 24 Nov 2021 21:55:29 +0900 Subject: [PATCH 2150/3171] Fix paths to security announcements --- ...1-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md | 2 +- en/news/_posts/2021-11-24-ruby-2-6-9-released.md | 4 ++-- en/news/_posts/2021-11-24-ruby-2-7-5-released.md | 6 +++--- en/news/_posts/2021-11-24-ruby-3-0-3-released.md | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md b/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md index 295402c7bb..d4d131f3e7 100644 --- a/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md +++ b/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md @@ -1,6 +1,6 @@ --- layout: news_post -title: "CVE-2021-41816: Buffer Overrun in CGI.escape_html +title: "CVE-2021-41816: Buffer Overrun in CGI.escape_html" author: "mame" translator: date: 2021-11-24 12:00:00 +0000 diff --git a/en/news/_posts/2021-11-24-ruby-2-6-9-released.md b/en/news/_posts/2021-11-24-ruby-2-6-9-released.md index c77b23e7ed..d331c95b12 100644 --- a/en/news/_posts/2021-11-24-ruby-2-6-9-released.md +++ b/en/news/_posts/2021-11-24-ruby-2-6-9-released.md @@ -12,8 +12,8 @@ Ruby 2.6.9 has been released. This release includes security fixes. Please check the topics below for details. -* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link 2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) -* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link 2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) See the [commit logs](https://github.com/ruby/ruby/compare/v2_6_8...v2_6_9) for details. diff --git a/en/news/_posts/2021-11-24-ruby-2-7-5-released.md b/en/news/_posts/2021-11-24-ruby-2-7-5-released.md index f1ec0cfee1..12148db025 100644 --- a/en/news/_posts/2021-11-24-ruby-2-7-5-released.md +++ b/en/news/_posts/2021-11-24-ruby-2-7-5-released.md @@ -12,9 +12,9 @@ Ruby 2.7.5 has been released. This release includes security fixes. Please check the topics below for details. -* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link 2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) -* [CVE-2021-41816: Buffer Overrun in CGI.escape_html]({%link 2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) -* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link 2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41816: Buffer Overrun in CGI.escape_html]({%link en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) See the [commit logs](https://github.com/ruby/ruby/compare/v2_7_4...v2_7_5) for details. diff --git a/en/news/_posts/2021-11-24-ruby-3-0-3-released.md b/en/news/_posts/2021-11-24-ruby-3-0-3-released.md index cbfe661807..6f98e03b33 100644 --- a/en/news/_posts/2021-11-24-ruby-3-0-3-released.md +++ b/en/news/_posts/2021-11-24-ruby-3-0-3-released.md @@ -12,9 +12,9 @@ Ruby 3.0.3 has been released. This release includes security fixes. Please check the topics below for details. -* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link 2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) -* [CVE-2021-41816: Buffer Overrun in CGI.escape_html]({%link 2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) -* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link 2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41816: Buffer Overrun in CGI.escape_html]({%link en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) See the [commit logs](https://github.com/ruby/ruby/compare/v3_0_2...v3_0_3) for details. From 1bc1ca7aa3a699d4aaafaa21455b05b9e62edcee Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Wed, 24 Nov 2021 22:09:28 +0900 Subject: [PATCH 2151/3171] CVE-2021-41817: Mention CVE number --- .../2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md | 1 + 1 file changed, 1 insertion(+) diff --git a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md index 9306b21675..ba7f5d48c8 100644 --- a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md +++ b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -9,6 +9,7 @@ lang: en --- We have released date gem version 3.2.1, 3.1.2, 3.0.2, and 2.0.1 that include a security fix for a regular expression denial of service vulnerability (ReDoS) on date parsing methods. An attacker can exploit this vulnerability to cause an effective DoS attack. +This vulnerability has been assigned the CVE identifier [CVE-2021-41817](https://nvd.nist.gov/vuln/detail/CVE-2021-41817). ## Details From 02a8c620346bc773df34d4c8ef4ed2593b326afe Mon Sep 17 00:00:00 2001 From: "U.Nakamura" Date: Wed, 24 Nov 2021 22:25:14 +0900 Subject: [PATCH 2152/3171] Mention about newer Ruby releases --- ...11-15-date-parsing-method-regexp-dos-cve-2021-41817.md | 8 +++++--- ...24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md | 4 ++-- ...-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md index ba7f5d48c8..a67e911725 100644 --- a/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md +++ b/en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -18,12 +18,13 @@ Date's parsing methods including `Date.parse` are using Regexps internally, some The fix limits the input length up to 128 bytes by default instead of changing the regexps. This is because Date gem uses many Regexps and it is possible that there are still undiscovered vulnerable Regexps. For compatibility, it is allowed to remove the limitation by explicitly passing `limit` keywords as `nil` like `Date.parse(str, limit: nil)`, but note that it may take a long time to parse. Please update the date gem to version 3.2.1, 3.1.2, 3.0.2, and 2.0.1, or later. You can use `gem update date` to update it. If you are using bundler, please add `gem "date", ">= 3.2.1"` to your `Gemfile`. +Alternatively, you can update Ruby to 3.0.3, 2.7.5, 2.6.9 or later. ## Affected versions -* date gem 2.0.0 or prior (which are bundled versions with Ruby 2.6 series) -* date gem 3.0.1 or prior (which are bundled versions with Ruby 2.7 series) -* date gem 3.1.1 or prior (which are bundled versions with Ruby 3.0 series) +* date gem 2.0.0 or prior (which are bundled versions with Ruby 2.6 series prior to Ruby 2.6.9) +* date gem 3.0.1 or prior (which are bundled versions with Ruby 2.7 series prior to Ruby 2.7.5) +* date gem 3.1.1 or prior (which are bundled versions with Ruby 3.0 series prior to Ruby 3.0.3) * date gem 3.2.0 or prior ## Credits @@ -33,3 +34,4 @@ Thanks to [svalkanov](https://github.com/SValkanov/) for discovering this issue. ## History * Originally published at 2021-11-15 08:00:00 (UTC) +* Mention about new Ruby releases at 2021-11-24 13:20:00 (UTC) diff --git a/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md b/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md index d4d131f3e7..01fe66fc93 100644 --- a/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md +++ b/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md @@ -23,8 +23,8 @@ This issue has been introduced since Ruby 2.7, so the cgi version bundled with R ## Affected versions -* cgi gem 0.1.0 or prior (which are bundled versions with Ruby 2.7 series) -* cgi gem 0.2.0 or prior (which are bundled versions with Ruby 3.0 series) +* cgi gem 0.1.0 or prior (which are bundled versions with Ruby 2.7 series prior to Ruby 2.7.5) +* cgi gem 0.2.0 or prior (which are bundled versions with Ruby 3.0 series prior to Ruby 3.0.3) * cgi gem 0.3.0 or prior ## Credits diff --git a/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md b/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md index 819535495c..7db6824007 100644 --- a/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md +++ b/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md @@ -34,8 +34,8 @@ If you are using Ruby 2.6: ## Affected versions * ruby 2.6.8 or prior (You can *not* use `gem update cgi` for this version.) -* cgi gem 0.1.0 or prior (which are bundled versions with Ruby 2.7 series) -* cgi gem 0.2.0 or prior (which are bundled versions with Ruby 3.0 series) +* cgi gem 0.1.0 or prior (which are bundled versions with Ruby 2.7 series prior to Ruby 2.7.5) +* cgi gem 0.2.0 or prior (which are bundled versions with Ruby 3.0 series prior to Ruby 3.0.3) * cgi gem 0.3.0 or prior ## Credits From ce20e7f9ae6a7ceae9b54843b283727645da338a Mon Sep 17 00:00:00 2001 From: "U.Nakamura" Date: Wed, 24 Nov 2021 22:33:42 +0900 Subject: [PATCH 2153/3171] Japanese translations of Ruby releases --- .../_posts/2021-11-24-ruby-2-6-9-released.md | 59 +++++++++++++++++++ .../_posts/2021-11-24-ruby-2-7-5-released.md | 57 ++++++++++++++++++ .../_posts/2021-11-24-ruby-3-0-3-released.md | 48 +++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 ja/news/_posts/2021-11-24-ruby-2-6-9-released.md create mode 100644 ja/news/_posts/2021-11-24-ruby-2-7-5-released.md create mode 100644 ja/news/_posts/2021-11-24-ruby-3-0-3-released.md diff --git a/ja/news/_posts/2021-11-24-ruby-2-6-9-released.md b/ja/news/_posts/2021-11-24-ruby-2-6-9-released.md new file mode 100644 index 0000000000..54370aec78 --- /dev/null +++ b/ja/news/_posts/2021-11-24-ruby-2-6-9-released.md @@ -0,0 +1,59 @@ +--- +layout: news_post +title: "Ruby 2.6.9 リリース" +author: "usa" +translator: +date: 2021-11-24 12:00:00 +0000 +lang: ja +--- + +Ruby 2.6.9 がリリースされました。 + +このリリースでは以下の脆弱性修正が含まれています。 +詳しくは以下の記事などを参照してください。 + +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) + +詳しくは [commit log](https://github.com/ruby/ruby/compare/v2_6_8...v2_6_9) を参照してください。 + +Ruby 2.6 系列は、現在、セキュリティメンテナンスフェーズにあります。 +このフェーズ中は、重大なセキュリティ上の問題への対応のみが行われます。 +現在の予定では、2022 年 3 月末頃を目処に、2.6 系列のセキュリティメンテナンスならびに公式サポートは終了する見込みです。 +現在、2.6 系列を利用しているユーザーの皆さんは、なるべく早く、3.0 系列等のより新しいバージョン系列の Ruby への移行を検討されるよう、お勧めします。 + +## ダウンロード + +{% assign release = site.data.releases | where: "version", "2.6.9" | first %} + +* <{{ release.url.bz2 }}> + + SIZE: {{ release.size.bz2 }} + SHA1: {{ release.sha1.bz2 }} + SHA256: {{ release.sha256.bz2 }} + SHA512: {{ release.sha512.bz2 }} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## リリースコメント + +このリリースに協力してくださった皆様、特に、脆弱性を報告してくださった方々に深く感謝します。 diff --git a/ja/news/_posts/2021-11-24-ruby-2-7-5-released.md b/ja/news/_posts/2021-11-24-ruby-2-7-5-released.md new file mode 100644 index 0000000000..79f7898c56 --- /dev/null +++ b/ja/news/_posts/2021-11-24-ruby-2-7-5-released.md @@ -0,0 +1,57 @@ +--- +layout: news_post +title: "Ruby 2.7.5 リリース" +author: "usa" +translator: +date: 2021-11-24 12:00:00 +0000 +lang: ja +--- + +Ruby 2.7.5 がリリースされました。 + +このリリースでは以下の脆弱性修正が含まれています。 +詳しくは以下の記事などを参照してください。 + +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41816: Buffer Overrun in CGI.escape_html]({%link en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) + +その他の変更については [commit log](https://github.com/ruby/ruby/compare/v2_7_4...v2_7_5) を参照してください。 + +## ダウンロード + +{% assign release = site.data.releases | where: "version", "2.7.5" | first %} + +* <{{ release.url.bz2 }}> + + SIZE: {{ release.size.bz2 }} + SHA1: {{ release.sha1.bz2 }} + SHA256: {{ release.sha256.bz2 }} + SHA512: {{ release.sha512.bz2 }} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## リリースコメント + +Ruby 開発者の皆様、バグや脆弱性を報告してくれたユーザーの皆様のご協力により本リリースは行われています。 皆様のご協力に感謝します。 + +本リリースを含む Ruby 2.7 のメンテナンスは Ruby アソシエーションの「Ruby 安定版保守事業」に基づき行われています。 diff --git a/ja/news/_posts/2021-11-24-ruby-3-0-3-released.md b/ja/news/_posts/2021-11-24-ruby-3-0-3-released.md new file mode 100644 index 0000000000..54e009a6aa --- /dev/null +++ b/ja/news/_posts/2021-11-24-ruby-3-0-3-released.md @@ -0,0 +1,48 @@ +--- +layout: news_post +title: "Ruby 3.0.3 リリース" +author: "nagachika" +translator: "usa" +date: 2021-11-24 12:00:00 +0000 +lang: ja +--- + +Ruby 3.0.3 がリリースされました。 + +このリリースでは以下の脆弱性修正が含まれています。 +詳しくは以下の記事などを参照してください。 + +* [CVE-2021-41817: Regular Expression Denial of Service Vulnerability of Date Parsing Methods]({%link en/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41816: Buffer Overrun in CGI.escape_html]({%link en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) +* [CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse]({%link en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) + +その他の変更については [commit log](https://github.com/ruby/ruby/compare/v3_0_2...v3_0_3) を参照してください。 + +## ダウンロード + +{% assign release = site.data.releases | where: "version", "3.0.3" | first %} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## リリースコメント + +このリリースにあたり、多くのコミッター、開発者、バグ報告をしてくれたユーザーの皆様に感謝を申し上げます。 From b81a58d0a54adf0c00e6b46a1ab32ceeb274ef89 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Thu, 25 Nov 2021 17:05:38 +0900 Subject: [PATCH 2154/3171] Japanese translation of "CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse" Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md) to ja. --- ...fing-in-cgi-cookie-parse-cve-2021-41819.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 ja/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md diff --git a/ja/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md b/ja/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md new file mode 100644 index 0000000000..5296d1d12f --- /dev/null +++ b/ja/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md @@ -0,0 +1,47 @@ +--- +layout: news_post +title: "CVE-2021-41819: CGI::Cookie.parse 内の Cookie プレフィックスの偽装" +author: "mame" +translator: "jinroq" +date: 2021-11-24 12:00:00 +0000 +tags: security +lang: ja +--- + +CGI :: Cookie.parse 内で Cookie プレフィックスを偽装する脆弱性が発見されました。 +この脆弱性は、[CVE-2021-41819](https://nvd.nist.gov/vuln/detail/CVE-2021-41819) として登録されています。 +Ruby をアップグレードすることを強く推奨します。 + +## 詳細 + +古いバージョンの `CGI :: Cookie.parse` は、Cookie 名 に URL デコード を適用していました。 +ところが、悪意を持った攻撃者はこの脆弱性を利用して Cookie 名のセキュリティプレフィックスを偽装し、脆弱なアプリケーションをだます可能性があります。 + +この修正により、 `CGI :: Cookie.parse` は Cookie 名をデコードしなくなりました。 +使用している Cookie 名に、URL エンコードされた英数字以外の文字が含まれている場合、これは非互換であることに注意してください。 + +これは [CVE-2020-8184](https://nvd.nist.gov/vuln/detail/CVE-2020-8184) と同じ問題です。 + +Ruby 2.7 もしくは 3.0 を使用している場合: + +* cgi gem をバージョン 0.3.1, 0.2.1, 0.1.1 もしくはこれら以上のバージョンに更新してください。 `gem update cgi` を使用して更新できます。bundler を使用している場合は、 `Gemfile` に `gem "cgi", "> = 0.3.1"` を追加してください。 +* または、Ruby を 2.7.5 または 3.0.3 に更新してください。 + +Ruby 2.6 を使用している場合: + +* Rubyを 2.6.9 に更新してください。 *Ruby 2.6 以前では `gem update cgi` は使用できません。* + +## 影響を受けるバージョン + +* ruby​​ 2.6.8 以前(このバージョンでは `gem update cgi` を *使用できません*。) +* cgi gem 0.1.0 以前(Ruby 2.7.5 より前にバンドルされている Ruby 2.7 系列) +* cgi gem 0.2.0 以前(Ruby 3.0.3 より前にバンドルされている Ruby3.0 系列) +* cgi gem 0.3.0 以前 + +## クレジット + +この脆弱性情報は、[ooooooo_q](https://hackerone.com/ooooooo_q) 氏によって報告されました。 + +## 更新履歴 + +* 2021-11-24 21:00:00 (JST) 初版 From 9c7a4efab47960ddbbf17df91090b941f4fd2214 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 16:10:04 +0900 Subject: [PATCH 2155/3171] Fixed a command `gem upgrade rexml` -> `gem update rexml` --- ...4-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md b/en/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md index f4b0a0acf7..b6225aa9cc 100644 --- a/en/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md +++ b/en/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md @@ -29,7 +29,7 @@ If you are using Ruby 2.5.8 or prior: ## Affected versions -* Ruby 2.5.8 or prior (You can NOT use `gem upgrade rexml` for this version.) +* Ruby 2.5.8 or prior (You can NOT use `gem update rexml` for this version.) * Ruby 2.6.6 or prior * Ruby 2.7.2 or prior * Ruby 3.0.0 From af0e7e8562e60de55cd8fb9c3862a0f99d2e0f8c Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 21:21:41 +0900 Subject: [PATCH 2156/3171] Fixed a bug. Fixed a bug that disturbed XXX from being displayed. --- en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md b/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md index 7904833062..3afcf4a576 100644 --- a/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md +++ b/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md @@ -7,10 +7,9 @@ date: 2021-11-09 00:00:00 +0000 lang: en --- -We are pleased to announce the release of Ruby {{ release.version }}. - {% assign release = site.data.releases | where: "version", "3.1.0-preview1" | first %} +We are pleased to announce the release of Ruby {{ release.version }}. ## YJIT: New experimental in-process JIT compiler From 879ed2088c32fa8d6cd69712d99993124bb168bf Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Sat, 27 Nov 2021 00:48:28 +0900 Subject: [PATCH 2157/3171] Revised the points pointed out in the review. --- ...ional-and-keyword-arguments-in-ruby-3-0.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index b9aec21a12..38c2aea1c9 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -11,7 +11,9 @@ lang: ja ## 概要 -Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 +この文書では便宜上、必須引数、オプション引数、rest引数、後置引数(つまり、キーワード引数とブロック引数以外の引数)をまとめて「位置引数」と呼びます。 + +Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7で警告を表示します。以下のいずれかの警告が表示される場合は、コードのアップデートが必要です。 * `Using the last argument as keyword parameters is deprecated` * `Passing the keyword argument as the last hash parameter is deprecated` @@ -100,13 +102,13 @@ foo(k: 1) #=> {:k=>1} ## Q: 自分のコードはRuby 2.7で動かなくなりますか? -手短かに言うと「壊れない可能性はあります」。 +A: たぶん動きます。 -Ruby 2.7におけるこの変更は、3.0への移行パスとして設計されています。あくまで原則としてですが、Ruby 2.7ではRuby 3.0で変更される振る舞いについてwarningを出すにとどめており、warningの中には私たちが微細とみなしている変更点も若干含まれます。詳しくは後述の「その他の微細な変更点」をご覧ください。 +Ruby 2.7では、原則として、Ruby 3.0で変更される振る舞いについて警告を出すにとどめています。しかし、私たちが軽微とみなした非互換も少しだけ入っています。詳しくは後述の「その他の軽微な変更点」をご覧ください。 -Ruby 2.7では、warningが表示される点と微細な変更点以外を除いてRuby 2.6との互換性を保とうとしています。つまり、あなたのコードはRuby 2.7でもおそらく動作しますが、warningが表示される可能性はあります。あなたのコードをRuby 2.7で実行すれば、Ruby 3.0の準備ができているかどうかをチェックできます。 +Ruby 2.7では、警告が表示される点と軽微な変更点以外を除いてRuby 2.6との互換性を保とうとしています。つまり、あなたのコードはRuby 2.7でもおそらく動作しますが、警告が表示される可能性はあります。あなたのコードをRuby 2.7で実行すれば、Ruby 3.0の準備ができているかどうかをチェックできます。 -非推奨のwarningを無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 +非推奨の警告を無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 ## 引数の委譲の扱いについて @@ -162,7 +164,7 @@ ruby2_keywords def foo(*args, &block) end {% endhighlight %} -残念ながら、Ruby 2.6以前では新しい委譲スタイルを正しく扱えないため、旧来の委譲スタイル(`**kwargs`を使わないなど)を使う必要があります。これは、キーワード引数を分離した理由のひとつでもあります(詳しくは本記事末尾をご覧ください)。`ruby2_keywords`を用いれば、Ruby 2.7や3.0でも旧来の委譲スタイルを引き続き利用できます。2.6以前のRubyでは`ruby2_keywords`が定義されていないので、[ruby2_keywords](https://rubygems.org/gems/ruby2_keywords) gemを使うか、以下を手動で定義します。 +残念ながら、Ruby 2.6以前では新しい委譲スタイルを正しく扱えないため、旧来の委譲スタイル(つまり、**kwargsを受け渡ししないスタイル)を使う必要があります。これは、キーワード引数を分離した理由のひとつでもあります(詳しくは本記事末尾をご覧ください)。`ruby2_keywords`を用いれば、Ruby 2.7や3.0でも旧来の委譲スタイルを引き続き利用できます。2.6以前のRubyでは`ruby2_keywords`が定義されていないので、[ruby2_keywords](https://rubygems.org/gems/ruby2_keywords) gemを使うか、以下を手動で定義します。 {% highlight ruby %} def ruby2_keywords(*) @@ -186,15 +188,15 @@ foo({}) #=> Ruby 2.7: [] ({}を含んでいない) foo({}, **{}) #=> Ruby 2.7: [{}] ({}を渡せば、キーワード引数が「ない」ことを明示できる) {% endhighlight %} -上のコードでは、空のHash引数が自動的に変換されて`**kwargs`に吸い込まれ、この空のキーワードハッシュは委譲の呼び出しで削除されます。このため、`targe`には引数がまったく渡されなくなります。私たちが把握している範囲では、これが唯一のエッジケースです。 +上のコードでは、空のHash引数が自動的に変換されて`**kwargs`に吸い込まれ、この空のキーワードハッシュは委譲の呼び出しで削除されます。このため、`target`には引数がまったく渡されなくなります。私たちが把握している範囲では、これが唯一のエッジケースです。 上のコードの最下部に書いたように、`**{}`を渡すことでこの問題を回避できます。 -移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6が役目を終えたときに削除される可能性があります。現時点で私たちがおすすめできるのは、キーワード引数を明示的に委譲することです(上述のRuby 3向けのコードを参照)。 +移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6がサポート切れになったあとで削除される可能性があります。そのときになったら、キーワード引数を明示的に委譲することをおすすめします(上述のRuby 3向けのコードを参照)。 -## その他の微細な変更点 +## その他の軽微な変更点 -Ruby 2.7のキーワード引数では、この他に以下の3つのマイナーチェンジが行われています。 +Ruby 2.7のキーワード引数では、この他に以下の3つの軽微な変更が行われています。 ### 1\. キーワード引数で非シンボルキーを利用できるようになった @@ -256,7 +258,7 @@ foo(**empty_hash) なお、`foo(**{})`はRuby 2.6以前とRuby 2.7のどちらの場合も引数を渡さず、`**{}`がパーサーによって削除される点にご注意ください。また、Ruby 2.7以降ではどちらも`**empty_hash`として同じに扱われるので、メソッドにキーワード引数を渡さないようにする指定が楽に行なえます。 -Ruby 2.7では、あるメソッド呼び出しで必須とされる位置引数の個数が不足している場合、Ruby 2.6との互換性を保つために`foo(**empty_hash)`は空のハッシュを渡してwarningを表示します。この振る舞いはRuby 3.0で廃止されます。 +Ruby 2.7では、あるメソッド呼び出しで必須とされる位置引数の個数が不足している場合、Ruby 2.6との互換性を保つために`foo(**empty_hash)`は空のハッシュを渡して警告を表示します。この振る舞いはRuby 3.0で廃止されます。 {% highlight ruby %} def foo(x) @@ -273,7 +275,7 @@ foo(**empty_hash) ### 3\. キーワード引数を受け取らないことを表す構文(`**nil`)が導入される -メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、事実上新機能です)。 +メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、新機能です)。 {% highlight ruby %} def foo(*args, **nil) @@ -283,7 +285,7 @@ foo(k: 1) #=> Ruby 2.7以降: no keywords accepted (ArgumentError) {% endhighlight %} -この新構文は、メソッドがキーワード引数を受け取らないことを明示的に指定するのに有用です。これを使わない場合、キーワード引数は上述の例の他の引数に吸い込まれます。メソッドを拡張してキーワード引数を受け取るようにする場合、以下のような非互換性が発生する可能性があります。 +この新構文は、メソッドがキーワード引数を受け取らないことを明示的に指定するのに有用です。これを使わない場合、キーワード引数は上述の例のrest引数に吸い込まれます。メソッドを拡張してキーワード引数を受け取るようにする場合、以下のような非互換性が発生する可能性があります。 {% highlight ruby %} # メソッドは残りの引数を受け取るが、`**nil`はない状態 @@ -307,7 +309,7 @@ foo(k: 1) #=> ArgumentError: unknown keyword k 当初、自動変換はうまいアイデアに思われていて、多くの場合問題なく機能していました。しかし、エッジケースがあまりにも多く、これまでこの振る舞いに関するバグレポートを山のように受け取りました。 -自動変換は、オプションの位置引数とキーワード引数をどちらも受け取るメソッドではうまく動きません。末尾のHashオブジェクトを位置引数として扱うことを期待する人々もいれば、末尾のHashオブジェクトをキーワード引数として扱うことを期待する人々もいました。 +自動変換は、オプション引数とキーワード引数をどちらも受け取るメソッドではうまく動きません。末尾のHashオブジェクトを位置引数として扱うことを期待する人々もいれば、末尾のHashオブジェクトをキーワード引数として扱うことを期待する人々もいました。 最も混乱を呼ぶケースのひとつを以下に示します。 @@ -345,7 +347,7 @@ foo() #=> Ruby 2.6以前: [{}] #=> Ruby 2.7以降: [] {% endhighlight %} -`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになります。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 +`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになり、blockはnilになります。。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 自動変換は開発者を混乱させるのみならず、メソッドの拡張性も弱めてしまいます。振る舞いが変更された理由や、特定の実装が選択された理由について詳しくは[Feature #14183](https://bugs.ruby-lang.org/issues/14183)をご覧ください。 @@ -355,4 +357,4 @@ foo() #=> Ruby 2.6以前: [{}] ## 更新履歴 -* 更新 2019-12-25: 2.7.0-rc2でwarningメッセージが若干変更され、warning抑制APIが追加された。 +* 更新 2019-12-25: 2.7.0-rc2で警告メッセージが若干変更され、警告抑制APIが追加された。 From 6d63b42335fa7eb881aa16c65d0b5f1756f0e269 Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Wed, 22 Jan 2020 12:35:17 +0900 Subject: [PATCH 2158/3171] Add en doc --- ...ional-and-keyword-arguments-in-ruby-3-0.md | 355 ++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md new file mode 100644 index 0000000000..44cd874cc1 --- /dev/null +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -0,0 +1,355 @@ +--- +layout: news_post +title: "Separation of positional and keyword arguments in Ruby 3.0" +author: "mame" +translator: +date: 2019-12-12 12:00:00 +0000 +lang: en +--- + +This article explains the planned incompatibility of keyword arguments in Ruby 3.0 + +## tl;dr + +In Ruby 3.0, positional arguments and keyword arguments will be separated. Ruby 2.7 will warn for behaviors that will change in Ruby 3.0. If you see the following warnings, you need to update your code: + +* `Using the last argument as keyword parameters is deprecated`, or +* `Passing the keyword argument as the last hash parameter is deprecated`, or +* `Splitting the last argument into positional and keyword parameters is deprecated` + +In most cases, you can avoid the incompatibility by adding the _double splat_ operator. It explicitly specifies passing keyword arguments instead of a `Hash` object. Likewise, you may add braces `{}` to explicitly pass a `Hash` object, instead of keyword arguments. Read the section "Typical cases" below for more details. + +In Ruby 3, a method delegating all arguments must explicitly delegate keyword arguments in addition to positional arguments. If you want to keep the delegation behavior found in Ruby 2.7 and earlier, use `ruby2_keywords`. See the "Handling argument delegation" section below for more details. + +## Typical cases + +Here is the most typical case. You can use double splat operator (`**`) to pass keywords instead of a Hash. + +{% highlight ruby %} +# This method accepts only a keyword argument +def foo(k: 1) + p k +end + +h = { k: 42 } + +# This method call passes a positional Hash argument +# In Ruby 2.7: The Hash is automatically converted to a keyword argument +# In Ruby 3.0: This call raises an ArgumentError +foo(h) + # => demo.rb:11: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call + # demo.rb:2: warning: The called method `foo' is defined here + # 42 + +# If you want to keep the behavior in Ruby 3.0, use double splat +foo(**h) #=> 42 +{% endhighlight %} + +Here is another case. You can use braces (`{}`) to pass a Hash instead of keywords explicitly. + +{% highlight ruby %} +# This method accepts one positional argument and a keyword rest argument +def bar(h, **kwargs) + p h +end + +# This call passes only a keyword argument and no positional arguments +# In Ruby 2.7: The keyword is converted to a positional Hash argument +# In Ruby 3.0: This call raises an ArgumentError +bar(k: 42) + # => demo2.rb:9: warning: Passing the keyword argument as the last hash parameter is deprecated + # demo2.rb:2: warning: The called method `bar' is defined here + # {:k=>42} + +# If you want to keep the behavior in Ruby 3.0, write braces to make it an +# explicit Hash +bar({ k: 42 }) # => {:k=>42} +{% endhighlight %} + +## What is deprecated? + +In Ruby 2, keyword arguments can be treated as the last positional Hash argument and a last positional Hash argument can be treated as keyword arguments. + +Because the automatic conversion is sometimes too complex and troublesome as described in the final section. So it's now deprecated in Ruby 2.7 and will be removed in Ruby 3. In other words, keyword arguments will be completely separated from positional one in Ruby 3. So when you want to pass keyword arguments, you should always use `foo(k: expr)` or `foo(**expr)`. If you want to accept keyword arguments, in principle you should always use `def foo(k: default)` or `def foo(k:)` or `def foo(**kwargs)`. + +Note that Ruby 3.0 doesn't behave differently when calling a method which doesn't accept keyword arguments with keyword arguments. For instance, the following case is not going to be deprecated and will keep working in Ruby 3.0. The keyword arguments are still treated as a positional Hash argument. + +{% highlight ruby %} +def foo(kwargs = {}) + kwargs +end + +foo(k: 1) #=> {:k=>1} +{% endhighlight %} + +This is because this style is used very frequently, and there is no ambiguity in how the argument should be treated. Prohibiting this conversion would result in additional incompatibility for little benefit. + +However, this style is not recommended in new code, unless you are often passing a Hash as a positional argument, and are also using keyword arguments. Otherwise, use double splat: + +{% highlight ruby %} +def foo(**kwargs) + kwargs +end + +foo(k: 1) #=> {:k=>1} +{% endhighlight %} + +## Will my code break on Ruby 2.7? + +A short answer is "maybe not". + +The changes in Ruby 2.7 are designed as a migration path towards 3.0. While in principle, Ruby 2.7 only warns against behaviors that will change in Ruby 3, it includes some incompatible changes we consider to be minor. See the "Other minor changes" section for details. + +Except for the warnings and minor changes, Ruby 2.7 attempts to keep the compatibility with Ruby 2.6. So, your code will probably work on Ruby 2.7, though it may emit warnings. And by running it on Ruby 2.7, you can check if your code is ready for Ruby 3.0. + +If you want to disable the deprecation warnings, please use a command-line argument `-W:no-deprecated` or add `Warning[:deprecated] = false` to your code. + +## Handling argument delegation + +### Ruby 2.6 or prior + +In Ruby 2, you can write a delegation method by accepting a `*rest` argument and a `&block` argument, and passing the two to the target method. In this behavior, the keyword arguments are also implicitly handled by the automatic conversion between positional and keyword arguments. + +{% highlight ruby %} +def foo(*args, &block) + target(*args, &block) +end +{% endhighlight %} + +### Ruby 3 + +You need to explicitly delegate keyword arguments. + +{% highlight ruby %} +def foo(*args, **kwargs, &block) + target(*args, **kwargs, &block) +end +{% endhighlight %} + +Alternatively, if you do not need compatibility with Ruby 2.6 or prior and you don't alter any arguments, you can use the new delegation syntax (`...`) that is introduced in Ruby 2.7. + +{% highlight ruby %} +def foo(...) + target(...) +end +{% endhighlight %} + +### Ruby 2.7 + +In short: use `Module#ruby2_keywords` and delegate `*args, &block`. + +{% highlight ruby %} +ruby2_keywords def foo(*args, &block) + target(*args, &block) +end +{% endhighlight %} + +`ruby2_keywords` accepts keyword arguments as the last Hash argument, and passes it as keyword arguments when calling the other method. + +In fact, Ruby 2.7 allows the new style of delegation in many cases. However, there is a known corner case. See the next section. + +### A compatible delegation that works on Ruby 2.6, 2.7 and Ruby 3 + +In short: use `Module#ruby2_keywords` again. + +{% highlight ruby %} +ruby2_keywords def foo(*args, &block) + target(*args, &block) +end +{% endhighlight %} + +Unfortunately, we need to use the old-style delegation (i.e., no `**kwargs`) because Ruby 2.6 or prior does not handle the new delegation style correctly. This is one of the reasons of the keyword argument separation; the details are described in the final section. And `ruby2_keywords` allows you to run the old style even in Ruby 2.7 and 3.0. As there is no `ruby2_keywords` defined in 2.6 or prior, please use the [ruby2_keywords gem](https://rubygems.org/gems/ruby2_keywords) or define it yourself: + +{% highlight ruby %} +def ruby2_keywords(*) +end if RUBY_VERSION < "2.7" +{% endhighlight %} + +--- + +If your code doesn't have to run on Ruby 2.6 or older, you may try the new style in Ruby 2.7. In almost all cases, it works. Note that, however, there are unfortunate corner cases as follows: + +{% highlight ruby %} +def target(*args) + p args +end + +def foo(*args, **kwargs, &block) + target(*args, **kwargs, &block) +end + +foo({}) #=> Ruby 2.7: [] ({} is dropped) +foo({}, **{}) #=> Ruby 2.7: [{}] (You can pass {} by explicitly passing "no" keywords) +{% endhighlight %} + +An empty Hash argument is automatically converted and absorbed into `**kwargs`, and the delegation call removes the empty keyword hash, so no argument is passed to `target`. As far as we know, this is the only corner case. + +As noted in the last line, you can work around this issue by using `**{}`. + +If you really worry about the portability, use `ruby2_keywords`. (Acknowledge that Ruby 2.6 or before themselves have tons of corner cases in keyword arguments. :-) +`ruby2_keywords` might be removed in the future after Ruby 2.6 reaches end-of-life. At that point, we recommend to explicitly delegate keyword arguments (see Ruby 3 code above). + +## Other minor changes + +There are three minor changes about keyword arguments in Ruby 2.7. + +### 1. Non-Symbol keys are allowed in keyword arguments + +In Ruby 2.6 or before, only Symbol keys were allowed in keyword arguments. In Ruby 2.7, keyword arguments can use non-Symbol keys. + +{% highlight ruby %} +def foo(**kwargs) + kwargs +end +foo("key" => 42) + #=> Ruby 2.6 or before: ArgumentError: wrong number of arguments + #=> Ruby 2.7 or later: {"key"=>42} +{% endhighlight %} + +If a method accepts both optional and keyword arguments, the Hash object that has both Symbol keys and non-Symbol keys was split in two in Ruby 2.6. In Ruby 2.7, both are accepted as keywords because non-Symbol keys are allowed. + +{% highlight ruby %} +def bar(x=1, **kwargs) + p [x, kwargs] +end + +bar("key" => 42, :sym => 43) + #=> Ruby 2.6: [{"key"=>42}, {:sym=>43}] + #=> Ruby 2.7: [1, {"key"=>42, :sym=>43}] + +# Use braces to keep the behavior +bar({"key" => 42}, :sym => 43) + #=> Ruby 2.6 and 2.7: [{"key"=>42}, {:sym=>43}] +{% endhighlight %} + +Ruby 2.7 still splits hashes with a warning if passing a Hash or keyword arguments with both Symbol and non-Symbol keys to a method that accepts explicit keywords but no keyword rest argument (`**kwargs`). This behavior will be removed in Ruby 3, and an `ArgumentError` will be raised. + +{% highlight ruby %} +def bar(x=1, sym: nil) + p [x, sym] +end + +bar("key" => 42, :sym => 43) +# Ruby 2.6 and 2.7: => [{"key"=>42}, 43] +# Ruby 2.7: warning: Splitting the last argument into positional and keyword parameters is deprecated +# warning: The called method `bar' is defined here +# Ruby 3.0: ArgumentError +{% endhighlight %} + +### 2. Double splat with an empty hash (`**{}`) passes no arguments + +In Ruby 2.6 or before, passing `**empty_hash` passes an empty Hash as a positional argument. In Ruby 2.7 or later, it passes no arguments. + +{% highlight ruby %} +def foo(*args) + args +end + +empty_hash = {} +foo(**empty_hash) + #=> Ruby 2.6 or before: [{}] + #=> Ruby 2.7 or later: [] +{% endhighlight %} + +Note that `foo(**{})` passes nothing in both Ruby 2.6 and 2.7. In Ruby 2.6 and before, `**{}` is removed by the parser, and in Ruby 2.7 and above, it is treated the same as `**empty_hash`, allowing for an easy way to pass no keyword arguments to a method. + +In Ruby 2.7, when calling a method with an insufficient number of required positional arguments, `foo(**empty_hash)` passes an empty hash with a warning emitted, for compatibility with Ruby 2.6. This behavior will be removed in 3.0. + +{% highlight ruby %} +def foo(x) + x +end + +empty_hash = {} +foo(**empty_hash) + #=> Ruby 2.6 or before: {} + #=> Ruby 2.7: warning: Passing the keyword argument as the last hash parameter is deprecated + # warning: The called method `foo' is defined here + #=> Ruby 3.0: ArgumentError: wrong number of arguments +{% endhighlight %} + +### 3. The no-keyword-arguments syntax (`**nil`) is introduced + +You can use `**nil` in a method definition to explicitly mark the method accepts no keyword arguments. Calling such methods with keyword arguments will result in an `ArgumentError`. (This is actually a new feature, not an incompatibility) + +{% highlight ruby %} +def foo(*args, **nil) +end + +foo(k: 1) + #=> Ruby 2.7 or later: no keywords accepted (ArgumentError) +{% endhighlight %} + +This is useful to make it explicit that the method does not accept keyword arguments. Otherwise, the keywords are absorbed in the rest argument in the above example. If you extend a method to accept keyword arguments, the method may have incompatibility as follows: + +{% highlight ruby %} +# If a method accepts rest argument and no `**nil` +def foo(*args) + p args +end + +# Passing keywords are converted to a Hash object (even in Ruby 3.0) +foo(k: 1) #=> [{:k=>1}] + +# If the method is extended to accept a keyword +def foo(*args, mode: false) + p args +end + +# The existing call may break +foo(k: 1) #=> ArgumentError: unknown keyword k +{% endhighlight %} + +## Why we're deprecating the automatic conversion + +The automatic conversion initially appeared to be a good idea, and worked well in many cases. However, it had too many corner cases, and we have received many bug reports about the behavior. + +Automatic conversion does not work well when a method accepts optional positional arguments and keyword arguments. Some people expect the last Hash object to be treated as a positional argument, and others expect it to be converted to keyword arguments. + +Here is one of the most confusing cases: + +{% highlight ruby %} +def foo(x, **kwargs) + p [x, kwargs] +end + +def bar(x=1, **kwargs) + p [x, kwargs] +end + +foo({}) => [{}, {}] +bar({}) => [1, {}] + +bar({}, **{}) => expected: [{}, {}], actual: [1, {}] +{% endhighlight %} + +In Ruby 2, `foo({})` passes an empty hash as a normal argument (i.e., `{}` is assigned to `x`), while `bar({})` passes a keyword argument (i.e, `{}` is assigned to `kwargs`). So `any_method({})` is very ambiguous. + +You may think of `bar({}, **{})` to pass the empty hash to `x` explicitly. Surprisingly, it does not work as you expected; it still prints `[1, {}]` in Ruby 2.6. This is because `**{}` is ignored by the parser in Ruby 2.6, and the first argument `{}` is automatically converted to keywords (`**kwargs`). In this case, you need to call `bar({}, {})`, which is very weird. + +The same issues also apply to methods that accept rest and keyword arguments. This makes explicit delegation of keyword arguments not work. + +{% highlight ruby %} +def target(*args) + p args +end + +def foo(*args, **kwargs, &block) + target(*args, **kwargs, &block) +end + +foo() #=> Ruby 2.6 or before: [{}] + #=> Ruby 2.7 or later: [] +{% endhighlight %} + +`foo()` passes no arguments, but `target` receives an empty hash argument in Ruby 2.6. This is because the method `foo` delegates keywords (`**kwargs`) explicitly. When `foo()` is called, `args` is an empty Array, `kwargs` is an empty Hash, and `block` is `nil`. And then `target(*args, **kwargs, &block)` passes an empty Hash as an argument because `**kwargs` is automatically converted to a positional Hash argument. + +The automatic conversion not only confuses people but also makes the method less extensible. See [[Feature #14183]](https://bugs.ruby-lang.org/issues/14183) for more details about the reasons for the change in behavior, and why certain implementation choices were made. + +## Acknowledgment + +This article was kindly reviewed (or even co-authored) by Jeremy Evans and Benoit Daloze. + +## History + +* Updated 2019-12-25: In 2.7.0-rc2, the warning message was slightly changed, and an API to suppress the warnings was added. From f93cd654bd38b0e17b278ddd81087a1f1ba65a72 Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Wed, 22 Jan 2020 12:35:47 +0900 Subject: [PATCH 2159/3171] Translate "Separation of positional and keyword arguments in Ruby 3.0" --- ...ional-and-keyword-arguments-in-ruby-3-0.md | 195 +++++++++--------- 1 file changed, 99 insertions(+), 96 deletions(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 44cd874cc1..5e80e231d5 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -2,77 +2,81 @@ layout: news_post title: "Separation of positional and keyword arguments in Ruby 3.0" author: "mame" -translator: +translator: "hachi8833" date: 2019-12-12 12:00:00 +0000 -lang: en +lang: ja --- -This article explains the planned incompatibility of keyword arguments in Ruby 3.0 +本記事では、Ruby 3.0で予定されているキーワード引数の非互換性について解説します。 -## tl;dr +## 概要 -In Ruby 3.0, positional arguments and keyword arguments will be separated. Ruby 2.7 will warn for behaviors that will change in Ruby 3.0. If you see the following warnings, you need to update your code: +Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 * `Using the last argument as keyword parameters is deprecated`, or * `Passing the keyword argument as the last hash parameter is deprecated`, or * `Splitting the last argument into positional and keyword parameters is deprecated` -In most cases, you can avoid the incompatibility by adding the _double splat_ operator. It explicitly specifies passing keyword arguments instead of a `Hash` object. Likewise, you may add braces `{}` to explicitly pass a `Hash` object, instead of keyword arguments. Read the section "Typical cases" below for more details. +この非互換性は、double splat演算子(`**`)を追加することでほぼ回避できます。これにより、`Hash`オブジェクトではなくキーワード引数を渡すことが明示的に指定されます。同様に、キーワード引数ではなく`Hash`オブジェクトを明示的に渡したい場合は中かっこ(`{}`)を追加できます。詳しくは後述の「典型的なケース」をご覧ください。 -In Ruby 3, a method delegating all arguments must explicitly delegate keyword arguments in addition to positional arguments. If you want to keep the delegation behavior found in Ruby 2.7 and earlier, use `ruby2_keywords`. See the "Handling argument delegation" section below for more details. +Ruby 3では、すべての引数を委譲するメソッドで、位置引数の他に必ずキーワード引数も明示的に委譲しなければなりません。Ruby 2.7以前の委譲の振る舞いを変えたくない場合は、`ruby2_keywords`をお使いください。詳しくは後述の「引数の委譲の扱いについて」をご覧ください。 -## Typical cases +## よくあるケース -Here is the most typical case. You can use double splat operator (`**`) to pass keywords instead of a Hash. +以下はもっともよくあるケースです。Hashではなくキーワードを渡すのにdouble splat演算子(`**`)を使えます。 {% highlight ruby %} -# This method accepts only a keyword argument +# このメソッドはキーワード引数のみを受け取る def foo(k: 1) p k end h = { k: 42 } -# This method call passes a positional Hash argument -# In Ruby 2.7: The Hash is automatically converted to a keyword argument -# In Ruby 3.0: This call raises an ArgumentError +# このメソッド呼び出しは位置引数としてHashを渡している +# Ruby 2.7: このHashは自動でキーワード引数に変換される +# Ruby 3.0: この呼び出しはArgumentErrorになる foo(h) # => demo.rb:11: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call # demo.rb:2: warning: The called method `foo' is defined here # 42 -# If you want to keep the behavior in Ruby 3.0, use double splat +# この振る舞いをRuby 3.0で変えたくない場合はdouble splatを用いる foo(**h) #=> 42 {% endhighlight %} -Here is another case. You can use braces (`{}`) to pass a Hash instead of keywords explicitly. +別の例: キーワード引数ではなくHashを明示的に渡す場合は中かっこ(`{}`)を使います。 {% highlight ruby %} -# This method accepts one positional argument and a keyword rest argument +# このメソッドは位置引数を1個、残りはキーワード引数を受け取る def bar(h, **kwargs) p h end -# This call passes only a keyword argument and no positional arguments -# In Ruby 2.7: The keyword is converted to a positional Hash argument -# In Ruby 3.0: This call raises an ArgumentError +# この呼び出しではキーワード引数のみが渡され、位置引数は渡されない +# Ruby 2.7: このキーワード引数は自動でHash引数に変換される +# Ruby 3.0: この呼び出しはArgumentErrorになる bar(k: 42) # => demo2.rb:9: warning: Passing the keyword argument as the last hash parameter is deprecated # demo2.rb:2: warning: The called method `bar' is defined here # {:k=>42} -# If you want to keep the behavior in Ruby 3.0, write braces to make it an -# explicit Hash +# この振る舞いをRuby 3.0で変えたくない場合は +# 中かっこで明示的にHashにする bar({ k: 42 }) # => {:k=>42} {% endhighlight %} -## What is deprecated? +## どの動作が非推奨になるか -In Ruby 2, keyword arguments can be treated as the last positional Hash argument and a last positional Hash argument can be treated as keyword arguments. +Ruby 2では、キーワード引数が末尾のハッシュ位置引数として扱われることがあります。また、末尾のハッシュ引数がキーワード引数として扱われることもあります。 -Because the automatic conversion is sometimes too complex and troublesome as described in the final section. So it's now deprecated in Ruby 2.7 and will be removed in Ruby 3. In other words, keyword arguments will be completely separated from positional one in Ruby 3. So when you want to pass keyword arguments, you should always use `foo(k: expr)` or `foo(**expr)`. If you want to accept keyword arguments, in principle you should always use `def foo(k: default)` or `def foo(k:)` or `def foo(**kwargs)`. +この自動変換は場合によっては複雑になりすぎてしまい、本記事末尾で後述するようにトラブルの原因になることがあります。そのため、この自動変換をRuby 2.7で非推奨とし、Ruby 3.0で廃止する予定です。言い換えると、Ruby 3.0のキーワード引数は位置引数と完全に分離されることになります。つまり、キーワード引数を渡したい場合は、常に`foo(k: expr)`または`foo(**expr)`の形にすべきです。(メソッド定義で)キーワード引数を受け取りたい場合は、原則として常に以下のいずれかの形にすべきです。 -Note that Ruby 3.0 doesn't behave differently when calling a method which doesn't accept keyword arguments with keyword arguments. For instance, the following case is not going to be deprecated and will keep working in Ruby 3.0. The keyword arguments are still treated as a positional Hash argument. +* `def foo(k: default)` +* `def foo(k:)` +* `def foo(**kwargs)` + +なお、キーワード引数を受け取らないメソッドを呼び出すときにキーワード引数を渡した場合の振る舞いは、Ruby 3.0でも変わらない点にご注意ください。たとえば、以下のケースは非推奨にはならず、Ruby 3.0でも引き続き動作します(このキーワード引数は引き続きHash位置引数として扱われます)。 {% highlight ruby %} def foo(kwargs = {}) @@ -82,9 +86,9 @@ end foo(k: 1) #=> {:k=>1} {% endhighlight %} -This is because this style is used very frequently, and there is no ambiguity in how the argument should be treated. Prohibiting this conversion would result in additional incompatibility for little benefit. +変わらない理由は、このスタイルが非常によく用いられていることと、この呼び出し方法では引数の扱いに曖昧な点がないためです。この振る舞いまで禁止してしまうと、得られるメリットが少ないうえに非互換性がさらに増えてしまいます。 -However, this style is not recommended in new code, unless you are often passing a Hash as a positional argument, and are also using keyword arguments. Otherwise, use double splat: +ただし今後新しいコードを書く場合、このスタイルはおすすめできません(Hashを位置引数として渡す頻度が高く、かつキーワード引数も使う場合を除く)。代わりに、次のようにdouble splat(`**`)をお使いください。 {% highlight ruby %} def foo(**kwargs) @@ -94,21 +98,21 @@ end foo(k: 1) #=> {:k=>1} {% endhighlight %} -## Will my code break on Ruby 2.7? +## Q: 自分のコードはRuby 2.7で動かなくなりますか? -A short answer is "maybe not". +手短かに言うと「壊れない可能性はあります」。 -The changes in Ruby 2.7 are designed as a migration path towards 3.0. While in principle, Ruby 2.7 only warns against behaviors that will change in Ruby 3, it includes some incompatible changes we consider to be minor. See the "Other minor changes" section for details. +Ruby 2.7におけるこの変更は、3.0への移行パスとして設計されています。あくまで原則としてですが、Ruby 2.7ではRuby 3.0で変更される振る舞いについてwarningを出すにとどめており、warningの中には私たちが微細とみなしている変更点も若干含まれます。詳しくは後述の「その他の微細な変更点」をご覧ください。 -Except for the warnings and minor changes, Ruby 2.7 attempts to keep the compatibility with Ruby 2.6. So, your code will probably work on Ruby 2.7, though it may emit warnings. And by running it on Ruby 2.7, you can check if your code is ready for Ruby 3.0. +Ruby 2.7では、warningが表示される点と微細な変更点以外を除いてRuby 2.6との互換性を保とうとしています。つまり、あなたのコードはRuby 2.7でもおそらく動作しますが、warningが表示される可能性はあります。あなたのコードをRuby 2.7で実行すれば、Ruby 3.0の準備ができているかどうかをチェックできます。 -If you want to disable the deprecation warnings, please use a command-line argument `-W:no-deprecated` or add `Warning[:deprecated] = false` to your code. +非推奨のwarningを無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 -## Handling argument delegation +## 引数の委譲の扱いについて -### Ruby 2.6 or prior +### Ruby 2.6以前の場合 -In Ruby 2, you can write a delegation method by accepting a `*rest` argument and a `&block` argument, and passing the two to the target method. In this behavior, the keyword arguments are also implicitly handled by the automatic conversion between positional and keyword arguments. +Ruby 2では、以下のように1個の`*rest`引数と1個の`&block`引数を受け付けて、この2つの引数を委譲先メソッド(以下の`target`)に渡すことで委譲メソッドを書けます。この振る舞いでは、(1つ以上の)キーワード引数も「位置引数<=>キーワード引数の自動変換」によって暗黙的に扱われます。 {% highlight ruby %} def foo(*args, &block) @@ -116,9 +120,9 @@ def foo(*args, &block) end {% endhighlight %} -### Ruby 3 +### Ruby 3の場合 -You need to explicitly delegate keyword arguments. +以下のようにキーワード引数を明示的に委譲する必要があります。 {% highlight ruby %} def foo(*args, **kwargs, &block) @@ -126,7 +130,7 @@ def foo(*args, **kwargs, &block) end {% endhighlight %} -Alternatively, if you do not need compatibility with Ruby 2.6 or prior and you don't alter any arguments, you can use the new delegation syntax (`...`) that is introduced in Ruby 2.7. +別の方法として、Ruby 2.6以前との互換性を考慮する必要がなく、かつ引数を一切改変しないのであれば、以下のようにRuby 2.7で新しく導入される委譲構文(`...`)を利用できます。 {% highlight ruby %} def foo(...) @@ -134,9 +138,9 @@ def foo(...) end {% endhighlight %} -### Ruby 2.7 +### Ruby 2.7の場合 -In short: use `Module#ruby2_keywords` and delegate `*args, &block`. +手短かに言うと、以下のように`Module#ruby2_keywords`を用い、`*args, &block`を委譲します。 {% highlight ruby %} ruby2_keywords def foo(*args, &block) @@ -144,13 +148,13 @@ ruby2_keywords def foo(*args, &block) end {% endhighlight %} -`ruby2_keywords` accepts keyword arguments as the last Hash argument, and passes it as keyword arguments when calling the other method. +`ruby2_keywords`を指定すると、キーワード引数を末尾のHash引数として受け取れるようになり、他のメソッドを呼び出すときにそれをキーワード引数として渡せます。 -In fact, Ruby 2.7 allows the new style of delegation in many cases. However, there is a known corner case. See the next section. +実際、Ruby 2.7では多くの場面でこの新しい委譲のスタイルを利用できます。ただし1つ既知のエッジケースがあります。次をご覧ください。 -### A compatible delegation that works on Ruby 2.6, 2.7 and Ruby 3 +### Ruby 2.6 / 2.7 / 3で互換性のある委譲スタイル -In short: use `Module#ruby2_keywords` again. +手短かに言うと、ここも「`Module#ruby2_keywords`を使う」となります。 {% highlight ruby %} ruby2_keywords def foo(*args, &block) @@ -158,16 +162,16 @@ ruby2_keywords def foo(*args, &block) end {% endhighlight %} -Unfortunately, we need to use the old-style delegation (i.e., no `**kwargs`) because Ruby 2.6 or prior does not handle the new delegation style correctly. This is one of the reasons of the keyword argument separation; the details are described in the final section. And `ruby2_keywords` allows you to run the old style even in Ruby 2.7 and 3.0. As there is no `ruby2_keywords` defined in 2.6 or prior, please use the [ruby2_keywords gem](https://rubygems.org/gems/ruby2_keywords) or define it yourself: +残念ながら、Ruby 2.6以前では新しい委譲スタイルを正しく扱えないため、旧来の委譲スタイル(`**kwargs`を使わないなど)を使う必要があります。これは、キーワード引数を分離した理由のひとつでもあります(詳しくは本記事末尾をご覧ください)。`ruby2_keywords`を用いれば、Ruby 2.7や3.0でも旧来の委譲スタイルを引き続き利用できます。2.6以前のRubyでは`ruby2_keywords`が定義されていないので、[ruby2_keywords](https://rubygems.org/gems/ruby2_keywords) gemを使うか、以下を手動で定義します。 {% highlight ruby %} def ruby2_keywords(*) end if RUBY_VERSION < "2.7" {% endhighlight %} ---- +* * * * * -If your code doesn't have to run on Ruby 2.6 or older, you may try the new style in Ruby 2.7. In almost all cases, it works. Note that, however, there are unfortunate corner cases as follows: +自分のコードがRuby 2.6以前で動かなくても構わないのであれば、Ruby 2.7で新しいスタイルを試してもよいでしょう。ほぼほぼ間違いなく動作しますが、以下のようなエッジケースを運悪く踏むこともあります。 {% highlight ruby %} def target(*args) @@ -178,35 +182,34 @@ def foo(*args, **kwargs, &block) target(*args, **kwargs, &block) end -foo({}) #=> Ruby 2.7: [] ({} is dropped) -foo({}, **{}) #=> Ruby 2.7: [{}] (You can pass {} by explicitly passing "no" keywords) +foo({}) #=> Ruby 2.7: [] ({}を含んでいない) +foo({}, **{}) #=> Ruby 2.7: [{}] ({}を渡せば、キーワード引数が「ない」ことを明示できる) {% endhighlight %} -An empty Hash argument is automatically converted and absorbed into `**kwargs`, and the delegation call removes the empty keyword hash, so no argument is passed to `target`. As far as we know, this is the only corner case. +上のコードでは、空のHash引数が自動的に変換されて`**kwargs`に吸い込まれ、この空のキーワードハッシュは委譲の呼び出しで削除されます。このため、`targe`には引数がまったく渡されなくなります。私たちが把握している範囲では、これが唯一のエッジケースです。 -As noted in the last line, you can work around this issue by using `**{}`. +上のコードの最下部に書いたように、`**{}`を渡すことでこの問題を回避できます。 -If you really worry about the portability, use `ruby2_keywords`. (Acknowledge that Ruby 2.6 or before themselves have tons of corner cases in keyword arguments. :-) -`ruby2_keywords` might be removed in the future after Ruby 2.6 reaches end-of-life. At that point, we recommend to explicitly delegate keyword arguments (see Ruby 3 code above). +移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6が役目を終えたときに削除される可能性があります。現時点で私たちがおすすめできるのは、キーワード引数を明示的に委譲することです(上述のRuby 3向けのコードを参照)。 -## Other minor changes +## その他の微細な変更点 -There are three minor changes about keyword arguments in Ruby 2.7. +Ruby 2.7のキーワード引数では、この他に以下の3つのマイナーチェンジが行われています。 -### 1. Non-Symbol keys are allowed in keyword arguments +### 1\. キーワード引数で非シンボルキーを利用できるようになった -In Ruby 2.6 or before, only Symbol keys were allowed in keyword arguments. In Ruby 2.7, keyword arguments can use non-Symbol keys. +Ruby 2.6以前のキーワード引数では、シンボル形式のキーしか利用できませんでした。Ruby 2.7のキーワード引数では、以下のようにシンボル形式でないキーを利用できるようになります。 {% highlight ruby %} def foo(**kwargs) kwargs end foo("key" => 42) - #=> Ruby 2.6 or before: ArgumentError: wrong number of arguments - #=> Ruby 2.7 or later: {"key"=>42} + #=> Ruby 2.6以前: ArgumentError: wrong number of arguments + #=> Ruby 2.7以降: {"key"=>42} {% endhighlight %} -If a method accepts both optional and keyword arguments, the Hash object that has both Symbol keys and non-Symbol keys was split in two in Ruby 2.6. In Ruby 2.7, both are accepted as keywords because non-Symbol keys are allowed. +あるメソッドがオプション引数とキーワード引数を両方とも受け付ける場合、Ruby 2.6では以下のようにシンボル形式のキーと非シンボルキーを両方持つHashオブジェクトが2つに分割されていました。Ruby 2.7では非シンボルキーを利用できるので、どちらも受け取れます。 {% highlight ruby %} def bar(x=1, **kwargs) @@ -217,12 +220,12 @@ bar("key" => 42, :sym => 43) #=> Ruby 2.6: [{"key"=>42}, {:sym=>43}] #=> Ruby 2.7: [1, {"key"=>42, :sym=>43}] -# Use braces to keep the behavior +# 振る舞いを変えたくない場合は中かっこ{}を使う bar({"key" => 42}, :sym => 43) #=> Ruby 2.6 and 2.7: [{"key"=>42}, {:sym=>43}] {% endhighlight %} -Ruby 2.7 still splits hashes with a warning if passing a Hash or keyword arguments with both Symbol and non-Symbol keys to a method that accepts explicit keywords but no keyword rest argument (`**kwargs`). This behavior will be removed in Ruby 3, and an `ArgumentError` will be raised. +Ruby 2.7では、キーワード引数を明示的に受け付けるがキーワードrest引数(`**kwargs`)を受け取らないメソッドに対して、シンボル形式のキーと非シンボルキーが両方混じったHashやキーワード引数を渡すと、引き続きハッシュを分割して警告を表示します。この振る舞いはRuby 3で廃止されて`ArgumentError`にする予定です。 {% highlight ruby %} def bar(x=1, sym: nil) @@ -230,15 +233,15 @@ def bar(x=1, sym: nil) end bar("key" => 42, :sym => 43) -# Ruby 2.6 and 2.7: => [{"key"=>42}, 43] +# Ruby 2.6と2.7: => [{"key"=>42}, 43] # Ruby 2.7: warning: Splitting the last argument into positional and keyword parameters is deprecated # warning: The called method `bar' is defined here # Ruby 3.0: ArgumentError {% endhighlight %} -### 2. Double splat with an empty hash (`**{}`) passes no arguments +### 2\. double splatを付けた空ハッシュ(`**{}`)で引数を渡さないようになった -In Ruby 2.6 or before, passing `**empty_hash` passes an empty Hash as a positional argument. In Ruby 2.7 or later, it passes no arguments. +Ruby 2.6以前は、`**empty_hash`を渡すと位置引数に空のハッシュが渡されました(`[{}]`)。Ruby 2.7以降では引数を渡さなくなります。 {% highlight ruby %} def foo(*args) @@ -247,13 +250,13 @@ end empty_hash = {} foo(**empty_hash) - #=> Ruby 2.6 or before: [{}] - #=> Ruby 2.7 or later: [] + #=> Ruby 2.6以前: [{}] + #=> Ruby 2.7以降: [] {% endhighlight %} -Note that `foo(**{})` passes nothing in both Ruby 2.6 and 2.7. In Ruby 2.6 and before, `**{}` is removed by the parser, and in Ruby 2.7 and above, it is treated the same as `**empty_hash`, allowing for an easy way to pass no keyword arguments to a method. +なお、`foo(**{})`はRuby 2.6以前とRuby 2.7のどちらの場合も引数を渡さず、`**{}`がパーサーによって削除される点にご注意ください。また、Ruby 2.7以降ではどちらも`**empty_hash`として同じに扱われるので、メソッドにキーワード引数を渡さないようにする指定が楽に行なえます。 -In Ruby 2.7, when calling a method with an insufficient number of required positional arguments, `foo(**empty_hash)` passes an empty hash with a warning emitted, for compatibility with Ruby 2.6. This behavior will be removed in 3.0. +Ruby 2.7では、あるメソッド呼び出しで必須とされる位置引数の個数が不足している場合、Ruby 2.6との互換性を保つために`foo(**empty_hash)`は空のハッシュを渡してwarningを表示します。この振る舞いはRuby 3.0で廃止されます。 {% highlight ruby %} def foo(x) @@ -262,51 +265,51 @@ end empty_hash = {} foo(**empty_hash) - #=> Ruby 2.6 or before: {} + #=> Ruby 2.6以前: {} #=> Ruby 2.7: warning: Passing the keyword argument as the last hash parameter is deprecated # warning: The called method `foo' is defined here #=> Ruby 3.0: ArgumentError: wrong number of arguments {% endhighlight %} -### 3. The no-keyword-arguments syntax (`**nil`) is introduced +### 3\. キーワード引数を受け取らないことを表す構文(`**nil`)が導入される -You can use `**nil` in a method definition to explicitly mark the method accepts no keyword arguments. Calling such methods with keyword arguments will result in an `ArgumentError`. (This is actually a new feature, not an incompatibility) +メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、事実上新機能です)。 {% highlight ruby %} def foo(*args, **nil) end foo(k: 1) - #=> Ruby 2.7 or later: no keywords accepted (ArgumentError) + #=> Ruby 2.7以降: no keywords accepted (ArgumentError) {% endhighlight %} -This is useful to make it explicit that the method does not accept keyword arguments. Otherwise, the keywords are absorbed in the rest argument in the above example. If you extend a method to accept keyword arguments, the method may have incompatibility as follows: +この新構文は、メソッドがキーワード引数を受け取らないことを明示的に指定するのに有用です。これを使わない場合、キーワード引数は上述の例の他の引数に吸い込まれます。メソッドを拡張してキーワード引数を受け取るようにする場合、以下のような非互換性が発生する可能性があります。 {% highlight ruby %} -# If a method accepts rest argument and no `**nil` +# メソッドは残りの引数を受け取るが、`**nil`はない状態 def foo(*args) p args end -# Passing keywords are converted to a Hash object (even in Ruby 3.0) +# キーワード引数はHashオブジェクトに変換される(Ruby 3.0でも同じ) foo(k: 1) #=> [{:k=>1}] -# If the method is extended to accept a keyword +# メソッドがキーワード引数を受け取るよう拡張した場合 def foo(*args, mode: false) p args end -# The existing call may break +# 以下の呼び出しが壊れる可能性がある foo(k: 1) #=> ArgumentError: unknown keyword k {% endhighlight %} -## Why we're deprecating the automatic conversion +## 自動変換を非推奨に変える理由 -The automatic conversion initially appeared to be a good idea, and worked well in many cases. However, it had too many corner cases, and we have received many bug reports about the behavior. +当初、自動変換はうまいアイデアに思われていて、多くの場合問題なく機能していました。しかし、エッジケースがあまりにも多く、これまでこの振る舞いに関するバグレポートを山のように受け取りました。 -Automatic conversion does not work well when a method accepts optional positional arguments and keyword arguments. Some people expect the last Hash object to be treated as a positional argument, and others expect it to be converted to keyword arguments. +自動変換は、オプションの位置引数とキーワード引数をどちらも受け取るメソッドではうまく動きません。末尾のHashオブジェクトを位置引数として扱うことを期待する人々もいれば、末尾のHashオブジェクトをキーワード引数として扱うことを期待する人々もいました。 -Here is one of the most confusing cases: +最も混乱を呼ぶケースのひとつを以下に示します。 {% highlight ruby %} def foo(x, **kwargs) @@ -317,17 +320,17 @@ def bar(x=1, **kwargs) p [x, kwargs] end -foo({}) => [{}, {}] -bar({}) => [1, {}] +foo({}) #=> [{}, {}] +bar({}) #=> [1, {}] -bar({}, **{}) => expected: [{}, {}], actual: [1, {}] +bar({}, **{}) #=> 期待は: [{}, {}]だが実際はl: [1, {}] {% endhighlight %} -In Ruby 2, `foo({})` passes an empty hash as a normal argument (i.e., `{}` is assigned to `x`), while `bar({})` passes a keyword argument (i.e, `{}` is assigned to `kwargs`). So `any_method({})` is very ambiguous. +Ruby 2の場合、`foo({})`は空のハッシュを通常の引数として1つ渡しますが(`x`に`{}`が代入されるなど)、`bar({})`はキーワード引数を1つ渡します(`kwargs`に`{}`が代入されるなど)。つまり、`any_method({})`は極めてあいまいになります。 -You may think of `bar({}, **{})` to pass the empty hash to `x` explicitly. Surprisingly, it does not work as you expected; it still prints `[1, {}]` in Ruby 2.6. This is because `**{}` is ignored by the parser in Ruby 2.6, and the first argument `{}` is automatically converted to keywords (`**kwargs`). In this case, you need to call `bar({}, {})`, which is very weird. +「`bar({}, **{})`は`x`に明示的に空のハッシュを渡すのでは?」と考える人もいるかもしれませんが、驚いたことに、この期待は裏切られます。Ruby 2.6では`[1, {}]`が出力されるのです。理由は、`**{}`がRuby 2.6のパーサーで無視されるのと、1番目の引数`{}`が自動的にキーワード引数(`**kwargs`)に変換されるためです。この場合`bar({}, {})`という形で呼び出す必要がありますが、これではあまりに見苦しくなります。 -The same issues also apply to methods that accept rest and keyword arguments. This makes explicit delegation of keyword arguments not work. +同じ問題は、残りの引数とキーワード引数を受け取るメソッドにも当てはまります。そのせいで、以下のようなキーワード引数の明示的な委譲は動作しません。 {% highlight ruby %} def target(*args) @@ -338,18 +341,18 @@ def foo(*args, **kwargs, &block) target(*args, **kwargs, &block) end -foo() #=> Ruby 2.6 or before: [{}] - #=> Ruby 2.7 or later: [] +foo() #=> Ruby 2.6以前: [{}] + #=> Ruby 2.7以降: [] {% endhighlight %} -`foo()` passes no arguments, but `target` receives an empty hash argument in Ruby 2.6. This is because the method `foo` delegates keywords (`**kwargs`) explicitly. When `foo()` is called, `args` is an empty Array, `kwargs` is an empty Hash, and `block` is `nil`. And then `target(*args, **kwargs, &block)` passes an empty Hash as an argument because `**kwargs` is automatically converted to a positional Hash argument. +`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになります。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 -The automatic conversion not only confuses people but also makes the method less extensible. See [[Feature #14183]](https://bugs.ruby-lang.org/issues/14183) for more details about the reasons for the change in behavior, and why certain implementation choices were made. +自動変換は開発者を混乱させるのみならず、メソッドの拡張性も弱めてしまいます。振る舞いが変更された理由や、特定の実装が選択された理由について詳しくは[Feature #14183](https://bugs.ruby-lang.org/issues/14183)をご覧ください。 -## Acknowledgment +## 謝辞 -This article was kindly reviewed (or even co-authored) by Jeremy Evans and Benoit Daloze. +本記事はJeremy EvansとBenoit Dalozeによる丁寧なレビュー(共著と言ってもよいくらいです)をいただきました。 -## History +## 更新履歴 -* Updated 2019-12-25: In 2.7.0-rc2, the warning message was slightly changed, and an API to suppress the warnings was added. +* 更新 2019-12-25: 2.7.0-rc2でwarningメッセージが若干変更され、warning抑制APIが追加された。 From 36c88c2bb991242f7ee04d51666df23d6b2c3d6d Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Thu, 30 Jan 2020 16:49:40 +0900 Subject: [PATCH 2160/3171] Fix untranslated lines --- ...ation-of-positional-and-keyword-arguments-in-ruby-3-0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 5e80e231d5..b9aec21a12 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -1,6 +1,6 @@ --- layout: news_post -title: "Separation of positional and keyword arguments in Ruby 3.0" +title: "Ruby 3.0における位置引数とキーワード引数の分離について" author: "mame" translator: "hachi8833" date: 2019-12-12 12:00:00 +0000 @@ -13,8 +13,8 @@ lang: ja Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 -* `Using the last argument as keyword parameters is deprecated`, or -* `Passing the keyword argument as the last hash parameter is deprecated`, or +* `Using the last argument as keyword parameters is deprecated` +* `Passing the keyword argument as the last hash parameter is deprecated` * `Splitting the last argument into positional and keyword parameters is deprecated` この非互換性は、double splat演算子(`**`)を追加することでほぼ回避できます。これにより、`Hash`オブジェクトではなくキーワード引数を渡すことが明示的に指定されます。同様に、キーワード引数ではなく`Hash`オブジェクトを明示的に渡したい場合は中かっこ(`{}`)を追加できます。詳しくは後述の「典型的なケース」をご覧ください。 From 416344e14125e0d3394aa7c45bdc70fc9bb9b734 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Sat, 27 Nov 2021 00:48:28 +0900 Subject: [PATCH 2161/3171] Revised the points pointed out in the review. --- ...ional-and-keyword-arguments-in-ruby-3-0.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index b9aec21a12..38c2aea1c9 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -11,7 +11,9 @@ lang: ja ## 概要 -Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 +この文書では便宜上、必須引数、オプション引数、rest引数、後置引数(つまり、キーワード引数とブロック引数以外の引数)をまとめて「位置引数」と呼びます。 + +Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7で警告を表示します。以下のいずれかの警告が表示される場合は、コードのアップデートが必要です。 * `Using the last argument as keyword parameters is deprecated` * `Passing the keyword argument as the last hash parameter is deprecated` @@ -100,13 +102,13 @@ foo(k: 1) #=> {:k=>1} ## Q: 自分のコードはRuby 2.7で動かなくなりますか? -手短かに言うと「壊れない可能性はあります」。 +A: たぶん動きます。 -Ruby 2.7におけるこの変更は、3.0への移行パスとして設計されています。あくまで原則としてですが、Ruby 2.7ではRuby 3.0で変更される振る舞いについてwarningを出すにとどめており、warningの中には私たちが微細とみなしている変更点も若干含まれます。詳しくは後述の「その他の微細な変更点」をご覧ください。 +Ruby 2.7では、原則として、Ruby 3.0で変更される振る舞いについて警告を出すにとどめています。しかし、私たちが軽微とみなした非互換も少しだけ入っています。詳しくは後述の「その他の軽微な変更点」をご覧ください。 -Ruby 2.7では、warningが表示される点と微細な変更点以外を除いてRuby 2.6との互換性を保とうとしています。つまり、あなたのコードはRuby 2.7でもおそらく動作しますが、warningが表示される可能性はあります。あなたのコードをRuby 2.7で実行すれば、Ruby 3.0の準備ができているかどうかをチェックできます。 +Ruby 2.7では、警告が表示される点と軽微な変更点以外を除いてRuby 2.6との互換性を保とうとしています。つまり、あなたのコードはRuby 2.7でもおそらく動作しますが、警告が表示される可能性はあります。あなたのコードをRuby 2.7で実行すれば、Ruby 3.0の準備ができているかどうかをチェックできます。 -非推奨のwarningを無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 +非推奨の警告を無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 ## 引数の委譲の扱いについて @@ -162,7 +164,7 @@ ruby2_keywords def foo(*args, &block) end {% endhighlight %} -残念ながら、Ruby 2.6以前では新しい委譲スタイルを正しく扱えないため、旧来の委譲スタイル(`**kwargs`を使わないなど)を使う必要があります。これは、キーワード引数を分離した理由のひとつでもあります(詳しくは本記事末尾をご覧ください)。`ruby2_keywords`を用いれば、Ruby 2.7や3.0でも旧来の委譲スタイルを引き続き利用できます。2.6以前のRubyでは`ruby2_keywords`が定義されていないので、[ruby2_keywords](https://rubygems.org/gems/ruby2_keywords) gemを使うか、以下を手動で定義します。 +残念ながら、Ruby 2.6以前では新しい委譲スタイルを正しく扱えないため、旧来の委譲スタイル(つまり、**kwargsを受け渡ししないスタイル)を使う必要があります。これは、キーワード引数を分離した理由のひとつでもあります(詳しくは本記事末尾をご覧ください)。`ruby2_keywords`を用いれば、Ruby 2.7や3.0でも旧来の委譲スタイルを引き続き利用できます。2.6以前のRubyでは`ruby2_keywords`が定義されていないので、[ruby2_keywords](https://rubygems.org/gems/ruby2_keywords) gemを使うか、以下を手動で定義します。 {% highlight ruby %} def ruby2_keywords(*) @@ -186,15 +188,15 @@ foo({}) #=> Ruby 2.7: [] ({}を含んでいない) foo({}, **{}) #=> Ruby 2.7: [{}] ({}を渡せば、キーワード引数が「ない」ことを明示できる) {% endhighlight %} -上のコードでは、空のHash引数が自動的に変換されて`**kwargs`に吸い込まれ、この空のキーワードハッシュは委譲の呼び出しで削除されます。このため、`targe`には引数がまったく渡されなくなります。私たちが把握している範囲では、これが唯一のエッジケースです。 +上のコードでは、空のHash引数が自動的に変換されて`**kwargs`に吸い込まれ、この空のキーワードハッシュは委譲の呼び出しで削除されます。このため、`target`には引数がまったく渡されなくなります。私たちが把握している範囲では、これが唯一のエッジケースです。 上のコードの最下部に書いたように、`**{}`を渡すことでこの問題を回避できます。 -移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6が役目を終えたときに削除される可能性があります。現時点で私たちがおすすめできるのは、キーワード引数を明示的に委譲することです(上述のRuby 3向けのコードを参照)。 +移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6がサポート切れになったあとで削除される可能性があります。そのときになったら、キーワード引数を明示的に委譲することをおすすめします(上述のRuby 3向けのコードを参照)。 -## その他の微細な変更点 +## その他の軽微な変更点 -Ruby 2.7のキーワード引数では、この他に以下の3つのマイナーチェンジが行われています。 +Ruby 2.7のキーワード引数では、この他に以下の3つの軽微な変更が行われています。 ### 1\. キーワード引数で非シンボルキーを利用できるようになった @@ -256,7 +258,7 @@ foo(**empty_hash) なお、`foo(**{})`はRuby 2.6以前とRuby 2.7のどちらの場合も引数を渡さず、`**{}`がパーサーによって削除される点にご注意ください。また、Ruby 2.7以降ではどちらも`**empty_hash`として同じに扱われるので、メソッドにキーワード引数を渡さないようにする指定が楽に行なえます。 -Ruby 2.7では、あるメソッド呼び出しで必須とされる位置引数の個数が不足している場合、Ruby 2.6との互換性を保つために`foo(**empty_hash)`は空のハッシュを渡してwarningを表示します。この振る舞いはRuby 3.0で廃止されます。 +Ruby 2.7では、あるメソッド呼び出しで必須とされる位置引数の個数が不足している場合、Ruby 2.6との互換性を保つために`foo(**empty_hash)`は空のハッシュを渡して警告を表示します。この振る舞いはRuby 3.0で廃止されます。 {% highlight ruby %} def foo(x) @@ -273,7 +275,7 @@ foo(**empty_hash) ### 3\. キーワード引数を受け取らないことを表す構文(`**nil`)が導入される -メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、事実上新機能です)。 +メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、新機能です)。 {% highlight ruby %} def foo(*args, **nil) @@ -283,7 +285,7 @@ foo(k: 1) #=> Ruby 2.7以降: no keywords accepted (ArgumentError) {% endhighlight %} -この新構文は、メソッドがキーワード引数を受け取らないことを明示的に指定するのに有用です。これを使わない場合、キーワード引数は上述の例の他の引数に吸い込まれます。メソッドを拡張してキーワード引数を受け取るようにする場合、以下のような非互換性が発生する可能性があります。 +この新構文は、メソッドがキーワード引数を受け取らないことを明示的に指定するのに有用です。これを使わない場合、キーワード引数は上述の例のrest引数に吸い込まれます。メソッドを拡張してキーワード引数を受け取るようにする場合、以下のような非互換性が発生する可能性があります。 {% highlight ruby %} # メソッドは残りの引数を受け取るが、`**nil`はない状態 @@ -307,7 +309,7 @@ foo(k: 1) #=> ArgumentError: unknown keyword k 当初、自動変換はうまいアイデアに思われていて、多くの場合問題なく機能していました。しかし、エッジケースがあまりにも多く、これまでこの振る舞いに関するバグレポートを山のように受け取りました。 -自動変換は、オプションの位置引数とキーワード引数をどちらも受け取るメソッドではうまく動きません。末尾のHashオブジェクトを位置引数として扱うことを期待する人々もいれば、末尾のHashオブジェクトをキーワード引数として扱うことを期待する人々もいました。 +自動変換は、オプション引数とキーワード引数をどちらも受け取るメソッドではうまく動きません。末尾のHashオブジェクトを位置引数として扱うことを期待する人々もいれば、末尾のHashオブジェクトをキーワード引数として扱うことを期待する人々もいました。 最も混乱を呼ぶケースのひとつを以下に示します。 @@ -345,7 +347,7 @@ foo() #=> Ruby 2.6以前: [{}] #=> Ruby 2.7以降: [] {% endhighlight %} -`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになります。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 +`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになり、blockはnilになります。。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 自動変換は開発者を混乱させるのみならず、メソッドの拡張性も弱めてしまいます。振る舞いが変更された理由や、特定の実装が選択された理由について詳しくは[Feature #14183](https://bugs.ruby-lang.org/issues/14183)をご覧ください。 @@ -355,4 +357,4 @@ foo() #=> Ruby 2.6以前: [{}] ## 更新履歴 -* 更新 2019-12-25: 2.7.0-rc2でwarningメッセージが若干変更され、warning抑制APIが追加された。 +* 更新 2019-12-25: 2.7.0-rc2で警告メッセージが若干変更され、警告抑制APIが追加された。 From 177e9c20ebd9f893fc9c1350840a507230d5d102 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Mon, 29 Nov 2021 09:43:56 +0900 Subject: [PATCH 2162/3171] Markup --- ...eparation-of-positional-and-keyword-arguments-in-ruby-3-0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 38c2aea1c9..7b981ae761 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -347,7 +347,7 @@ foo() #=> Ruby 2.6以前: [{}] #=> Ruby 2.7以降: [] {% endhighlight %} -`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになり、blockはnilになります。。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 +`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになり、`block`は`nil`になります。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 自動変換は開発者を混乱させるのみならず、メソッドの拡張性も弱めてしまいます。振る舞いが変更された理由や、特定の実装が選択された理由について詳しくは[Feature #14183](https://bugs.ruby-lang.org/issues/14183)をご覧ください。 From 2ddada69b79bbcce70fbf3e8888b7fe805dbf27a Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Wed, 22 Jan 2020 12:35:17 +0900 Subject: [PATCH 2163/3171] Add en doc --- ...ional-and-keyword-arguments-in-ruby-3-0.md | 355 ++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md new file mode 100644 index 0000000000..44cd874cc1 --- /dev/null +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -0,0 +1,355 @@ +--- +layout: news_post +title: "Separation of positional and keyword arguments in Ruby 3.0" +author: "mame" +translator: +date: 2019-12-12 12:00:00 +0000 +lang: en +--- + +This article explains the planned incompatibility of keyword arguments in Ruby 3.0 + +## tl;dr + +In Ruby 3.0, positional arguments and keyword arguments will be separated. Ruby 2.7 will warn for behaviors that will change in Ruby 3.0. If you see the following warnings, you need to update your code: + +* `Using the last argument as keyword parameters is deprecated`, or +* `Passing the keyword argument as the last hash parameter is deprecated`, or +* `Splitting the last argument into positional and keyword parameters is deprecated` + +In most cases, you can avoid the incompatibility by adding the _double splat_ operator. It explicitly specifies passing keyword arguments instead of a `Hash` object. Likewise, you may add braces `{}` to explicitly pass a `Hash` object, instead of keyword arguments. Read the section "Typical cases" below for more details. + +In Ruby 3, a method delegating all arguments must explicitly delegate keyword arguments in addition to positional arguments. If you want to keep the delegation behavior found in Ruby 2.7 and earlier, use `ruby2_keywords`. See the "Handling argument delegation" section below for more details. + +## Typical cases + +Here is the most typical case. You can use double splat operator (`**`) to pass keywords instead of a Hash. + +{% highlight ruby %} +# This method accepts only a keyword argument +def foo(k: 1) + p k +end + +h = { k: 42 } + +# This method call passes a positional Hash argument +# In Ruby 2.7: The Hash is automatically converted to a keyword argument +# In Ruby 3.0: This call raises an ArgumentError +foo(h) + # => demo.rb:11: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call + # demo.rb:2: warning: The called method `foo' is defined here + # 42 + +# If you want to keep the behavior in Ruby 3.0, use double splat +foo(**h) #=> 42 +{% endhighlight %} + +Here is another case. You can use braces (`{}`) to pass a Hash instead of keywords explicitly. + +{% highlight ruby %} +# This method accepts one positional argument and a keyword rest argument +def bar(h, **kwargs) + p h +end + +# This call passes only a keyword argument and no positional arguments +# In Ruby 2.7: The keyword is converted to a positional Hash argument +# In Ruby 3.0: This call raises an ArgumentError +bar(k: 42) + # => demo2.rb:9: warning: Passing the keyword argument as the last hash parameter is deprecated + # demo2.rb:2: warning: The called method `bar' is defined here + # {:k=>42} + +# If you want to keep the behavior in Ruby 3.0, write braces to make it an +# explicit Hash +bar({ k: 42 }) # => {:k=>42} +{% endhighlight %} + +## What is deprecated? + +In Ruby 2, keyword arguments can be treated as the last positional Hash argument and a last positional Hash argument can be treated as keyword arguments. + +Because the automatic conversion is sometimes too complex and troublesome as described in the final section. So it's now deprecated in Ruby 2.7 and will be removed in Ruby 3. In other words, keyword arguments will be completely separated from positional one in Ruby 3. So when you want to pass keyword arguments, you should always use `foo(k: expr)` or `foo(**expr)`. If you want to accept keyword arguments, in principle you should always use `def foo(k: default)` or `def foo(k:)` or `def foo(**kwargs)`. + +Note that Ruby 3.0 doesn't behave differently when calling a method which doesn't accept keyword arguments with keyword arguments. For instance, the following case is not going to be deprecated and will keep working in Ruby 3.0. The keyword arguments are still treated as a positional Hash argument. + +{% highlight ruby %} +def foo(kwargs = {}) + kwargs +end + +foo(k: 1) #=> {:k=>1} +{% endhighlight %} + +This is because this style is used very frequently, and there is no ambiguity in how the argument should be treated. Prohibiting this conversion would result in additional incompatibility for little benefit. + +However, this style is not recommended in new code, unless you are often passing a Hash as a positional argument, and are also using keyword arguments. Otherwise, use double splat: + +{% highlight ruby %} +def foo(**kwargs) + kwargs +end + +foo(k: 1) #=> {:k=>1} +{% endhighlight %} + +## Will my code break on Ruby 2.7? + +A short answer is "maybe not". + +The changes in Ruby 2.7 are designed as a migration path towards 3.0. While in principle, Ruby 2.7 only warns against behaviors that will change in Ruby 3, it includes some incompatible changes we consider to be minor. See the "Other minor changes" section for details. + +Except for the warnings and minor changes, Ruby 2.7 attempts to keep the compatibility with Ruby 2.6. So, your code will probably work on Ruby 2.7, though it may emit warnings. And by running it on Ruby 2.7, you can check if your code is ready for Ruby 3.0. + +If you want to disable the deprecation warnings, please use a command-line argument `-W:no-deprecated` or add `Warning[:deprecated] = false` to your code. + +## Handling argument delegation + +### Ruby 2.6 or prior + +In Ruby 2, you can write a delegation method by accepting a `*rest` argument and a `&block` argument, and passing the two to the target method. In this behavior, the keyword arguments are also implicitly handled by the automatic conversion between positional and keyword arguments. + +{% highlight ruby %} +def foo(*args, &block) + target(*args, &block) +end +{% endhighlight %} + +### Ruby 3 + +You need to explicitly delegate keyword arguments. + +{% highlight ruby %} +def foo(*args, **kwargs, &block) + target(*args, **kwargs, &block) +end +{% endhighlight %} + +Alternatively, if you do not need compatibility with Ruby 2.6 or prior and you don't alter any arguments, you can use the new delegation syntax (`...`) that is introduced in Ruby 2.7. + +{% highlight ruby %} +def foo(...) + target(...) +end +{% endhighlight %} + +### Ruby 2.7 + +In short: use `Module#ruby2_keywords` and delegate `*args, &block`. + +{% highlight ruby %} +ruby2_keywords def foo(*args, &block) + target(*args, &block) +end +{% endhighlight %} + +`ruby2_keywords` accepts keyword arguments as the last Hash argument, and passes it as keyword arguments when calling the other method. + +In fact, Ruby 2.7 allows the new style of delegation in many cases. However, there is a known corner case. See the next section. + +### A compatible delegation that works on Ruby 2.6, 2.7 and Ruby 3 + +In short: use `Module#ruby2_keywords` again. + +{% highlight ruby %} +ruby2_keywords def foo(*args, &block) + target(*args, &block) +end +{% endhighlight %} + +Unfortunately, we need to use the old-style delegation (i.e., no `**kwargs`) because Ruby 2.6 or prior does not handle the new delegation style correctly. This is one of the reasons of the keyword argument separation; the details are described in the final section. And `ruby2_keywords` allows you to run the old style even in Ruby 2.7 and 3.0. As there is no `ruby2_keywords` defined in 2.6 or prior, please use the [ruby2_keywords gem](https://rubygems.org/gems/ruby2_keywords) or define it yourself: + +{% highlight ruby %} +def ruby2_keywords(*) +end if RUBY_VERSION < "2.7" +{% endhighlight %} + +--- + +If your code doesn't have to run on Ruby 2.6 or older, you may try the new style in Ruby 2.7. In almost all cases, it works. Note that, however, there are unfortunate corner cases as follows: + +{% highlight ruby %} +def target(*args) + p args +end + +def foo(*args, **kwargs, &block) + target(*args, **kwargs, &block) +end + +foo({}) #=> Ruby 2.7: [] ({} is dropped) +foo({}, **{}) #=> Ruby 2.7: [{}] (You can pass {} by explicitly passing "no" keywords) +{% endhighlight %} + +An empty Hash argument is automatically converted and absorbed into `**kwargs`, and the delegation call removes the empty keyword hash, so no argument is passed to `target`. As far as we know, this is the only corner case. + +As noted in the last line, you can work around this issue by using `**{}`. + +If you really worry about the portability, use `ruby2_keywords`. (Acknowledge that Ruby 2.6 or before themselves have tons of corner cases in keyword arguments. :-) +`ruby2_keywords` might be removed in the future after Ruby 2.6 reaches end-of-life. At that point, we recommend to explicitly delegate keyword arguments (see Ruby 3 code above). + +## Other minor changes + +There are three minor changes about keyword arguments in Ruby 2.7. + +### 1. Non-Symbol keys are allowed in keyword arguments + +In Ruby 2.6 or before, only Symbol keys were allowed in keyword arguments. In Ruby 2.7, keyword arguments can use non-Symbol keys. + +{% highlight ruby %} +def foo(**kwargs) + kwargs +end +foo("key" => 42) + #=> Ruby 2.6 or before: ArgumentError: wrong number of arguments + #=> Ruby 2.7 or later: {"key"=>42} +{% endhighlight %} + +If a method accepts both optional and keyword arguments, the Hash object that has both Symbol keys and non-Symbol keys was split in two in Ruby 2.6. In Ruby 2.7, both are accepted as keywords because non-Symbol keys are allowed. + +{% highlight ruby %} +def bar(x=1, **kwargs) + p [x, kwargs] +end + +bar("key" => 42, :sym => 43) + #=> Ruby 2.6: [{"key"=>42}, {:sym=>43}] + #=> Ruby 2.7: [1, {"key"=>42, :sym=>43}] + +# Use braces to keep the behavior +bar({"key" => 42}, :sym => 43) + #=> Ruby 2.6 and 2.7: [{"key"=>42}, {:sym=>43}] +{% endhighlight %} + +Ruby 2.7 still splits hashes with a warning if passing a Hash or keyword arguments with both Symbol and non-Symbol keys to a method that accepts explicit keywords but no keyword rest argument (`**kwargs`). This behavior will be removed in Ruby 3, and an `ArgumentError` will be raised. + +{% highlight ruby %} +def bar(x=1, sym: nil) + p [x, sym] +end + +bar("key" => 42, :sym => 43) +# Ruby 2.6 and 2.7: => [{"key"=>42}, 43] +# Ruby 2.7: warning: Splitting the last argument into positional and keyword parameters is deprecated +# warning: The called method `bar' is defined here +# Ruby 3.0: ArgumentError +{% endhighlight %} + +### 2. Double splat with an empty hash (`**{}`) passes no arguments + +In Ruby 2.6 or before, passing `**empty_hash` passes an empty Hash as a positional argument. In Ruby 2.7 or later, it passes no arguments. + +{% highlight ruby %} +def foo(*args) + args +end + +empty_hash = {} +foo(**empty_hash) + #=> Ruby 2.6 or before: [{}] + #=> Ruby 2.7 or later: [] +{% endhighlight %} + +Note that `foo(**{})` passes nothing in both Ruby 2.6 and 2.7. In Ruby 2.6 and before, `**{}` is removed by the parser, and in Ruby 2.7 and above, it is treated the same as `**empty_hash`, allowing for an easy way to pass no keyword arguments to a method. + +In Ruby 2.7, when calling a method with an insufficient number of required positional arguments, `foo(**empty_hash)` passes an empty hash with a warning emitted, for compatibility with Ruby 2.6. This behavior will be removed in 3.0. + +{% highlight ruby %} +def foo(x) + x +end + +empty_hash = {} +foo(**empty_hash) + #=> Ruby 2.6 or before: {} + #=> Ruby 2.7: warning: Passing the keyword argument as the last hash parameter is deprecated + # warning: The called method `foo' is defined here + #=> Ruby 3.0: ArgumentError: wrong number of arguments +{% endhighlight %} + +### 3. The no-keyword-arguments syntax (`**nil`) is introduced + +You can use `**nil` in a method definition to explicitly mark the method accepts no keyword arguments. Calling such methods with keyword arguments will result in an `ArgumentError`. (This is actually a new feature, not an incompatibility) + +{% highlight ruby %} +def foo(*args, **nil) +end + +foo(k: 1) + #=> Ruby 2.7 or later: no keywords accepted (ArgumentError) +{% endhighlight %} + +This is useful to make it explicit that the method does not accept keyword arguments. Otherwise, the keywords are absorbed in the rest argument in the above example. If you extend a method to accept keyword arguments, the method may have incompatibility as follows: + +{% highlight ruby %} +# If a method accepts rest argument and no `**nil` +def foo(*args) + p args +end + +# Passing keywords are converted to a Hash object (even in Ruby 3.0) +foo(k: 1) #=> [{:k=>1}] + +# If the method is extended to accept a keyword +def foo(*args, mode: false) + p args +end + +# The existing call may break +foo(k: 1) #=> ArgumentError: unknown keyword k +{% endhighlight %} + +## Why we're deprecating the automatic conversion + +The automatic conversion initially appeared to be a good idea, and worked well in many cases. However, it had too many corner cases, and we have received many bug reports about the behavior. + +Automatic conversion does not work well when a method accepts optional positional arguments and keyword arguments. Some people expect the last Hash object to be treated as a positional argument, and others expect it to be converted to keyword arguments. + +Here is one of the most confusing cases: + +{% highlight ruby %} +def foo(x, **kwargs) + p [x, kwargs] +end + +def bar(x=1, **kwargs) + p [x, kwargs] +end + +foo({}) => [{}, {}] +bar({}) => [1, {}] + +bar({}, **{}) => expected: [{}, {}], actual: [1, {}] +{% endhighlight %} + +In Ruby 2, `foo({})` passes an empty hash as a normal argument (i.e., `{}` is assigned to `x`), while `bar({})` passes a keyword argument (i.e, `{}` is assigned to `kwargs`). So `any_method({})` is very ambiguous. + +You may think of `bar({}, **{})` to pass the empty hash to `x` explicitly. Surprisingly, it does not work as you expected; it still prints `[1, {}]` in Ruby 2.6. This is because `**{}` is ignored by the parser in Ruby 2.6, and the first argument `{}` is automatically converted to keywords (`**kwargs`). In this case, you need to call `bar({}, {})`, which is very weird. + +The same issues also apply to methods that accept rest and keyword arguments. This makes explicit delegation of keyword arguments not work. + +{% highlight ruby %} +def target(*args) + p args +end + +def foo(*args, **kwargs, &block) + target(*args, **kwargs, &block) +end + +foo() #=> Ruby 2.6 or before: [{}] + #=> Ruby 2.7 or later: [] +{% endhighlight %} + +`foo()` passes no arguments, but `target` receives an empty hash argument in Ruby 2.6. This is because the method `foo` delegates keywords (`**kwargs`) explicitly. When `foo()` is called, `args` is an empty Array, `kwargs` is an empty Hash, and `block` is `nil`. And then `target(*args, **kwargs, &block)` passes an empty Hash as an argument because `**kwargs` is automatically converted to a positional Hash argument. + +The automatic conversion not only confuses people but also makes the method less extensible. See [[Feature #14183]](https://bugs.ruby-lang.org/issues/14183) for more details about the reasons for the change in behavior, and why certain implementation choices were made. + +## Acknowledgment + +This article was kindly reviewed (or even co-authored) by Jeremy Evans and Benoit Daloze. + +## History + +* Updated 2019-12-25: In 2.7.0-rc2, the warning message was slightly changed, and an API to suppress the warnings was added. From b98d7083356c9cf8ecab750872108243561e38cb Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Wed, 22 Jan 2020 12:35:47 +0900 Subject: [PATCH 2164/3171] Translate "Separation of positional and keyword arguments in Ruby 3.0" --- ...ional-and-keyword-arguments-in-ruby-3-0.md | 195 +++++++++--------- 1 file changed, 99 insertions(+), 96 deletions(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 44cd874cc1..5e80e231d5 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -2,77 +2,81 @@ layout: news_post title: "Separation of positional and keyword arguments in Ruby 3.0" author: "mame" -translator: +translator: "hachi8833" date: 2019-12-12 12:00:00 +0000 -lang: en +lang: ja --- -This article explains the planned incompatibility of keyword arguments in Ruby 3.0 +本記事では、Ruby 3.0で予定されているキーワード引数の非互換性について解説します。 -## tl;dr +## 概要 -In Ruby 3.0, positional arguments and keyword arguments will be separated. Ruby 2.7 will warn for behaviors that will change in Ruby 3.0. If you see the following warnings, you need to update your code: +Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 * `Using the last argument as keyword parameters is deprecated`, or * `Passing the keyword argument as the last hash parameter is deprecated`, or * `Splitting the last argument into positional and keyword parameters is deprecated` -In most cases, you can avoid the incompatibility by adding the _double splat_ operator. It explicitly specifies passing keyword arguments instead of a `Hash` object. Likewise, you may add braces `{}` to explicitly pass a `Hash` object, instead of keyword arguments. Read the section "Typical cases" below for more details. +この非互換性は、double splat演算子(`**`)を追加することでほぼ回避できます。これにより、`Hash`オブジェクトではなくキーワード引数を渡すことが明示的に指定されます。同様に、キーワード引数ではなく`Hash`オブジェクトを明示的に渡したい場合は中かっこ(`{}`)を追加できます。詳しくは後述の「典型的なケース」をご覧ください。 -In Ruby 3, a method delegating all arguments must explicitly delegate keyword arguments in addition to positional arguments. If you want to keep the delegation behavior found in Ruby 2.7 and earlier, use `ruby2_keywords`. See the "Handling argument delegation" section below for more details. +Ruby 3では、すべての引数を委譲するメソッドで、位置引数の他に必ずキーワード引数も明示的に委譲しなければなりません。Ruby 2.7以前の委譲の振る舞いを変えたくない場合は、`ruby2_keywords`をお使いください。詳しくは後述の「引数の委譲の扱いについて」をご覧ください。 -## Typical cases +## よくあるケース -Here is the most typical case. You can use double splat operator (`**`) to pass keywords instead of a Hash. +以下はもっともよくあるケースです。Hashではなくキーワードを渡すのにdouble splat演算子(`**`)を使えます。 {% highlight ruby %} -# This method accepts only a keyword argument +# このメソッドはキーワード引数のみを受け取る def foo(k: 1) p k end h = { k: 42 } -# This method call passes a positional Hash argument -# In Ruby 2.7: The Hash is automatically converted to a keyword argument -# In Ruby 3.0: This call raises an ArgumentError +# このメソッド呼び出しは位置引数としてHashを渡している +# Ruby 2.7: このHashは自動でキーワード引数に変換される +# Ruby 3.0: この呼び出しはArgumentErrorになる foo(h) # => demo.rb:11: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call # demo.rb:2: warning: The called method `foo' is defined here # 42 -# If you want to keep the behavior in Ruby 3.0, use double splat +# この振る舞いをRuby 3.0で変えたくない場合はdouble splatを用いる foo(**h) #=> 42 {% endhighlight %} -Here is another case. You can use braces (`{}`) to pass a Hash instead of keywords explicitly. +別の例: キーワード引数ではなくHashを明示的に渡す場合は中かっこ(`{}`)を使います。 {% highlight ruby %} -# This method accepts one positional argument and a keyword rest argument +# このメソッドは位置引数を1個、残りはキーワード引数を受け取る def bar(h, **kwargs) p h end -# This call passes only a keyword argument and no positional arguments -# In Ruby 2.7: The keyword is converted to a positional Hash argument -# In Ruby 3.0: This call raises an ArgumentError +# この呼び出しではキーワード引数のみが渡され、位置引数は渡されない +# Ruby 2.7: このキーワード引数は自動でHash引数に変換される +# Ruby 3.0: この呼び出しはArgumentErrorになる bar(k: 42) # => demo2.rb:9: warning: Passing the keyword argument as the last hash parameter is deprecated # demo2.rb:2: warning: The called method `bar' is defined here # {:k=>42} -# If you want to keep the behavior in Ruby 3.0, write braces to make it an -# explicit Hash +# この振る舞いをRuby 3.0で変えたくない場合は +# 中かっこで明示的にHashにする bar({ k: 42 }) # => {:k=>42} {% endhighlight %} -## What is deprecated? +## どの動作が非推奨になるか -In Ruby 2, keyword arguments can be treated as the last positional Hash argument and a last positional Hash argument can be treated as keyword arguments. +Ruby 2では、キーワード引数が末尾のハッシュ位置引数として扱われることがあります。また、末尾のハッシュ引数がキーワード引数として扱われることもあります。 -Because the automatic conversion is sometimes too complex and troublesome as described in the final section. So it's now deprecated in Ruby 2.7 and will be removed in Ruby 3. In other words, keyword arguments will be completely separated from positional one in Ruby 3. So when you want to pass keyword arguments, you should always use `foo(k: expr)` or `foo(**expr)`. If you want to accept keyword arguments, in principle you should always use `def foo(k: default)` or `def foo(k:)` or `def foo(**kwargs)`. +この自動変換は場合によっては複雑になりすぎてしまい、本記事末尾で後述するようにトラブルの原因になることがあります。そのため、この自動変換をRuby 2.7で非推奨とし、Ruby 3.0で廃止する予定です。言い換えると、Ruby 3.0のキーワード引数は位置引数と完全に分離されることになります。つまり、キーワード引数を渡したい場合は、常に`foo(k: expr)`または`foo(**expr)`の形にすべきです。(メソッド定義で)キーワード引数を受け取りたい場合は、原則として常に以下のいずれかの形にすべきです。 -Note that Ruby 3.0 doesn't behave differently when calling a method which doesn't accept keyword arguments with keyword arguments. For instance, the following case is not going to be deprecated and will keep working in Ruby 3.0. The keyword arguments are still treated as a positional Hash argument. +* `def foo(k: default)` +* `def foo(k:)` +* `def foo(**kwargs)` + +なお、キーワード引数を受け取らないメソッドを呼び出すときにキーワード引数を渡した場合の振る舞いは、Ruby 3.0でも変わらない点にご注意ください。たとえば、以下のケースは非推奨にはならず、Ruby 3.0でも引き続き動作します(このキーワード引数は引き続きHash位置引数として扱われます)。 {% highlight ruby %} def foo(kwargs = {}) @@ -82,9 +86,9 @@ end foo(k: 1) #=> {:k=>1} {% endhighlight %} -This is because this style is used very frequently, and there is no ambiguity in how the argument should be treated. Prohibiting this conversion would result in additional incompatibility for little benefit. +変わらない理由は、このスタイルが非常によく用いられていることと、この呼び出し方法では引数の扱いに曖昧な点がないためです。この振る舞いまで禁止してしまうと、得られるメリットが少ないうえに非互換性がさらに増えてしまいます。 -However, this style is not recommended in new code, unless you are often passing a Hash as a positional argument, and are also using keyword arguments. Otherwise, use double splat: +ただし今後新しいコードを書く場合、このスタイルはおすすめできません(Hashを位置引数として渡す頻度が高く、かつキーワード引数も使う場合を除く)。代わりに、次のようにdouble splat(`**`)をお使いください。 {% highlight ruby %} def foo(**kwargs) @@ -94,21 +98,21 @@ end foo(k: 1) #=> {:k=>1} {% endhighlight %} -## Will my code break on Ruby 2.7? +## Q: 自分のコードはRuby 2.7で動かなくなりますか? -A short answer is "maybe not". +手短かに言うと「壊れない可能性はあります」。 -The changes in Ruby 2.7 are designed as a migration path towards 3.0. While in principle, Ruby 2.7 only warns against behaviors that will change in Ruby 3, it includes some incompatible changes we consider to be minor. See the "Other minor changes" section for details. +Ruby 2.7におけるこの変更は、3.0への移行パスとして設計されています。あくまで原則としてですが、Ruby 2.7ではRuby 3.0で変更される振る舞いについてwarningを出すにとどめており、warningの中には私たちが微細とみなしている変更点も若干含まれます。詳しくは後述の「その他の微細な変更点」をご覧ください。 -Except for the warnings and minor changes, Ruby 2.7 attempts to keep the compatibility with Ruby 2.6. So, your code will probably work on Ruby 2.7, though it may emit warnings. And by running it on Ruby 2.7, you can check if your code is ready for Ruby 3.0. +Ruby 2.7では、warningが表示される点と微細な変更点以外を除いてRuby 2.6との互換性を保とうとしています。つまり、あなたのコードはRuby 2.7でもおそらく動作しますが、warningが表示される可能性はあります。あなたのコードをRuby 2.7で実行すれば、Ruby 3.0の準備ができているかどうかをチェックできます。 -If you want to disable the deprecation warnings, please use a command-line argument `-W:no-deprecated` or add `Warning[:deprecated] = false` to your code. +非推奨のwarningを無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 -## Handling argument delegation +## 引数の委譲の扱いについて -### Ruby 2.6 or prior +### Ruby 2.6以前の場合 -In Ruby 2, you can write a delegation method by accepting a `*rest` argument and a `&block` argument, and passing the two to the target method. In this behavior, the keyword arguments are also implicitly handled by the automatic conversion between positional and keyword arguments. +Ruby 2では、以下のように1個の`*rest`引数と1個の`&block`引数を受け付けて、この2つの引数を委譲先メソッド(以下の`target`)に渡すことで委譲メソッドを書けます。この振る舞いでは、(1つ以上の)キーワード引数も「位置引数<=>キーワード引数の自動変換」によって暗黙的に扱われます。 {% highlight ruby %} def foo(*args, &block) @@ -116,9 +120,9 @@ def foo(*args, &block) end {% endhighlight %} -### Ruby 3 +### Ruby 3の場合 -You need to explicitly delegate keyword arguments. +以下のようにキーワード引数を明示的に委譲する必要があります。 {% highlight ruby %} def foo(*args, **kwargs, &block) @@ -126,7 +130,7 @@ def foo(*args, **kwargs, &block) end {% endhighlight %} -Alternatively, if you do not need compatibility with Ruby 2.6 or prior and you don't alter any arguments, you can use the new delegation syntax (`...`) that is introduced in Ruby 2.7. +別の方法として、Ruby 2.6以前との互換性を考慮する必要がなく、かつ引数を一切改変しないのであれば、以下のようにRuby 2.7で新しく導入される委譲構文(`...`)を利用できます。 {% highlight ruby %} def foo(...) @@ -134,9 +138,9 @@ def foo(...) end {% endhighlight %} -### Ruby 2.7 +### Ruby 2.7の場合 -In short: use `Module#ruby2_keywords` and delegate `*args, &block`. +手短かに言うと、以下のように`Module#ruby2_keywords`を用い、`*args, &block`を委譲します。 {% highlight ruby %} ruby2_keywords def foo(*args, &block) @@ -144,13 +148,13 @@ ruby2_keywords def foo(*args, &block) end {% endhighlight %} -`ruby2_keywords` accepts keyword arguments as the last Hash argument, and passes it as keyword arguments when calling the other method. +`ruby2_keywords`を指定すると、キーワード引数を末尾のHash引数として受け取れるようになり、他のメソッドを呼び出すときにそれをキーワード引数として渡せます。 -In fact, Ruby 2.7 allows the new style of delegation in many cases. However, there is a known corner case. See the next section. +実際、Ruby 2.7では多くの場面でこの新しい委譲のスタイルを利用できます。ただし1つ既知のエッジケースがあります。次をご覧ください。 -### A compatible delegation that works on Ruby 2.6, 2.7 and Ruby 3 +### Ruby 2.6 / 2.7 / 3で互換性のある委譲スタイル -In short: use `Module#ruby2_keywords` again. +手短かに言うと、ここも「`Module#ruby2_keywords`を使う」となります。 {% highlight ruby %} ruby2_keywords def foo(*args, &block) @@ -158,16 +162,16 @@ ruby2_keywords def foo(*args, &block) end {% endhighlight %} -Unfortunately, we need to use the old-style delegation (i.e., no `**kwargs`) because Ruby 2.6 or prior does not handle the new delegation style correctly. This is one of the reasons of the keyword argument separation; the details are described in the final section. And `ruby2_keywords` allows you to run the old style even in Ruby 2.7 and 3.0. As there is no `ruby2_keywords` defined in 2.6 or prior, please use the [ruby2_keywords gem](https://rubygems.org/gems/ruby2_keywords) or define it yourself: +残念ながら、Ruby 2.6以前では新しい委譲スタイルを正しく扱えないため、旧来の委譲スタイル(`**kwargs`を使わないなど)を使う必要があります。これは、キーワード引数を分離した理由のひとつでもあります(詳しくは本記事末尾をご覧ください)。`ruby2_keywords`を用いれば、Ruby 2.7や3.0でも旧来の委譲スタイルを引き続き利用できます。2.6以前のRubyでは`ruby2_keywords`が定義されていないので、[ruby2_keywords](https://rubygems.org/gems/ruby2_keywords) gemを使うか、以下を手動で定義します。 {% highlight ruby %} def ruby2_keywords(*) end if RUBY_VERSION < "2.7" {% endhighlight %} ---- +* * * * * -If your code doesn't have to run on Ruby 2.6 or older, you may try the new style in Ruby 2.7. In almost all cases, it works. Note that, however, there are unfortunate corner cases as follows: +自分のコードがRuby 2.6以前で動かなくても構わないのであれば、Ruby 2.7で新しいスタイルを試してもよいでしょう。ほぼほぼ間違いなく動作しますが、以下のようなエッジケースを運悪く踏むこともあります。 {% highlight ruby %} def target(*args) @@ -178,35 +182,34 @@ def foo(*args, **kwargs, &block) target(*args, **kwargs, &block) end -foo({}) #=> Ruby 2.7: [] ({} is dropped) -foo({}, **{}) #=> Ruby 2.7: [{}] (You can pass {} by explicitly passing "no" keywords) +foo({}) #=> Ruby 2.7: [] ({}を含んでいない) +foo({}, **{}) #=> Ruby 2.7: [{}] ({}を渡せば、キーワード引数が「ない」ことを明示できる) {% endhighlight %} -An empty Hash argument is automatically converted and absorbed into `**kwargs`, and the delegation call removes the empty keyword hash, so no argument is passed to `target`. As far as we know, this is the only corner case. +上のコードでは、空のHash引数が自動的に変換されて`**kwargs`に吸い込まれ、この空のキーワードハッシュは委譲の呼び出しで削除されます。このため、`targe`には引数がまったく渡されなくなります。私たちが把握している範囲では、これが唯一のエッジケースです。 -As noted in the last line, you can work around this issue by using `**{}`. +上のコードの最下部に書いたように、`**{}`を渡すことでこの問題を回避できます。 -If you really worry about the portability, use `ruby2_keywords`. (Acknowledge that Ruby 2.6 or before themselves have tons of corner cases in keyword arguments. :-) -`ruby2_keywords` might be removed in the future after Ruby 2.6 reaches end-of-life. At that point, we recommend to explicitly delegate keyword arguments (see Ruby 3 code above). +移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6が役目を終えたときに削除される可能性があります。現時点で私たちがおすすめできるのは、キーワード引数を明示的に委譲することです(上述のRuby 3向けのコードを参照)。 -## Other minor changes +## その他の微細な変更点 -There are three minor changes about keyword arguments in Ruby 2.7. +Ruby 2.7のキーワード引数では、この他に以下の3つのマイナーチェンジが行われています。 -### 1. Non-Symbol keys are allowed in keyword arguments +### 1\. キーワード引数で非シンボルキーを利用できるようになった -In Ruby 2.6 or before, only Symbol keys were allowed in keyword arguments. In Ruby 2.7, keyword arguments can use non-Symbol keys. +Ruby 2.6以前のキーワード引数では、シンボル形式のキーしか利用できませんでした。Ruby 2.7のキーワード引数では、以下のようにシンボル形式でないキーを利用できるようになります。 {% highlight ruby %} def foo(**kwargs) kwargs end foo("key" => 42) - #=> Ruby 2.6 or before: ArgumentError: wrong number of arguments - #=> Ruby 2.7 or later: {"key"=>42} + #=> Ruby 2.6以前: ArgumentError: wrong number of arguments + #=> Ruby 2.7以降: {"key"=>42} {% endhighlight %} -If a method accepts both optional and keyword arguments, the Hash object that has both Symbol keys and non-Symbol keys was split in two in Ruby 2.6. In Ruby 2.7, both are accepted as keywords because non-Symbol keys are allowed. +あるメソッドがオプション引数とキーワード引数を両方とも受け付ける場合、Ruby 2.6では以下のようにシンボル形式のキーと非シンボルキーを両方持つHashオブジェクトが2つに分割されていました。Ruby 2.7では非シンボルキーを利用できるので、どちらも受け取れます。 {% highlight ruby %} def bar(x=1, **kwargs) @@ -217,12 +220,12 @@ bar("key" => 42, :sym => 43) #=> Ruby 2.6: [{"key"=>42}, {:sym=>43}] #=> Ruby 2.7: [1, {"key"=>42, :sym=>43}] -# Use braces to keep the behavior +# 振る舞いを変えたくない場合は中かっこ{}を使う bar({"key" => 42}, :sym => 43) #=> Ruby 2.6 and 2.7: [{"key"=>42}, {:sym=>43}] {% endhighlight %} -Ruby 2.7 still splits hashes with a warning if passing a Hash or keyword arguments with both Symbol and non-Symbol keys to a method that accepts explicit keywords but no keyword rest argument (`**kwargs`). This behavior will be removed in Ruby 3, and an `ArgumentError` will be raised. +Ruby 2.7では、キーワード引数を明示的に受け付けるがキーワードrest引数(`**kwargs`)を受け取らないメソッドに対して、シンボル形式のキーと非シンボルキーが両方混じったHashやキーワード引数を渡すと、引き続きハッシュを分割して警告を表示します。この振る舞いはRuby 3で廃止されて`ArgumentError`にする予定です。 {% highlight ruby %} def bar(x=1, sym: nil) @@ -230,15 +233,15 @@ def bar(x=1, sym: nil) end bar("key" => 42, :sym => 43) -# Ruby 2.6 and 2.7: => [{"key"=>42}, 43] +# Ruby 2.6と2.7: => [{"key"=>42}, 43] # Ruby 2.7: warning: Splitting the last argument into positional and keyword parameters is deprecated # warning: The called method `bar' is defined here # Ruby 3.0: ArgumentError {% endhighlight %} -### 2. Double splat with an empty hash (`**{}`) passes no arguments +### 2\. double splatを付けた空ハッシュ(`**{}`)で引数を渡さないようになった -In Ruby 2.6 or before, passing `**empty_hash` passes an empty Hash as a positional argument. In Ruby 2.7 or later, it passes no arguments. +Ruby 2.6以前は、`**empty_hash`を渡すと位置引数に空のハッシュが渡されました(`[{}]`)。Ruby 2.7以降では引数を渡さなくなります。 {% highlight ruby %} def foo(*args) @@ -247,13 +250,13 @@ end empty_hash = {} foo(**empty_hash) - #=> Ruby 2.6 or before: [{}] - #=> Ruby 2.7 or later: [] + #=> Ruby 2.6以前: [{}] + #=> Ruby 2.7以降: [] {% endhighlight %} -Note that `foo(**{})` passes nothing in both Ruby 2.6 and 2.7. In Ruby 2.6 and before, `**{}` is removed by the parser, and in Ruby 2.7 and above, it is treated the same as `**empty_hash`, allowing for an easy way to pass no keyword arguments to a method. +なお、`foo(**{})`はRuby 2.6以前とRuby 2.7のどちらの場合も引数を渡さず、`**{}`がパーサーによって削除される点にご注意ください。また、Ruby 2.7以降ではどちらも`**empty_hash`として同じに扱われるので、メソッドにキーワード引数を渡さないようにする指定が楽に行なえます。 -In Ruby 2.7, when calling a method with an insufficient number of required positional arguments, `foo(**empty_hash)` passes an empty hash with a warning emitted, for compatibility with Ruby 2.6. This behavior will be removed in 3.0. +Ruby 2.7では、あるメソッド呼び出しで必須とされる位置引数の個数が不足している場合、Ruby 2.6との互換性を保つために`foo(**empty_hash)`は空のハッシュを渡してwarningを表示します。この振る舞いはRuby 3.0で廃止されます。 {% highlight ruby %} def foo(x) @@ -262,51 +265,51 @@ end empty_hash = {} foo(**empty_hash) - #=> Ruby 2.6 or before: {} + #=> Ruby 2.6以前: {} #=> Ruby 2.7: warning: Passing the keyword argument as the last hash parameter is deprecated # warning: The called method `foo' is defined here #=> Ruby 3.0: ArgumentError: wrong number of arguments {% endhighlight %} -### 3. The no-keyword-arguments syntax (`**nil`) is introduced +### 3\. キーワード引数を受け取らないことを表す構文(`**nil`)が導入される -You can use `**nil` in a method definition to explicitly mark the method accepts no keyword arguments. Calling such methods with keyword arguments will result in an `ArgumentError`. (This is actually a new feature, not an incompatibility) +メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、事実上新機能です)。 {% highlight ruby %} def foo(*args, **nil) end foo(k: 1) - #=> Ruby 2.7 or later: no keywords accepted (ArgumentError) + #=> Ruby 2.7以降: no keywords accepted (ArgumentError) {% endhighlight %} -This is useful to make it explicit that the method does not accept keyword arguments. Otherwise, the keywords are absorbed in the rest argument in the above example. If you extend a method to accept keyword arguments, the method may have incompatibility as follows: +この新構文は、メソッドがキーワード引数を受け取らないことを明示的に指定するのに有用です。これを使わない場合、キーワード引数は上述の例の他の引数に吸い込まれます。メソッドを拡張してキーワード引数を受け取るようにする場合、以下のような非互換性が発生する可能性があります。 {% highlight ruby %} -# If a method accepts rest argument and no `**nil` +# メソッドは残りの引数を受け取るが、`**nil`はない状態 def foo(*args) p args end -# Passing keywords are converted to a Hash object (even in Ruby 3.0) +# キーワード引数はHashオブジェクトに変換される(Ruby 3.0でも同じ) foo(k: 1) #=> [{:k=>1}] -# If the method is extended to accept a keyword +# メソッドがキーワード引数を受け取るよう拡張した場合 def foo(*args, mode: false) p args end -# The existing call may break +# 以下の呼び出しが壊れる可能性がある foo(k: 1) #=> ArgumentError: unknown keyword k {% endhighlight %} -## Why we're deprecating the automatic conversion +## 自動変換を非推奨に変える理由 -The automatic conversion initially appeared to be a good idea, and worked well in many cases. However, it had too many corner cases, and we have received many bug reports about the behavior. +当初、自動変換はうまいアイデアに思われていて、多くの場合問題なく機能していました。しかし、エッジケースがあまりにも多く、これまでこの振る舞いに関するバグレポートを山のように受け取りました。 -Automatic conversion does not work well when a method accepts optional positional arguments and keyword arguments. Some people expect the last Hash object to be treated as a positional argument, and others expect it to be converted to keyword arguments. +自動変換は、オプションの位置引数とキーワード引数をどちらも受け取るメソッドではうまく動きません。末尾のHashオブジェクトを位置引数として扱うことを期待する人々もいれば、末尾のHashオブジェクトをキーワード引数として扱うことを期待する人々もいました。 -Here is one of the most confusing cases: +最も混乱を呼ぶケースのひとつを以下に示します。 {% highlight ruby %} def foo(x, **kwargs) @@ -317,17 +320,17 @@ def bar(x=1, **kwargs) p [x, kwargs] end -foo({}) => [{}, {}] -bar({}) => [1, {}] +foo({}) #=> [{}, {}] +bar({}) #=> [1, {}] -bar({}, **{}) => expected: [{}, {}], actual: [1, {}] +bar({}, **{}) #=> 期待は: [{}, {}]だが実際はl: [1, {}] {% endhighlight %} -In Ruby 2, `foo({})` passes an empty hash as a normal argument (i.e., `{}` is assigned to `x`), while `bar({})` passes a keyword argument (i.e, `{}` is assigned to `kwargs`). So `any_method({})` is very ambiguous. +Ruby 2の場合、`foo({})`は空のハッシュを通常の引数として1つ渡しますが(`x`に`{}`が代入されるなど)、`bar({})`はキーワード引数を1つ渡します(`kwargs`に`{}`が代入されるなど)。つまり、`any_method({})`は極めてあいまいになります。 -You may think of `bar({}, **{})` to pass the empty hash to `x` explicitly. Surprisingly, it does not work as you expected; it still prints `[1, {}]` in Ruby 2.6. This is because `**{}` is ignored by the parser in Ruby 2.6, and the first argument `{}` is automatically converted to keywords (`**kwargs`). In this case, you need to call `bar({}, {})`, which is very weird. +「`bar({}, **{})`は`x`に明示的に空のハッシュを渡すのでは?」と考える人もいるかもしれませんが、驚いたことに、この期待は裏切られます。Ruby 2.6では`[1, {}]`が出力されるのです。理由は、`**{}`がRuby 2.6のパーサーで無視されるのと、1番目の引数`{}`が自動的にキーワード引数(`**kwargs`)に変換されるためです。この場合`bar({}, {})`という形で呼び出す必要がありますが、これではあまりに見苦しくなります。 -The same issues also apply to methods that accept rest and keyword arguments. This makes explicit delegation of keyword arguments not work. +同じ問題は、残りの引数とキーワード引数を受け取るメソッドにも当てはまります。そのせいで、以下のようなキーワード引数の明示的な委譲は動作しません。 {% highlight ruby %} def target(*args) @@ -338,18 +341,18 @@ def foo(*args, **kwargs, &block) target(*args, **kwargs, &block) end -foo() #=> Ruby 2.6 or before: [{}] - #=> Ruby 2.7 or later: [] +foo() #=> Ruby 2.6以前: [{}] + #=> Ruby 2.7以降: [] {% endhighlight %} -`foo()` passes no arguments, but `target` receives an empty hash argument in Ruby 2.6. This is because the method `foo` delegates keywords (`**kwargs`) explicitly. When `foo()` is called, `args` is an empty Array, `kwargs` is an empty Hash, and `block` is `nil`. And then `target(*args, **kwargs, &block)` passes an empty Hash as an argument because `**kwargs` is automatically converted to a positional Hash argument. +`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになります。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 -The automatic conversion not only confuses people but also makes the method less extensible. See [[Feature #14183]](https://bugs.ruby-lang.org/issues/14183) for more details about the reasons for the change in behavior, and why certain implementation choices were made. +自動変換は開発者を混乱させるのみならず、メソッドの拡張性も弱めてしまいます。振る舞いが変更された理由や、特定の実装が選択された理由について詳しくは[Feature #14183](https://bugs.ruby-lang.org/issues/14183)をご覧ください。 -## Acknowledgment +## 謝辞 -This article was kindly reviewed (or even co-authored) by Jeremy Evans and Benoit Daloze. +本記事はJeremy EvansとBenoit Dalozeによる丁寧なレビュー(共著と言ってもよいくらいです)をいただきました。 -## History +## 更新履歴 -* Updated 2019-12-25: In 2.7.0-rc2, the warning message was slightly changed, and an API to suppress the warnings was added. +* 更新 2019-12-25: 2.7.0-rc2でwarningメッセージが若干変更され、warning抑制APIが追加された。 From c82970710444b36e5baf1f6315b388d809062b1a Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Thu, 30 Jan 2020 16:49:40 +0900 Subject: [PATCH 2165/3171] Fix untranslated lines --- ...ation-of-positional-and-keyword-arguments-in-ruby-3-0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 5e80e231d5..b9aec21a12 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -1,6 +1,6 @@ --- layout: news_post -title: "Separation of positional and keyword arguments in Ruby 3.0" +title: "Ruby 3.0における位置引数とキーワード引数の分離について" author: "mame" translator: "hachi8833" date: 2019-12-12 12:00:00 +0000 @@ -13,8 +13,8 @@ lang: ja Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 -* `Using the last argument as keyword parameters is deprecated`, or -* `Passing the keyword argument as the last hash parameter is deprecated`, or +* `Using the last argument as keyword parameters is deprecated` +* `Passing the keyword argument as the last hash parameter is deprecated` * `Splitting the last argument into positional and keyword parameters is deprecated` この非互換性は、double splat演算子(`**`)を追加することでほぼ回避できます。これにより、`Hash`オブジェクトではなくキーワード引数を渡すことが明示的に指定されます。同様に、キーワード引数ではなく`Hash`オブジェクトを明示的に渡したい場合は中かっこ(`{}`)を追加できます。詳しくは後述の「典型的なケース」をご覧ください。 From db32bd844eff125ad3ddd8e47a6ee8285f3c57b1 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Sat, 27 Nov 2021 00:48:28 +0900 Subject: [PATCH 2166/3171] Revised the points pointed out in the review. --- ...ional-and-keyword-arguments-in-ruby-3-0.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index b9aec21a12..38c2aea1c9 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -11,7 +11,9 @@ lang: ja ## 概要 -Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 +この文書では便宜上、必須引数、オプション引数、rest引数、後置引数(つまり、キーワード引数とブロック引数以外の引数)をまとめて「位置引数」と呼びます。 + +Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7で警告を表示します。以下のいずれかの警告が表示される場合は、コードのアップデートが必要です。 * `Using the last argument as keyword parameters is deprecated` * `Passing the keyword argument as the last hash parameter is deprecated` @@ -100,13 +102,13 @@ foo(k: 1) #=> {:k=>1} ## Q: 自分のコードはRuby 2.7で動かなくなりますか? -手短かに言うと「壊れない可能性はあります」。 +A: たぶん動きます。 -Ruby 2.7におけるこの変更は、3.0への移行パスとして設計されています。あくまで原則としてですが、Ruby 2.7ではRuby 3.0で変更される振る舞いについてwarningを出すにとどめており、warningの中には私たちが微細とみなしている変更点も若干含まれます。詳しくは後述の「その他の微細な変更点」をご覧ください。 +Ruby 2.7では、原則として、Ruby 3.0で変更される振る舞いについて警告を出すにとどめています。しかし、私たちが軽微とみなした非互換も少しだけ入っています。詳しくは後述の「その他の軽微な変更点」をご覧ください。 -Ruby 2.7では、warningが表示される点と微細な変更点以外を除いてRuby 2.6との互換性を保とうとしています。つまり、あなたのコードはRuby 2.7でもおそらく動作しますが、warningが表示される可能性はあります。あなたのコードをRuby 2.7で実行すれば、Ruby 3.0の準備ができているかどうかをチェックできます。 +Ruby 2.7では、警告が表示される点と軽微な変更点以外を除いてRuby 2.6との互換性を保とうとしています。つまり、あなたのコードはRuby 2.7でもおそらく動作しますが、警告が表示される可能性はあります。あなたのコードをRuby 2.7で実行すれば、Ruby 3.0の準備ができているかどうかをチェックできます。 -非推奨のwarningを無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 +非推奨の警告を無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 ## 引数の委譲の扱いについて @@ -162,7 +164,7 @@ ruby2_keywords def foo(*args, &block) end {% endhighlight %} -残念ながら、Ruby 2.6以前では新しい委譲スタイルを正しく扱えないため、旧来の委譲スタイル(`**kwargs`を使わないなど)を使う必要があります。これは、キーワード引数を分離した理由のひとつでもあります(詳しくは本記事末尾をご覧ください)。`ruby2_keywords`を用いれば、Ruby 2.7や3.0でも旧来の委譲スタイルを引き続き利用できます。2.6以前のRubyでは`ruby2_keywords`が定義されていないので、[ruby2_keywords](https://rubygems.org/gems/ruby2_keywords) gemを使うか、以下を手動で定義します。 +残念ながら、Ruby 2.6以前では新しい委譲スタイルを正しく扱えないため、旧来の委譲スタイル(つまり、**kwargsを受け渡ししないスタイル)を使う必要があります。これは、キーワード引数を分離した理由のひとつでもあります(詳しくは本記事末尾をご覧ください)。`ruby2_keywords`を用いれば、Ruby 2.7や3.0でも旧来の委譲スタイルを引き続き利用できます。2.6以前のRubyでは`ruby2_keywords`が定義されていないので、[ruby2_keywords](https://rubygems.org/gems/ruby2_keywords) gemを使うか、以下を手動で定義します。 {% highlight ruby %} def ruby2_keywords(*) @@ -186,15 +188,15 @@ foo({}) #=> Ruby 2.7: [] ({}を含んでいない) foo({}, **{}) #=> Ruby 2.7: [{}] ({}を渡せば、キーワード引数が「ない」ことを明示できる) {% endhighlight %} -上のコードでは、空のHash引数が自動的に変換されて`**kwargs`に吸い込まれ、この空のキーワードハッシュは委譲の呼び出しで削除されます。このため、`targe`には引数がまったく渡されなくなります。私たちが把握している範囲では、これが唯一のエッジケースです。 +上のコードでは、空のHash引数が自動的に変換されて`**kwargs`に吸い込まれ、この空のキーワードハッシュは委譲の呼び出しで削除されます。このため、`target`には引数がまったく渡されなくなります。私たちが把握している範囲では、これが唯一のエッジケースです。 上のコードの最下部に書いたように、`**{}`を渡すことでこの問題を回避できます。 -移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6が役目を終えたときに削除される可能性があります。現時点で私たちがおすすめできるのは、キーワード引数を明示的に委譲することです(上述のRuby 3向けのコードを参照)。 +移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6がサポート切れになったあとで削除される可能性があります。そのときになったら、キーワード引数を明示的に委譲することをおすすめします(上述のRuby 3向けのコードを参照)。 -## その他の微細な変更点 +## その他の軽微な変更点 -Ruby 2.7のキーワード引数では、この他に以下の3つのマイナーチェンジが行われています。 +Ruby 2.7のキーワード引数では、この他に以下の3つの軽微な変更が行われています。 ### 1\. キーワード引数で非シンボルキーを利用できるようになった @@ -256,7 +258,7 @@ foo(**empty_hash) なお、`foo(**{})`はRuby 2.6以前とRuby 2.7のどちらの場合も引数を渡さず、`**{}`がパーサーによって削除される点にご注意ください。また、Ruby 2.7以降ではどちらも`**empty_hash`として同じに扱われるので、メソッドにキーワード引数を渡さないようにする指定が楽に行なえます。 -Ruby 2.7では、あるメソッド呼び出しで必須とされる位置引数の個数が不足している場合、Ruby 2.6との互換性を保つために`foo(**empty_hash)`は空のハッシュを渡してwarningを表示します。この振る舞いはRuby 3.0で廃止されます。 +Ruby 2.7では、あるメソッド呼び出しで必須とされる位置引数の個数が不足している場合、Ruby 2.6との互換性を保つために`foo(**empty_hash)`は空のハッシュを渡して警告を表示します。この振る舞いはRuby 3.0で廃止されます。 {% highlight ruby %} def foo(x) @@ -273,7 +275,7 @@ foo(**empty_hash) ### 3\. キーワード引数を受け取らないことを表す構文(`**nil`)が導入される -メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、事実上新機能です)。 +メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、新機能です)。 {% highlight ruby %} def foo(*args, **nil) @@ -283,7 +285,7 @@ foo(k: 1) #=> Ruby 2.7以降: no keywords accepted (ArgumentError) {% endhighlight %} -この新構文は、メソッドがキーワード引数を受け取らないことを明示的に指定するのに有用です。これを使わない場合、キーワード引数は上述の例の他の引数に吸い込まれます。メソッドを拡張してキーワード引数を受け取るようにする場合、以下のような非互換性が発生する可能性があります。 +この新構文は、メソッドがキーワード引数を受け取らないことを明示的に指定するのに有用です。これを使わない場合、キーワード引数は上述の例のrest引数に吸い込まれます。メソッドを拡張してキーワード引数を受け取るようにする場合、以下のような非互換性が発生する可能性があります。 {% highlight ruby %} # メソッドは残りの引数を受け取るが、`**nil`はない状態 @@ -307,7 +309,7 @@ foo(k: 1) #=> ArgumentError: unknown keyword k 当初、自動変換はうまいアイデアに思われていて、多くの場合問題なく機能していました。しかし、エッジケースがあまりにも多く、これまでこの振る舞いに関するバグレポートを山のように受け取りました。 -自動変換は、オプションの位置引数とキーワード引数をどちらも受け取るメソッドではうまく動きません。末尾のHashオブジェクトを位置引数として扱うことを期待する人々もいれば、末尾のHashオブジェクトをキーワード引数として扱うことを期待する人々もいました。 +自動変換は、オプション引数とキーワード引数をどちらも受け取るメソッドではうまく動きません。末尾のHashオブジェクトを位置引数として扱うことを期待する人々もいれば、末尾のHashオブジェクトをキーワード引数として扱うことを期待する人々もいました。 最も混乱を呼ぶケースのひとつを以下に示します。 @@ -345,7 +347,7 @@ foo() #=> Ruby 2.6以前: [{}] #=> Ruby 2.7以降: [] {% endhighlight %} -`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになります。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 +`foo()`には引数がありませんが、Ruby 2.6では空のハッシュ引数が`target`に渡されます。理由は、メソッド`foo`が明示的にキーワード(`**kwargs`)を委譲しているためです。`foo()`が呼び出されると、`args`は空のArrayになり、`kwargs`は空のHashになり、blockはnilになります。。そして`target(*args, **kwargs, &block)`は空のHashを引数として1つ渡します。理由は、`**kwargs`が自動的にHash位置引数に変換されるためです。 自動変換は開発者を混乱させるのみならず、メソッドの拡張性も弱めてしまいます。振る舞いが変更された理由や、特定の実装が選択された理由について詳しくは[Feature #14183](https://bugs.ruby-lang.org/issues/14183)をご覧ください。 @@ -355,4 +357,4 @@ foo() #=> Ruby 2.6以前: [{}] ## 更新履歴 -* 更新 2019-12-25: 2.7.0-rc2でwarningメッセージが若干変更され、warning抑制APIが追加された。 +* 更新 2019-12-25: 2.7.0-rc2で警告メッセージが若干変更され、警告抑制APIが追加された。 From a5f8fdd3ea5cd14267b1d9cc7efc3d208447de8a Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Wed, 22 Jan 2020 12:35:17 +0900 Subject: [PATCH 2167/3171] Add en doc --- ...separation-of-positional-and-keyword-arguments-in-ruby-3-0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 38c2aea1c9..505003747d 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -174,6 +174,7 @@ end if RUBY_VERSION < "2.7" * * * * * 自分のコードがRuby 2.6以前で動かなくても構わないのであれば、Ruby 2.7で新しいスタイルを試してもよいでしょう。ほぼほぼ間違いなく動作しますが、以下のようなエッジケースを運悪く踏むこともあります。 +--- {% highlight ruby %} def target(*args) From bdd3514fe2b0a6a4e52ae311b93d39f462f9ac87 Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Wed, 22 Jan 2020 12:35:47 +0900 Subject: [PATCH 2168/3171] Translate "Separation of positional and keyword arguments in Ruby 3.0" --- ...paration-of-positional-and-keyword-arguments-in-ruby-3-0.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 505003747d..234c6671db 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -13,6 +13,8 @@ lang: ja この文書では便宜上、必須引数、オプション引数、rest引数、後置引数(つまり、キーワード引数とブロック引数以外の引数)をまとめて「位置引数」と呼びます。 +Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 + Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7で警告を表示します。以下のいずれかの警告が表示される場合は、コードのアップデートが必要です。 * `Using the last argument as keyword parameters is deprecated` @@ -174,7 +176,6 @@ end if RUBY_VERSION < "2.7" * * * * * 自分のコードがRuby 2.6以前で動かなくても構わないのであれば、Ruby 2.7で新しいスタイルを試してもよいでしょう。ほぼほぼ間違いなく動作しますが、以下のようなエッジケースを運悪く踏むこともあります。 ---- {% highlight ruby %} def target(*args) From d1d39723a179d9f0e97329bb48786981c8147c54 Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Thu, 30 Jan 2020 16:49:40 +0900 Subject: [PATCH 2169/3171] Fix untranslated lines --- ...eparation-of-positional-and-keyword-arguments-in-ruby-3-0.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 234c6671db..38c2aea1c9 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -13,8 +13,6 @@ lang: ja この文書では便宜上、必須引数、オプション引数、rest引数、後置引数(つまり、キーワード引数とブロック引数以外の引数)をまとめて「位置引数」と呼びます。 -Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7でwarningを表示します。以下のいずれかのwarningが表示される場合は、コードのアップデートが必要です。 - Ruby 3.0では、位置引数とキーワード引数が分離されます。Ruby 3.0で変更される振る舞いはRuby 2.7で警告を表示します。以下のいずれかの警告が表示される場合は、コードのアップデートが必要です。 * `Using the last argument as keyword parameters is deprecated` From 8b1e350ead504e7d804b7b44dfa2669cd56e2fab Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Mon, 29 Nov 2021 10:40:13 +0900 Subject: [PATCH 2170/3171] Added some changes that we consider to minor. --- ...ositional-and-keyword-arguments-in-ruby-3-0.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md index 38c2aea1c9..ac24a4a40e 100644 --- a/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md +++ b/ja/news/_posts/2019-12-12-separation-of-positional-and-keyword-arguments-in-ruby-3-0.md @@ -24,6 +24,7 @@ Ruby 3.0では、位置引数とキーワード引数が分離されます。Rub Ruby 3では、すべての引数を委譲するメソッドで、位置引数の他に必ずキーワード引数も明示的に委譲しなければなりません。Ruby 2.7以前の委譲の振る舞いを変えたくない場合は、`ruby2_keywords`をお使いください。詳しくは後述の「引数の委譲の扱いについて」をご覧ください。 ## よくあるケース +{: #typical-cases } 以下はもっともよくあるケースです。Hashではなくキーワードを渡すのにdouble splat演算子(`**`)を使えます。 @@ -69,6 +70,7 @@ bar({ k: 42 }) # => {:k=>42} {% endhighlight %} ## どの動作が非推奨になるか +{: #what-is-deprecated } Ruby 2では、キーワード引数が末尾のハッシュ位置引数として扱われることがあります。また、末尾のハッシュ引数がキーワード引数として扱われることもあります。 @@ -101,6 +103,7 @@ foo(k: 1) #=> {:k=>1} {% endhighlight %} ## Q: 自分のコードはRuby 2.7で動かなくなりますか? +{: #break-on-ruby-2-7 } A: たぶん動きます。 @@ -111,8 +114,10 @@ Ruby 2.7では、警告が表示される点と軽微な変更点以外を除い 非推奨の警告を無効にしたい場合は、コマンドライン引数`-W:no-deprecated`を使うか、コードに`Warning[:deprecated] = false`を追加します。 ## 引数の委譲の扱いについて +{: #delegation } ### Ruby 2.6以前の場合 +{: #delegation-ruby-2-6-or-prior } Ruby 2では、以下のように1個の`*rest`引数と1個の`&block`引数を受け付けて、この2つの引数を委譲先メソッド(以下の`target`)に渡すことで委譲メソッドを書けます。この振る舞いでは、(1つ以上の)キーワード引数も「位置引数<=>キーワード引数の自動変換」によって暗黙的に扱われます。 @@ -123,6 +128,7 @@ end {% endhighlight %} ### Ruby 3の場合 +{: #delegation-ruby-3 } 以下のようにキーワード引数を明示的に委譲する必要があります。 @@ -141,6 +147,7 @@ end {% endhighlight %} ### Ruby 2.7の場合 +{: #delegation-ruby-2-7 } 手短かに言うと、以下のように`Module#ruby2_keywords`を用い、`*args, &block`を委譲します。 @@ -155,6 +162,7 @@ end 実際、Ruby 2.7では多くの場面でこの新しい委譲のスタイルを利用できます。ただし1つ既知のエッジケースがあります。次をご覧ください。 ### Ruby 2.6 / 2.7 / 3で互換性のある委譲スタイル +{: #a-compatible-delegation } 手短かに言うと、ここも「`Module#ruby2_keywords`を使う」となります。 @@ -171,7 +179,7 @@ def ruby2_keywords(*) end if RUBY_VERSION < "2.7" {% endhighlight %} -* * * * * +--- 自分のコードがRuby 2.6以前で動かなくても構わないのであれば、Ruby 2.7で新しいスタイルを試してもよいでしょう。ほぼほぼ間違いなく動作しますが、以下のようなエッジケースを運悪く踏むこともあります。 @@ -195,10 +203,12 @@ foo({}, **{}) #=> Ruby 2.7: [{}] ({}を渡せば、キーワード引数が「 移植性がどうしても不安な場合は`ruby2_keywords`をお使いください(Ruby 2.6以前ではキーワード引数周りで膨大なエッジケースが存在していることを知っておいてください)。`ruby2_keywords`は、今後Ruby 2.6がサポート切れになったあとで削除される可能性があります。そのときになったら、キーワード引数を明示的に委譲することをおすすめします(上述のRuby 3向けのコードを参照)。 ## その他の軽微な変更点 +{: #other-minor-changes } Ruby 2.7のキーワード引数では、この他に以下の3つの軽微な変更が行われています。 ### 1\. キーワード引数で非シンボルキーを利用できるようになった +{: #other-minor-changes-non-symbol-keys } Ruby 2.6以前のキーワード引数では、シンボル形式のキーしか利用できませんでした。Ruby 2.7のキーワード引数では、以下のようにシンボル形式でないキーを利用できるようになります。 @@ -242,6 +252,7 @@ bar("key" => 42, :sym => 43) {% endhighlight %} ### 2\. double splatを付けた空ハッシュ(`**{}`)で引数を渡さないようになった +{: #other-minor-changes-empty-hash } Ruby 2.6以前は、`**empty_hash`を渡すと位置引数に空のハッシュが渡されました(`[{}]`)。Ruby 2.7以降では引数を渡さなくなります。 @@ -274,6 +285,7 @@ foo(**empty_hash) {% endhighlight %} ### 3\. キーワード引数を受け取らないことを表す構文(`**nil`)が導入される +{: #other-minor-changes-double-splat-nil } メソッド定義で`**nil`を用いることで、そのメソッドがキーワード引数を受け取らないことを明示的に示せるようになります。このメソッドを呼び出すときにキーワード引数を渡すと`ArgumentError`が表示されます(これは非互換性ではなく、新機能です)。 @@ -306,6 +318,7 @@ foo(k: 1) #=> ArgumentError: unknown keyword k {% endhighlight %} ## 自動変換を非推奨に変える理由 +{: #why-deprecated } 当初、自動変換はうまいアイデアに思われていて、多くの場合問題なく機能していました。しかし、エッジケースがあまりにも多く、これまでこの振る舞いに関するバグレポートを山のように受け取りました。 From 43feb73e0af06667ddbb9a695972fe019fc00a57 Mon Sep 17 00:00:00 2001 From: Andrias Meisyal Date: Sat, 27 Nov 2021 21:07:05 +0700 Subject: [PATCH 2171/3171] Translate CVE-2021-31810: Trusting FTP PASV responses vulnerability in Net::FTP (id) --- ...7-07-trusting-pasv-responses-in-net-ftp.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 id/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md diff --git a/id/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md b/id/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md new file mode 100644 index 0000000000..6dad71eca8 --- /dev/null +++ b/id/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md @@ -0,0 +1,40 @@ +--- +layout: news_post +title: "CVE-2021-31810: Kerentanan respons FTP PASV yang dipercaya pada Net::FTP" +author: "shugo" +translator: "meisyal" +date: 2021-07-07 09:00:00 +0000 +tags: security +lang: id +--- + +Sebuah kerentanan respons FTP PASV yang dipercaya telah ditemukan pada Net::FTP. +Kerentanan ini telah ditetapkan dengan penanda CVE +[CVE-2021-31810](https://nvd.nist.gov/vuln/detail/CVE-2021-31810). +Kami sangat merekomendasikan Anda untuk memperbarui Ruby. + +net-ftp adalah sebuah *default gem* pada Ruby 3.0.1, tetapi *gem* tersebut +memiliki masalah pengemasan. Sehingga, mohon perbarui Ruby. + +## Detail + +Sebuah FTP *server* yang berbahaya dapat menggunakan respons PASV untuk +mengelabui Net::FTP dengan menghubungkan kembali ke sebuah alamat IP dan *port* +yang diberikan. Ini berpotensi membuat Net::FTP menguraikan informasi *service* +yang seharusnya privat dan tidak boleh terbuka (contohnya, penyerang melakukan +*port scan* dan *service banner extraction*). + +## Versi Terimbas + +* Rangkaian Ruby 2.6: 2.6.7 dan sebelumnya +* Rangkaian Ruby 2.7: 2.7.3 dan sebelumnya +* Rangkaian Ruby 3.0: 3.0.1 dan sebelumnya + +## Rujukan + +Terima kasih kepada [Alexandr Savca](https://hackerone.com/chinarulezzz) yang +telah melaporkan kerentanan ini. + +## Riwayat + +* Semula dipublikasikan pada 2021-07-07 09:00:00 UTC From 568fbdc9322ab3d5f91c9938af05a890841ead65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Thu, 2 Dec 2021 09:48:22 -0500 Subject: [PATCH 2172/3171] Translation of Ruby 3.1.0-preview1 releases (es) (#2736) --- ...2021-11-09-ruby-3-1-0-preview1-released.md | 259 ++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 es/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md diff --git a/es/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md b/es/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md new file mode 100644 index 0000000000..6bbecd9013 --- /dev/null +++ b/es/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md @@ -0,0 +1,259 @@ +--- +layout: news_post +title: "Publicado Ruby 3.1.0 versión previa 1" +author: "naruse" +translator: vtamara +date: 2021-11-09 00:00:00 +0000 +lang: es +--- + +Nos complace anunciar la publicación de Ruby {{ release.version }}. + +{% assign release = site.data.releases | where: "version", "3.1.0-preview1" | first %} + + +## YJIT: Nuevo compilador experimental JIT en-proceso + +Ruby 3.1 incorpora YJIT, un nuevo compilador JIT en-proceso desarrollado +por Shopify. + +Desde que [Ruby 2.6 introdujo MJIT en 2018](https://www.ruby-lang.org/es/news/2018/12/25/ruby-2-6-0-released/), +su desempeño ha mejorado significativamente, y finalmente +[alcanzamos Ruby3x3 el año pasado](https://www.ruby-lang.org/es/news/2020/12/25/ruby-3-0-0-released/). +Pero aún cuando Optcarrot ha demostrado un impresionante aumento de velocidad, +el JIT no ha beneficiado aplicaciones de negocios del mundo real. + +Recientemente Shopify contribuyó muchas mejoras a Ruby para aumentar la +velocidad de su aplicación Rails. +YJIT es una contribución importante y busca mejorar el desempeño de +aplicaciones rails. + +Mientras MJIT es un compilador JIT basado-en-métodos y usa un +compilador de C externo, YJIT usa Versiones de Bloques Básicos e +incluye un compilador JIT. Con Versiones de Bloques Básicos Perezosa +(Lazy Basic Block Versioning - LBBV), que primero compilan el comienzo de +un método e incrementalmente compila el resto a medida que el tipo de +los argumentos y variables se determina dinámicamente. Ver una introducción +detallada en +[YJIT: a basic block versioning JIT compiler for CRuby](https://dl.acm.org/doi/10.1145/3486606.3486781). + +Con esta tecnología, YJIT alcanza tanto un tiempo de calentamiento rápido como +mejoras en desempeño en la mayoría de software del mundo-real, hasta +22% en railsbench, 39% en liquid-render. + + + +YJIT es aún una características experimental, y como tal, +está deshabilitado de manera predeterminada. Si quiere usarlo, +especifique la opción `--yjit` en la línea de ordenes que habilita +YJIT. Por ahora está limitado a macOS & Linux sobre plataformas +x86-64. + +* https://bugs.ruby-lang.org/issues/18229 +* https://shopify.engineering/yjit-just-in-time-compiler-cruby +* https://www.youtube.com/watch?v=PBVLf3yfMs8 + +## Gema debug: Un nuevo depurador + +Se incluye un nuevo depurador [debug.gem](https://github.com/ruby/debug). +debug.gem es una implementación de un depurador rápido que provee muchas +características tales como depuración remota, REPL con colores, integración +con IDE (VSCode) entre otras. +Remplaza la librería estándar `lib/debug.rb`. + +## error_highlight: Localización de errores afinada en las trazas + +Se ha incluido un gema con Ruby, error_highlight. Proporciona +localización afinada de errores en la traza: + +``` +$ ruby prueba.rb +prueba.rb:1:in `
': undefined method `time' for 1:Integer (NoMethodError) + +1.time {} + ^^^^^ +Did you mean? times +``` + +Esta gema está habilitada de manera predeterminada. Puede deshabilitarla +desde la línea de ordenes con la opción `--disable-error_highlight`. +Ver detalles en [el repositorio](https://github.com/ruby/error_highlight). + +## Mejoras a Irb + +Se describirán en la siguiente versión previa. + +## Otras características nuevas y notables + +### Lenguaje + +* Pueden omitirse valores en literales de diccionarios y en argumentos de + palabra reservada [Feature #14579] + * `{x:, y:}` es azúcar sintáctica para `{x: x, y: y}`. + * `foo(x:, y:)` es azúcar sintáctica para `foo(x: x, y: y)`. + +* En reconocimiento de patrones el operador pin ahora toma una + expresión [Feature #17411] + +```ruby +Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a +#=> [[3, 5], [5, 7], [11, 13]] +``` + + +### RBS + +RBS es un lenguaje para describir la estructura de programas Ruby. +Ver detalles en [el repositorio](https://github.com/ruby/rbs). + +Actualizaciones desde Ruby 3.0.0: + +* se introduce `rbs collection` para administrar RBSs de gemas. + [doc](https://github.com/ruby/rbs/blob/master/docs/collection.md) +* Se han añadido/actualizado muchas características incorporadas y de + la librería estándar. +* Incluye soluciones a muchas fallas, así como mejoras de desempeño. + +Ver más informaciń en [el archivo CHANGELOG.md](https://github.com/ruby/rbs/blob/master/CHANGELOG.md). + +### TypeProf + +TypeProf es un analizador de tipos estático para Ruby. Genera un prototipo +en RBS a partir de código Ruby sin anotaciones de tipos. Ver detalles en +[el documento](https://github.com/ruby/typeprof/blob/master/doc/doc.md). + +Actualizaciones desde Ruby 3.0.0: + +* Se ha implementado [soporte experimental para IDE](https://github.com/ruby/typeprof/blob/master/doc/ide.md). +* Muchas correcciones a fallas y mejoras de desempeño. + +## Mejoras de desempeño + +* MJIT + * Para cargas de trabajo como Rails, se cambia `--jit-max-cache` de 100 + a 10000. + El compilador JIT ya no se salta la compilación de métodos con menos de + 1000 instrucciones. + * Para soportar Zeitwerk de Rails, el código compilado con JIT ya no + se cancela cuando se habilita un TracePoint para eventos de clase. + +## Otros cambios notables desde 3.0 + +* Reconocimiento de patrones en una línea, e.g., `ary => [x, y, z]`, ya no es + experimental. +* Se ha cambiado levemente el orden de evaluación de asignaciones múltiples. + [[Bug #4443]] + * `foo[0], bar[0] = baz, qux` era evaluado en el orden `baz`, `qux`, `foo`, + y después `bar` en Ruby 3.0. En Ruby 3.1, se evalúa en el orden + `foo`, `bar`, `baz`, y después `qux`. +* Localización de ancho variable: Cadenas (experimental) + [[Falla #18239]](https://bugs.ruby-lang.org/issues/18239) + +### Actualizaciones a la librería estándar + +* Se actualizaron algunas librerías estándar + * RubyGems + * Bundler + * RDoc 6.4.0 + * ReLine + * JSON 2.6.0 + * Psych 4.0.2 + * FileUtils 1.6.0 + * Fiddle + * StringIO 3.0.1 + * IO::Console 0.5.9 + * IO::Wait 0.2.0 + * CSV + * Etc 1.3.0 + * Date 3.2.0 + * Zlib 2.1.1 + * StringScanner + * IpAddr + * Logger 1.4.4 + * OStruct 0.5.0 + * Irb + * Racc 1.6.0 + * Delegate 0.2.0 + * Benchmark 0.2.0 + * CGI 0.3.0 + * Readline(C-ext) 0.1.3 + * Timeout 0.2.0 + * YAML 0.2.0 + * URI 0.11.0 + * OpenSSL + * DidYouMean + * Weakref 0.1.1 + * Tempfile 0.1.2 + * TmpDir 0.1.2 + * English 0.7.1 + * Net::Protocol 0.1.2 + * Net::Http 0.2.0 + * BigDecimal + * OptionParser 0.2.0 + * Set + * Find 0.1.1 + * Rinda 0.1.1 + * Erb + * NKF 0.1.1 + * Base64 0.1.1 + * OpenUri 0.2.0 + * SecureRandom 0.1.1 + * Resolv 0.2.1 + * Resolv::Replace 0.1.0 + * Time 0.2.0 + * PP 0.2.1 + * Prettyprint 0.1.1 + * Drb 2.1.0 + * Pathname 0.2.0 + * Digest 3.1.0.pre2 + * Un 0.2.0 +* Se actualizaron las siguientes gemas incluidas en Ruby + * minitest 5.14.4 + * power_assert 2.0.1 + * rake 13.0.6 + * test-unit 3.5.0 + * rbs 1.6.2 + * typeprof 0.20.0 +* Las siguientes gemas por omisión ahora son ahora gemas incluidas en Ruby. + * net-ftp + * net-imap + * net-pop + * net-smtp + * matrix + * prime + +Ver más detalles en +[NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md) +o [en la bitácora de cambios](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}). + +Con esos cambios, [{{ release.stats.files_changed }} archivos cambiados, {{ release.stats.insertions }} inserciones(+), {{ release.stats.deletions }} eliminaciones (-)](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}#file_bucket) +desde Ruby 3.0.0! + +## Descargas + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Qué es Ruby + +Ruby fue desarrollado inicialmente pof Matz (Yukihiro Matsumoto) en 1993, +y ahora es desarrollado como Código Abierto. Corre en múltiples +plataformas y se usa en todo el mundo especialmente para desarrollo web. From 8582d2af9bc328a6d90d11b44daaf48e169f18ed Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 14:40:51 +0900 Subject: [PATCH 2173/3171] Japanese translation of "CVE-2021-31810: Trusting FTP PASV responses vulnerability in Net::FTP" Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md) to ja. --- ...7-07-trusting-pasv-responses-in-net-ftp.md | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 ja/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md diff --git a/ja/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md b/ja/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md new file mode 100644 index 0000000000..6e122de845 --- /dev/null +++ b/ja/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md @@ -0,0 +1,35 @@ +--- +layout: news_post +title: "CVE-2021-31810: Net::FTP における信頼性のある FTP PASV 応答の脆弱性について" +author: "shugo" +translator: "jinroq" +date: 2021-07-07 09:00:00 +0000 +tags: security +lang: ja +--- + +信頼性のある FTP PASV 応答の脆弱性が Net::FTP で発見されました。 +この脆弱性は [CVE-2021-31810](https://nvd.nist.gov/vuln/detail/CVE-2021-31810) として登録されています。 +Ruby をアップグレードすることを強く推奨します。 + +net-ftp は Ruby 3.0.1 の デフォルト gem ですが、パッケージ化の問題があるため、Ruby 自体をアップグレードしてください。 + +## 詳細 + +悪意のある FTP サーバーが、PASV 応答を利用して Net::FTP を偽装し、特定の IP アドレスとポートに接続し直す可能性があります。 +これにより Net::FTP は本来では抽出できない非公開なサービスに関する情報を抽出する可能性があります +(例: 攻撃者はポートスキャンやサービスバナーの抽出を実行できます)。 + +## 影響を受けるバージョン + +* Ruby 2.6 系列: 2.6.7 およびそれ以前のバージョン +* Ruby 2.7 系列: 2.7.3 およびそれ以前のバージョン +* Ruby 3.0 系列: 3.0.1 およびそれ以前のバージョン + +## クレジット + +この脆弱性情報は、[Alexandr Savca](https://hackerone.com/chinarulezzz) 氏によって報告されました。 + +## 更新履歴 + +* 2021-07-07 18:00:00 (JST) 初版 From 85b21c3e53f54cef7d0b7f8f156c0f708c950bb4 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Thu, 25 Nov 2021 17:52:06 +0900 Subject: [PATCH 2174/3171] Japanese translation of "CVE-2021-41816: Buffer Overrun in CGI.escape_html" Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md) to ja. --- ...errun-in-cgi-escape_html-cve-2021-41816.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ja/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md diff --git a/ja/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md b/ja/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md new file mode 100644 index 0000000000..b6712c7c3f --- /dev/null +++ b/ja/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md @@ -0,0 +1,39 @@ +--- +layout: news_post +title: "CVE-2021-41816: CGI.escape_html 内のバッファオーバーラン" +author: "mame" +translator: "jinroq" +date: 2021-11-24 12:00:00 +0000 +tags: security +lang: ja +--- + +A buffer overrun vulnerability was discovered in CGI.escape_html. +This vulnerability has been assigned the CVE identifier [CVE-2021-41816](https://nvd.nist.gov/vuln/detail/CVE-2021-41816). +We strongly recommend upgrading Ruby. +CGI.escape_html 内のバッファオーバーランの脆弱性が発見されました。 +この脆弱性は、[CVE-2021-41816](https://nvd.nist.gov/vuln/detail/CVE-2021-41816)として登録されています。 +Ruby をアップグレードすることを強く推奨します。 + +## 詳細 + +`long` 型が 4 バイトかかるプラットフォーム(典型的なものは Windows)で非常に大きな文字列(700 MB 以上)を `CGI.escape_html` に渡すと、バッファオーバーフローを引き起こす脆弱性があります。 + +cgi gem をバージョン 0.3.1, 0.2.1, 0.1.1 もしくはこれら以上のバージョンに更新してください。`gem update cgi` を使用して更新できます。bundler を使用している場合は、 `Gemfile` に `gem "cgi", "> = 0.3.1"` を追加してください。 +または、Rubyを 2.7.5 または 3.0.3 に更新してください。 + +この問題は Ruby 2.7 以降で発見されたので、Ruby 2.6 でバンドルされている cgi バージョンには脆弱性はありません。 + +## 影響を受けるバージョン + +* cgi gem 0.1.0 以前(Ruby 2.7.5 より前にバンドルされている Ruby 2.7 系列) +* cgi gem 0.2.0 以前(Ruby 3.0.3 より前にバンドルされている Ruby 3.0 系列) +* cgi gem 0.3.0 以前 + +## クレジット + +この脆弱性情報は、[chamal](https://hackerone.com/chamal) 氏によって報告されました。 + +## 更新履歴 + +* 2021-11-24 21:00:00 (JST) 初版 From cf989664e27d38c7ed1c38c6548d8a32523721e3 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 12:46:24 +0900 Subject: [PATCH 2175/3171] Japanese translation of "Ruby 3.1.0 Preview 1 Released" Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md) to ja. --- ...2021-11-09-ruby-3-1-0-preview1-released.md | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md diff --git a/ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md b/ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md new file mode 100644 index 0000000000..bcd1ca2733 --- /dev/null +++ b/ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md @@ -0,0 +1,210 @@ +--- +layout: news_post +title: "Ruby 3.1.0 Preview 1 リリース" +author: "naruse" +translator: "jinroq" +date: 2021-11-09 00:00:00 +0000 +lang: ja +--- + +Ruby 3.1 に向けてフィードバックを得るためのリリースである、Ruby 3.1.0-preview1 が公開されました。 + +{% assign release = site.data.releases | where: "version", "3.1.0-preview1" | first %} + +## YJIT: 新しいインプロセス JIT コンパイラ (experimental) + +Ruby 3.1 には、Shopify 社が開発した新しいインプロセス JIT コンパイラである YJIT をマージしています。 + +[2018 年に Ruby 2.6 が MJIT を導入](https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/)して以降、パフォーマンスは大幅に向上し、ついに[昨年 Ruby3x3 を達成しました](https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/)。しかし、この JIT は Optcarrot では目覚ましい速度改善を示したものの、実世界のプロダクトで運用するには厳しいものでした。 + +近年 Shopify 社は Rails アプリケーションを高速化するために Ruby へ多くの改善をしてくれました。その中でも YJIT は重要な貢献であり、また、Rails アプリケーションのパフォーマンス向上を目的としています。 + +MJIT はメソッドベースの JIT コンパイラであり、外部 C コンパイラを使用します。一方、YJIT は Basic Block Versioning を使用し、その中に JIT コンパイラを含みます。 Lazy Basic Block Versioning(LBBV)では、最初にメソッドの先頭をコンパイルし、引数と変数の型が動的に決定されると、残りをインクリメンタルにコンパイルします。詳細な概要については [YJIT: a basic block versioning JIT compiler for CRuby](https://dl.acm.org/doi/10.1145/3486606.3486781) を参照してください。 + +この技術により、YJIT は実世界の多くのプロダクトで高速な起動時間とパフォーマンス向上の両方を実現しています。railsbench 上で 22%、liquid-render 上で 39% の改善を実現しています。 + + + +YJIT はまだ実験的な機能であるため、デフォルトでは無効になっています。使用するにはコマンドラインオプション `--yjit` を指定して YJIT を有効にします。また YJIT が仕様できる環境は、現時点では x86-64 プラットフォーム搭載の macOS および Linux に限定されています。 + +* [https://bugs.ruby-lang.org/issues/18229](https://bugs.ruby-lang.org/issues/18229) +* [https://shopify.engineering/yjit-just-in-time-compiler-cruby](https://shopify.engineering/yjit-just-in-time-compiler-cruby) +* [https://www.youtube.com/watch?v=PBVLf3yfMs8](https://www.youtube.com/watch?v=PBVLf3yfMs8) + +## debug gem: 新しいデバッガ + +新しいデバッガ [debug.gem](https://github.com/ruby/debug) がバンドルされています。 debug.gem は高速なデバッガであり、リモートデバッグ、色付き REPL、IDE integration(VSCode)など多くの機能を提供します。これは標準添付ライブラリの `lib/debug.rb` に置き換えられます。 + +## error_highlight: バックトレース内でさらに詳細なエラー箇所を示す機能 + +組み込み gem である error_highlight が導入されました。バックトレース内でさらに詳細なエラー箇所を示すことができます: + +``` +$ ruby test.rb +test.rb:1:in `
': undefined method `time' for 1:Integer (NoMethodError) + +1.time {} + ^^^^^ +Did you mean? times +``` + +この gem はデフォルトで有効になっています。コマンドラインオプション `--disable-error_highlight` を使用して無効にできます。詳細は[リポジトリ](https://github.com/ruby/error_highlight)を参照してください。 + +## Irb の改善 + +次の preview 版で説明します。 + +## その他の主要な新機能 + +### 言語仕様 + +* ハッシュリテラルとキーワード引数の値は省略できます [Feature #14579] + * `{x:, y:}` は `{x: x, y: y}` の糖衣構文です + * `foo(x:, y:)` は `foo(x: x, y: y)` の糖衣構文です + +* パターンマッチングのピン演算子が式を受け取るようになりました [Feature #17411] + +```ruby +Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a +#=> [[3, 5], [5, 7], [11, 13]] +``` + +### RBS + +RBS は Ruby プログラムの構造を記述するための言語です。詳細は[リポジトリ](https://github.com/ruby/rbs)を参照してください。 + +Ruby 3.0.0 からの変更点: + +* gem の RBS を管理する `rbs collection` が導入されています [[doc]](https://github.com/ruby/rbs/blob/master/docs/collection.md) +* 組み込みライブラリおよび標準添付ライブラリの多くのシグネチャが追加/更新されています +* 多くのバグ修正とパフォーマンスの改善も含まれています + +詳細は [CHANGELOG.md](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) を参照してください。 + +### TypeProf + +TypeProf は Ruby の静的型解析器です。型注釈のない Ruby コードから RBS のプロトタイプを生成します。詳細は[ドキュメント](https://github.com/ruby/typeprof/blob/master/doc/doc.md)を参照してください。 + +Ruby 3.0.0 からの変更点: + +* [IDE サポート](https://github.com/ruby/typeprof/blob/master/doc/ide.md)が実装されました (Experimental) +* 多くのバグ修正とパフォーマンスの改善も含まれています + +## パフォーマンスの改善 + +* MJIT + * Rails のようなワークロードのために、`--jit-max-cache` のデフォルト値を 100 から 10000 に変更しています。 + JIT コンパイラは 1000 命令列長より長いメソッドのコンパイルをスキップしなくなりました + * Rails の Zeitwerk モードをサポートするために、クラスイベントで TracePoint が有効になっている場合に JIT コンパイルされたコードをキャンセルしなくなりました + +## その他の注目すべき 3.0 からの変更点 + +* 1 行パターンマッチ(例: `ary => [x, y, z]`)が experimental ではなくなりました +* 多重代入の評価順序が若干変更されました [[Bug #4443]](https://bugs.ruby-lang.org/issues/4443) + * Ruby 3.0では `foo[0], bar[0] = baz, qux` は `baz`, `qux`,`foo`, `bar` の順に評価されていました。Ruby 3.1 からは `foo`,`bar`, `baz`,`qux` の順に評価されるようになります +* 文字列の可変幅割り当て (experimental) [[Bug #18239]](https://bugs.ruby-lang.org/issues/18239) + +### 標準添付ライブラリの更新 + +* いくつかの標準添付ライブラリが更新されています + * RubyGems + * Bundler + * RDoc 6.4.0 + * ReLine + * JSON 2.6.0 + * Psych 4.0.2 + * FileUtils 1.6.0 + * Fiddle + * StringIO 3.0.1 + * IO::Console 0.5.9 + * IO::Wait 0.2.0 + * CSV + * Etc 1.3.0 + * Date 3.2.0 + * Zlib 2.1.1 + * StringScanner + * IpAddr + * Logger 1.4.4 + * OStruct 0.5.0 + * Irb + * Racc 1.6.0 + * Delegate 0.2.0 + * Benchmark 0.2.0 + * CGI 0.3.0 + * Readline(C-ext) 0.1.3 + * Timeout 0.2.0 + * YAML 0.2.0 + * URI 0.11.0 + * OpenSSL + * DidYouMean + * Weakref 0.1.1 + * Tempfile 0.1.2 + * TmpDir 0.1.2 + * English 0.7.1 + * Net::Protocol 0.1.2 + * Net::Http 0.2.0 + * BigDecimal + * OptionParser 0.2.0 + * Set + * Find 0.1.1 + * Rinda 0.1.1 + * Erb + * NKF 0.1.1 + * Base64 0.1.1 + * OpenUri 0.2.0 + * SecureRandom 0.1.1 + * Resolv 0.2.1 + * Resolv::Replace 0.1.0 + * Time 0.2.0 + * PP 0.2.1 + * Prettyprint 0.1.1 + * Drb 2.1.0 + * Pathname 0.2.0 + * Digest 3.1.0.pre2 + * Un 0.2.0 +* 以下のバンドルされた gems が更新されています + * minitest 5.14.4 + * power_assert 2.0.1 + * rake 13.0.6 + * test-unit 3.5.0 + * rbs 1.6.2 + * typeprof 0.20.0 +* 以下のデフォルト gems がバンドルされた gem になりました + * net-ftp + * net-imap + * net-pop + * net-smtp + * matrix + * prime + +詳細は [NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md) か [commit logs](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}) を参照してください。 + +なお、こうした変更により、Ruby 3.0.0 以降では [{{ release.stats.files_changed }} 個のファイルに変更が加えられ、 {{ release.stats.insertions }} 行の追加と {{ release.stats.deletions }} 行の削除が行われました](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}#file_bucket)! + +## ダウンロード + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Ruby とは + +Ruby はまつもとゆきひろ(Matz)によって 1993 年に開発が始められ、今もオープンソースソフトウェアとして開発が続けられています。 +Ruby は様々なプラットフォームで動き、世界中で、特に Web アプリケーション開発のために使われています。 From cd5d083f793f69db198d73e21f07cc910bcd9d4a Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 21:26:16 +0900 Subject: [PATCH 2176/3171] Fixed a bug Fixed a bug that disturbed `release.version` from being displayed. --- ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md b/ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md index bcd1ca2733..125aed23f2 100644 --- a/ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md +++ b/ja/news/_posts/2021-11-09-ruby-3-1-0-preview1-released.md @@ -7,10 +7,10 @@ date: 2021-11-09 00:00:00 +0000 lang: ja --- -Ruby 3.1 に向けてフィードバックを得るためのリリースである、Ruby 3.1.0-preview1 が公開されました。 - {% assign release = site.data.releases | where: "version", "3.1.0-preview1" | first %} +Ruby 3.1 に向けてフィードバックを得るためのリリースである、Ruby {{ release.version }} が公開されました。 + ## YJIT: 新しいインプロセス JIT コンパイラ (experimental) Ruby 3.1 には、Shopify 社が開発した新しいインプロセス JIT コンパイラである YJIT をマージしています。 From 36bbdaa59d6a658c4bdcf51ab8575e0da8b070fe Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 3 Dec 2021 17:06:26 +0900 Subject: [PATCH 2177/3171] Removed unnecessary English text. --- ...1-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/ja/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md b/ja/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md index b6712c7c3f..6414233097 100644 --- a/ja/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md +++ b/ja/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md @@ -8,9 +8,6 @@ tags: security lang: ja --- -A buffer overrun vulnerability was discovered in CGI.escape_html. -This vulnerability has been assigned the CVE identifier [CVE-2021-41816](https://nvd.nist.gov/vuln/detail/CVE-2021-41816). -We strongly recommend upgrading Ruby. CGI.escape_html 内のバッファオーバーランの脆弱性が発見されました。 この脆弱性は、[CVE-2021-41816](https://nvd.nist.gov/vuln/detail/CVE-2021-41816)として登録されています。 Ruby をアップグレードすることを強く推奨します。 From b9a2cab013eaeac40e2295b92485b2a7b6b0d350 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 15:21:54 +0900 Subject: [PATCH 2178/3171] Translate "CVE-2021-32066: A StartTLS stripping vulnerability in Net::IMAP" (ja) Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md) to ja. --- ...21-07-07-starttls-stripping-in-net-imap.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md diff --git a/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md b/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md new file mode 100644 index 0000000000..6d2f0d0343 --- /dev/null +++ b/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md @@ -0,0 +1,34 @@ +--- +layout: news_post +title: "CVE-2021-32066: Net::IMAP 内の StartTLS ストリッピングの脆弱性について" +author: "shugo" +translator: "jinroq" +date: 2021-07-07 09:00:00 +0000 +tags: security +lang: ja +--- + +Net::IMAP 内の StartTLS ストリッピングに脆弱性が発見されました。 +この脆弱性は [CVE-2021-32066](https://nvd.nist.gov/vuln/detail/CVE-2021-32066) として登録されています。 +Ruby をアップグレードすることを強く推奨します。 + +net-imap は Ruby 3.0.1 の デフォルト gem ですが、パッケージ化の問題があるため、Ruby 自体をアップグレードしてください。 + +## 詳細 + +Net::IMAP は、StartTLS が不明な応答で失敗した場合に例外を発生させません。これにより、中間者攻撃者がクライアントとレジストリ間のネットワークの場所を利用して StartTLS コマンドをブロックできる可能性があります。つまり、中間者攻撃者が TLS 保護をバイパスできる可能性があります。 +これは「StartTLS ストリッピング攻撃」とも呼ばれています。 + +## 影響を受けるバージョン + +* Ruby 2.6 系列: 2.6.7 およびそれ以前のバージョン +* Ruby 2.7 系列: 2.7.3 およびそれ以前のバージョン +* Ruby 3.0 系列: 3.0.1 およびそれ以前のバージョン + +## クレジット + +この脆弱性情報は、[Alexandr Savca](https://hackerone.com/chinarulezzz) 氏によって報告されました。 + +## 更新履歴 + +* 2021-07-07 18:00:00 (JST) 初版 From 0e5e25f8e1e46d121cc14b0936a835696d9db50f Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 16:04:13 +0900 Subject: [PATCH 2179/3171] Translate "CVE-2021-28965: XML round-trip vulnerability in REXML" (ja) Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md) to ja. --- ...p-vulnerability-in-rexml-cve-2021-28965.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md diff --git a/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md b/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md new file mode 100644 index 0000000000..65589d9ebe --- /dev/null +++ b/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md @@ -0,0 +1,47 @@ +--- +layout: news_post +title: "CVE-2021-28965: REXML 内の XML ラウンドトリップの脆弱性について" +author: "mame" +translator: "jinroq" +date: 2021-04-05 12:00:00 +0000 +tags: security +lang: ja +--- + +Ruby にバンドルされている REXML gem 内の XML ラウンドトリップに脆弱性が発見されました。 +この脆弱性は [CVE-2021-28965](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-28965) として登録されています。 +REXML gem をアップグレードすることを強く推奨します。 + +## 詳細 + +加工された XML ドキュメントをパーシングおよびシリアル化する場合、REXML gem(Ruby にバンドルされているものを含む)は、元のドキュメントとは構造が異なる誤った XML ドキュメントを生成する可能性があります。 +この問題の影響はコンテキストによって大きく異なりますが、REXML を使用している一部のプログラムでは脆弱性が生じる可能性があります。 + +REXML gem をバージョン 3.2.5 以降に更新してください。 + +Ruby 2.6 以降を使用している場合: + +* Ruby 2.6.7、2.7.3、もしくは 3.0.1 を使ってください +* または `gem update rexml` で更新することもできます。bundler を使用している場合は、`Gemfile` に `gem "rexml", ">= 3.2.5"` を追加してください + +Ruby 2.5.8 以前を使用している場合: + +* Ruby 2.5.9 を使ってください +* Ruby 2.5.8 以前では `gem update rexml` を実行できません +* Ruby 2.5 系列は現在 EOL であるため、Ruby を 2.6.7 以降に可能な限り早く更新することを検討してください + +## 影響を受けるバージョン + +* Ruby​​ 2.5.8 以前(このバージョンでは `gem update rexml` を実行できません。) +* Ruby​​ 2.6.6 以前 +* Ruby​​ 2.7.2 以前 +* Ruby​​ 3.0.0 +* REXML gem 3.2.4 以前 + +## クレジット + +この脆弱性情報は [Juho Nurminen](https://hackerone.com/jupenur) 氏によって報告されました。 + +## 更新履歴 + +* 2021-04-05 21:00:00 (JST) 初版 From 70f0285ff7ba3b5708f431ef92dab669f939d023 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 16:52:26 +0900 Subject: [PATCH 2180/3171] Translate "CVE-2021-28966: Path traversal in Tempfile on Windows" (ja) Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md) to ja. --- ...ath-traversal-on-windows-cve-2021-28966.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 ja/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md diff --git a/ja/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md b/ja/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md new file mode 100644 index 0000000000..95321df7ee --- /dev/null +++ b/ja/news/_posts/2021-04-05-tempfile-path-traversal-on-windows-cve-2021-28966.md @@ -0,0 +1,36 @@ +--- +layout: news_post +title: "CVE-2021-28966: Windows 版 Tempfile 内のパストラバーサルについて" +author: "mame" +translator: "jinroq" +date: 2021-04-05 12:00:00 +0000 +tags: security +lang: ja +--- + +Windows 版 Ruby にバンドルされている tmpdir ライブラリには、意図しないディレクトリを作成してしまう脆弱性が発見されました。 +また、Windows 版 Ruby にバンドルされている tempfile ライブラリは、内部で tmpdir を使用しているため同様の脆弱性があります。 +この脆弱性は [CVE-2021-28966](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-28966) として登録されています。 + +## 詳細 + +tmpdir ライブラリで導入された `Dir.mktmpdir` メソッドは、第一引数に作成するディレクトリ名のプレフィックスとサフィックスを受け取ることができます。 +プレフィックスには相対ディレクトリ指定子 `"..\\"` を含めることができるため、このメソッドは任意のディレクトリを対象にすることができます。 +したがって、スクリプトが外部入力をプレフィックスとして受け取り、対象のディレクトリに不適切なアクセス許可がある、もしくは、ruby プロセスに不適切な権限がある場合に、攻撃者は任意のディレクトリに対してディレクトリやファイルを作成することができます。 + +同じ脆弱性が [CVE-2018-6914](https://www.ruby-lang.org/en/news/2018/03/28/unintentional-file-and-directory-creation-with-directory-traversal-cve-2018-6914/) として登録されていますが、Windows 版の対応が不十分でした。 + +影響を受けるバージョンの Ruby を利用している全ユーザーは、すぐにアップグレードする必要があります。 + +## 影響を受けるバージョン + +* Ruby 2.7.2 以前 +* Ruby 3.0.0 + +## クレジット + +この脆弱性情報は [Bugdiscloseguys](https://hackerone.com/bugdiscloseguys) 氏によって報告されました。 + +## 更新履歴 + +* 2021-04-05 21:00:00 (JST) 初版 From a6169206b4d5b1cad122b3225396e07ccc1ce542 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Fri, 26 Nov 2021 18:23:23 +0900 Subject: [PATCH 2181/3171] Translate "CVE-2020-25613: Potential HTTP Request Smuggling Vulnerability in WEBrick" (ja) Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2020-09-29-http-request-smuggling-cve-2020-25613.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2020-09-29-http-request-smuggling-cve-2020-25613.md) to ja. --- ...9-http-request-smuggling-cve-2020-25613.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ja/news/_posts/2020-09-29-http-request-smuggling-cve-2020-25613.md diff --git a/ja/news/_posts/2020-09-29-http-request-smuggling-cve-2020-25613.md b/ja/news/_posts/2020-09-29-http-request-smuggling-cve-2020-25613.md new file mode 100644 index 0000000000..bc0fdc11fe --- /dev/null +++ b/ja/news/_posts/2020-09-29-http-request-smuggling-cve-2020-25613.md @@ -0,0 +1,38 @@ +--- +layout: news_post +title: "CVE-2020-25613: WEBrick 内の潜在的な HTTP リクエストスマグリングの脆弱性について " +author: "mame" +translator: "jinroq" +date: 2020-09-29 06:30:00 +0000 +tags: security +lang: ja +--- + +WEBrick 内で潜在的な HTTP リクエストスマグリングの脆弱性が発見されました。 +この脆弱性は [CVE-2020-25613](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-25613) として登録されています。 +webrick gem をアップグレードすることを強く推奨します。 + +## 詳細 + +WEBrick は、無効な Transfer-Encoding ヘッダーに対して寛容すぎました。 +これは WEBrick と一部の HTTP プロキシサーバー間で一貫性のない解釈が発生し、攻撃者が HTTP リクエストを”スマグリング(smuggle)”する可能性があります。 +詳細は [CWE-444](https://cwe.mitre.org/data/definitions/444.html) を参照してください。 + +webric gem を 1.6.1 以降に更新してください。 +`gem update webrick` を実行すれば更新できます。 +bundler を使用している場合は、`Gemfile` に `gem "webrick", ">= 1.6.1"` を追加してください。 + +## 影響を受けるバージョン + +* webrick gem 1.6.0 以前 +* Ruby 2.7.1 以前のバージョンでバンドルされた webrick +* Ruby 2.6.6 以前のバージョンでバンドルされた webrick +* Ruby 2.5.8 以前のバージョンでバンドルされた webrick + +## クレジット + +この脆弱性情報は [piao](https://hackerone.com/piao) 氏によって報告されました。 + +## 更新履歴 + +* 2020-09-29 15:30:00 (JST) 初版 From 0771b94d4a43f2caf6afe0d6b2d6cd8632afb1b4 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Sat, 27 Nov 2021 18:50:14 +0900 Subject: [PATCH 2182/3171] Translate "Dispute of Vulnerability CVE-2014-2734" (ja) Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2014-05-09-dispute-of-vulnerability-cve-2014-2734.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2014-05-09-dispute-of-vulnerability-cve-2014-2734.md) to ja. --- ...-dispute-of-vulnerability-cve-2014-2734.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 ja/news/_posts/2014-05-09-dispute-of-vulnerability-cve-2014-2734.md diff --git a/ja/news/_posts/2014-05-09-dispute-of-vulnerability-cve-2014-2734.md b/ja/news/_posts/2014-05-09-dispute-of-vulnerability-cve-2014-2734.md new file mode 100644 index 0000000000..4fab485093 --- /dev/null +++ b/ja/news/_posts/2014-05-09-dispute-of-vulnerability-cve-2014-2734.md @@ -0,0 +1,75 @@ +--- +layout: news_post +title: "脆弱性 CVE-2014-2734 の争点について" +author: "emboss" +translator: "jinroq" +date: 2014-05-09 05:33:54 +0000 +tags: security +lang: ja +--- + +[CVE-2014-2734](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2734) として登録されている脆弱性について、「Ruby でも起こりうるのではないか」という報告を受けました。 +結論から書くと、以下に記載する詳細な分析の結果、Ruby に脆弱性があるとは**考えていません**。 + +この脆弱性により、攻撃者は証明書の署名を変更して任意のルート証明書を偽造し、証明書のオリジナルの秘密鍵を攻撃者が選択した秘密鍵に都合よく置き換える可能性があります。 + +## コンセプトの実証 + +以下は CVE-2014-2734 の分析です。オリジナルの PoC を縮小させることができました。これはコンセプトの実証の本質を捉えていると考えられます。 + +{% highlight ruby %} +require 'openssl' + +forge_key = OpenSSL::PKey::RSA.new(2048) +raw_certificate = File.read("arbitrary.cer") +cert = OpenSSL::X509::Certificate.new(raw_certificate) +resigned_cert = cert.sign(spoof, OpenSSL::Digest::SHA1.new) + +resigned_cert.verify(key) #=> true +{% endhighlight %} + +`X509Certificate#verify` が `true` を返してくることに驚くかもしれません。 +オリジナルの証明書には `forge_key` の公開鍵とは異なるオリジナルの公開鍵を指す[サブジェクト公開鍵情報](http://tools.ietf.org/html/rfc5280#section-4.1.2.7)が含まれている場合があります。 +証明書の再署名に使用された公開鍵と秘密鍵のペアは、サブジェクト公開鍵情報で参照されているオリジナルの公開鍵と明らかに一致しなくなりました。 +どうして `#verify` は ` true` を返すのでしょうか? + +### 鍵の検証方法 + +`X509Certificate#verify` は OpenSSL の[`X509_verify`](https://github.com/openssl/openssl/blob/master/crypto/x509/x_all.c#L74) 関数を利用しています(内部的には [`ASN1_item_verify`](https://github.com/openssl/openssl/blob/master/crypto/asn1/a_verify.c#L134) 関数を呼び出しています)。 +これらの関数は、提示された公開鍵を指定して署名の有効性を確立します。 +ところが、指定された鍵が証明書で参照されているサブジェクト公開鍵と実際に一致するかどうかは**検証されません**。 +これは、このシナリオでは「`X509Certificate#verify` の期待する振る舞いは `true` を返すこと」を意味します。 +このチェックを省略しても、総体的に X.509 信頼モデルのセキュリティに大きな影響はありません。 + +RFC 5280 の 4.1.1.3 項は、CA が証明書に含まれる情報の正確さを「証明書の署名を計算すること」で確認すると明記しています。 +上記のサンプルコードはこの原則に違反していますが、セキュリティを脅かすものではありません。 + +## 潜在的なリスク + +2 通り考えられます: + +### ルート証明書の再署名 + +ユーザーとして、私たちは無条件にルート証明書を信頼します。 +有効なな情報が含まれていない場合でも、公的に認められたルート証明書であるというステータスだけで、それらを元の状態に保つことができます。 +たとえば、OpenSSL 自体は同様の理由からデフォルトで自己署名ルート証明書の署名をチェックしません。 + +参考: [X509_V_FLAG_CHECK_SS_SIGNATURE documentation](https://www.openssl.org/docs/crypto/X509_VERIFY_PARAM_set_flags.html) + +再署名されたルート証明書は事実上の「自己署名」証明書になります(ただし、サブジェクト公開鍵情報は正しくありません)。 +これは正常な自己署名ルート証明書より危険ではありません。 +事実、署名がなければ、有効なルート証明書と完全に一致する可能性のある自己署名ルート証明書は誰でも作成できます。 +私たちは所有するだけでルート証明書を信頼するため、クライアントの「このルート証明書は信頼する」という積極的な同意がない限り、詐欺まがいな証明書に意味はありません。 + +### 中間証明書またはリーフ証明書の再署名 + +非ルート証明書の再署名もまた X.509 信頼モデルのセキュリティを脅かすものではありません。 +通常はこのような種類の証明書をあらかじめ所有していない限り、[パス検証手続き](http://tools.ietf.org/html/rfc5280#section-6)中にこのような偽装は検出されます。 +ここで、非ルート証明書の署名は、発行する証明書の公開鍵を使用して検証されます。 +証明書チェーンのある時点で、偽造は最終的に無効な証明書署名値という形で検出されます。 + +## まとめ + +結論として、`X509Certificate#verify` は期待どおりに動作すると考えています。 +私たち以外の誰かも自力で[同じ結論](https://github.com/adrienthebo/cve-2014-2734/)に行き着いたため、CVE-2014-2734 に異議を唱え、その取り消しを求めました。 +[オリジナルのコンセプトの実証](https://gist.github.com/emboss/91696b56cd227c8a0c13)は、コメントを含め、完全な分析結果として閲覧することができます。 From 45ecaadb25d8ea1460c51471750c22f227ea99f5 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Mon, 29 Nov 2021 00:05:49 +0900 Subject: [PATCH 2183/3171] Translate "OpenSSL Severe Vulnerability in TLS Heartbeat Extension (CVE-2014-0160)" (ja) Translate [https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2014-04-10-severe-openssl-vulnerability.md](https://github.com/ruby/www.ruby-lang.org/blob/master/en/news/_posts/2014-04-10-severe-openssl-vulnerability.md) to ja. --- ...2014-04-10-severe-openssl-vulnerability.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 ja/news/_posts/2014-04-10-severe-openssl-vulnerability.md diff --git a/ja/news/_posts/2014-04-10-severe-openssl-vulnerability.md b/ja/news/_posts/2014-04-10-severe-openssl-vulnerability.md new file mode 100644 index 0000000000..98c992bfe7 --- /dev/null +++ b/ja/news/_posts/2014-04-10-severe-openssl-vulnerability.md @@ -0,0 +1,59 @@ +--- +layout: news_post +title: "OpenSSL の TLS ハートビート拡張による重大な脆弱性について(CVE-2014-0160)" +author: "hone and zzak" +translator: "jinroq" +date: 2014-04-10 01:04:27 +0000 +tags: security +lang: ja +--- + +OpenSSL の TLS/DTLS(トランスポート層セキュアプロトコル)ハートビート拡張(`RFC6520`)の実装で重大な脆弱性が発見されました。 +この脆弱性は [CVE-2014-0160](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0160) として登録されています。 + +サーバーからクライアントへ、およびクライアントからサーバーへのメモリの内容を利己的に開示される可能性があります。 +攻撃者は、SSL 暗号化に使用される秘密鍵や認証トークンなどを含む機密データをメモリから遠隔操作によって取得できます。 + +詳細は [heartbleed.com](http://heartbleed.com) を参照してください. + +## Ruby の影響範囲 + +Ruby は、標準添付ライブラリ OpenSSL の C 拡張機能を介した脆弱な OpenSSL のバージョンに対して静的コンパイルをされると影響を受けます。 + +バージョン 1.0.1 以上 1.0.1f 以下の OpenSSL がこの攻撃に対して脆弱です。 +Ruby にリンクしている OpenSSL ライブラリのバージョンを検証するには、以下を実行してください。 + +{% highlight sh %} +ruby -v -ropenssl -rfiddle -e 'puts Fiddle::Function.new(Fiddle.dlopen(nil)["SSLeay_version"], [Fiddle::TYPE_INT], Fiddle::TYPE_VOIDP).call(0)' +{% endhighlight %} + +Ruby を使って現在インストールされている OpenSSL のバージョンを確認するには、以下を実行してください。 + +{% highlight sh %} +ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' +{% endhighlight %} + +[emboss のスクリプト](https://github.com/emboss/heartbeat)を使ってクライアントソフトウェア、または実行中のサービスが脆弱かどうかを確認できます。 + +## 解決策 + +最新版である OpenSSL バージョン `1.0.1g` もしくはそれ以降にアップグレードする必要があります。そのためには最新の OpenSSL が提供されているかを現在使っている OS パッケージ管理システムで確認する必要があります。 +利用可能なバージョン番号に関係なく、その OpenSSL のバージョンにパッチが適用されているかを確認するために、OS ディストリビューターに相談する必要があるかもしれません。 + +アップグレードがオプションではない場合、ビルド時に `-DOPENSSL_NO_HEARTBEATS` オプションを付け、パッチが適用されている OpenSSL を再コンパイルします。 + +アプグレードされている OpenSSL を使っているなら、脆弱なバージョンの OpenSSL へのリンクがないことを確認している Ruby を再コンパイルすることを推奨します。 + +これは、RVM や ruby-build のような Ruby をビルドするために使うツールを更新することを意味します。 +Ruby を自分でビルドする場合は、コンパイル時にアップグレードされた OpenSSL をインストールしているディレクトリにリンクするよう `--with-openssl-dir` オプションを使用してください。。 + +{% highlight sh %} +$ ./configure --with-openssl-dir=/path/to/openssl +$ make +$ make install +{% endhighlight %} + +OpenSSL と Ruby をアップグレードした後、脆弱なバージョンを使っている全てのプログラムを再起動することが重要です。 + +多くの OS ディストリビューションは、この攻撃に脆弱であるライブラリに対し、パッチを適用したバージョンと再構築されたパッケージをすでに提供しています(もしくは間もなく提供する予定です)。 +安全性を確保するために、OS ディストリビューターを監視することが重要です。 From 1951efd3308b9371d282d0c300e855a61fbe2177 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Sat, 4 Dec 2021 07:46:18 +0900 Subject: [PATCH 2184/3171] Revised in the review. --- ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md b/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md index 6d2f0d0343..ca45ac42cd 100644 --- a/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md +++ b/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md @@ -12,7 +12,7 @@ Net::IMAP 内の StartTLS ストリッピングに脆弱性が発見されまし この脆弱性は [CVE-2021-32066](https://nvd.nist.gov/vuln/detail/CVE-2021-32066) として登録されています。 Ruby をアップグレードすることを強く推奨します。 -net-imap は Ruby 3.0.1 の デフォルト gem ですが、パッケージ化の問題があるため、Ruby 自体をアップグレードしてください。 +net-imap は Ruby 3.0.1 の デフォルト gem ですが、パッケージ化に問題があるため、Ruby 自体をアップグレードしてください。 ## 詳細 From 39180f8bf65f45aa3bdd132bdbeed34f7a14a73d Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Sat, 4 Dec 2021 08:08:16 +0900 Subject: [PATCH 2185/3171] Revised in the review. --- ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md b/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md index ca45ac42cd..0a54c65239 100644 --- a/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md +++ b/ja/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md @@ -16,7 +16,7 @@ net-imap は Ruby 3.0.1 の デフォルト gem ですが、パッケージ化 ## 詳細 -Net::IMAP は、StartTLS が不明な応答で失敗した場合に例外を発生させません。これにより、中間者攻撃者がクライアントとレジストリ間のネットワークの場所を利用して StartTLS コマンドをブロックできる可能性があります。つまり、中間者攻撃者が TLS 保護をバイパスできる可能性があります。 +Net::IMAP は、StartTLS が不明な応答で失敗した場合に例外を発生させません。これにより、中間者攻撃者がクライアントとレジストリ間のネットワーク位置を利用して StartTLS コマンドをブロックし、結果として、中間者攻撃者が TLS 保護をバイパスできる可能性があります。 これは「StartTLS ストリッピング攻撃」とも呼ばれています。 ## 影響を受けるバージョン From c9dea54abfe645b9203e4b20003e082a95015e8b Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Sat, 4 Dec 2021 21:36:05 +0900 Subject: [PATCH 2186/3171] Polished sentences. --- ...-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md b/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md index 65589d9ebe..db1112833a 100644 --- a/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md +++ b/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md @@ -1,6 +1,6 @@ --- layout: news_post -title: "CVE-2021-28965: REXML 内の XML ラウンドトリップの脆弱性について" +title: "CVE-2021-28965: REXML 内の XML ラウンドトリップ脆弱性について" author: "mame" translator: "jinroq" date: 2021-04-05 12:00:00 +0000 @@ -8,13 +8,13 @@ tags: security lang: ja --- -Ruby にバンドルされている REXML gem 内の XML ラウンドトリップに脆弱性が発見されました。 +Ruby にバンドルされている REXML gem 内の XML ラウンドトリップ脆弱性が発見されました。 この脆弱性は [CVE-2021-28965](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-28965) として登録されています。 REXML gem をアップグレードすることを強く推奨します。 ## 詳細 -加工された XML ドキュメントをパーシングおよびシリアル化する場合、REXML gem(Ruby にバンドルされているものを含む)は、元のドキュメントとは構造が異なる誤った XML ドキュメントを生成する可能性があります。 +特定の加工が施された XML ドキュメントをパーシングおよびシリアル化する場合、REXML gem(Ruby にバンドルされているものを含む)は、元のドキュメントとは構造が異なる誤った XML ドキュメントを生成する可能性があります。 この問題の影響はコンテキストによって大きく異なりますが、REXML を使用している一部のプログラムでは脆弱性が生じる可能性があります。 REXML gem をバージョン 3.2.5 以降に更新してください。 From 178e4af80f26aabe7cc3edf365dc395994338616 Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:07:14 +0900 Subject: [PATCH 2187/3171] Revised points made in reviews. Revised the points made in [this comment](https://github.com/ruby/www.ruby-lang.org/pull/2747). --- ...4-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md b/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md index db1112833a..a30f112f91 100644 --- a/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md +++ b/ja/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md @@ -8,7 +8,7 @@ tags: security lang: ja --- -Ruby にバンドルされている REXML gem 内の XML ラウンドトリップ脆弱性が発見されました。 +Ruby にバンドルされている REXML gem に XML ラウンドトリップ脆弱性が発見されました。 この脆弱性は [CVE-2021-28965](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-28965) として登録されています。 REXML gem をアップグレードすることを強く推奨します。 From 93192c190415158183f702a6fcad0838dc975568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Mon, 6 Dec 2021 14:35:10 -0500 Subject: [PATCH 2188/3171] Translation of CVE-2021-41817 to spanish (#2758) * Translation of CVE-2021-41817 to spanish * No blank line at end * Update es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Co-authored-by: Gustavo Villa * Update es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Co-authored-by: Gustavo Villa * Update es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Co-authored-by: Gustavo Villa * Update es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Co-authored-by: Gustavo Villa * Update es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Co-authored-by: Gustavo Villa * Update es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Co-authored-by: Gustavo Villa * Update es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Co-authored-by: Gustavo Villa * Update es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md Co-authored-by: Gustavo Villa Co-authored-by: Gustavo Villa --- ...p-vulnerability-in-rexml-cve-2021-28965.md | 2 +- ...arsing-method-regexp-dos-cve-2021-41817.md | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md diff --git a/es/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md b/es/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md index fcc342219d..325205277b 100644 --- a/es/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md +++ b/es/news/_posts/2021-04-05-xml-round-trip-vulnerability-in-rexml-cve-2021-28965.md @@ -41,7 +41,7 @@ posterior tan pronto como sea posible. ## Versiones afectadas -* Ruby 2.5.8 o anterior (NO podrá usar `gem upgrade rexml` +* Ruby 2.5.8 o anterior (NO podrá usar `gem update rexml` con estas versiones.) * Ruby 2.6.6 o anterior * Ruby 2.7.2 o anterior diff --git a/es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md b/es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md new file mode 100644 index 0000000000..8f1bacc61e --- /dev/null +++ b/es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md @@ -0,0 +1,57 @@ +--- +layout: news_post +title: "CVE-2021-41817: Vulnerabilidad de denegación de servicio por Expresiones Reguales en los métodos para reconocer fechas" +author: "mame" +translator: vtamara +date: 2021-11-15 08:00:00 +0000 +tags: security +lang: es +--- + +Hemos publicado la gema `date` con versiones 3.2.1, 3.1.2, 3.0.2 y 2.0.1 +que incluyen una corrección de seguridad a una vulnerabilidad de denegación +de servicio por expresiones regulares (ReDoS) en los métodos para reconocer +fechas. +Un atacante podría explotar esta vulnerabilidad para generar +un ataque de denegación de servicio efectivo. + +A esta vulnerabilidad se le ha asignado el identificador CVE +[CVE-2021-41817](https://nvd.nist.gov/vuln/detail/CVE-2021-41817). + +## Detalles + +Los métodos para reconocer fechas incluyendo `Date.parse` usan +expresiones regulares internamente, algunas de las cuales son vulnerables +a denegación de servicio por expresiones regulares. +Las aplicaciones y librerías que emplean tales métodos con entradas +no confiables pueden verse afectadas. + +La corrección limita el tamaño de la entrada a 128 bytes de manera +predeterminada en lugar de cambiar las expresiones regulares. +Esto es porque la gema Date usa muchas expresiones regulares y es posible que aún haya +vulnerabilidades no descubiertas en algunas. Por compatibilidad, se +permite eliminar la limitación pasando explícitamente la palabra +reservada `limit` en `nil`, como en `Date.parse(str, limit: nil)`, +pero tenga en cuenta que el reconocimiento puede tardar un largo tiempo. + +Por favor actualice la gema date a una de las versiones 3.2.1, 3.1.2, 3.0.2, +2.0.1 o posterior. Puede usar `gem update date` para actualizarla. +Si usa bundler, por favor añada `gem "date", ">= 3.2.1"` a su `Gemfile`. +De forma alternativa, puede actualizar Ruby a 3.0.3, 2.7.5, 2.6.9 o posterior. + +## Versiones afectadas + +* gema date 2.0.0 y anteriores (distribuidas con la serie Ruby 2.6 antes de Ruby 2.6.9) +* gema date 3.0.1 y anteriores (distribuidas con la serie Ruby 2.7 antes de Ruby 2.7.5) +* gema date 3.1.1 y anteriores (distribuida con la serie Ruby 3.0 antes de Ruby 3.0.3) +* gema date gem 3.2.0 y anteriores + +## Créditos + +Agradecemos a [svalkanov](https://github.com/SValkanov/) por descubrir +el problema. + +## Historia + +* Publicado originalmente en inglés el 2021-11-15 08:00:00 (UTC) +* Mención sobre nuevas versiones de Ruby el 2021-11-24 13:20:00 (UTC) From 75c9ef329eb90cd5411df8e7fa9f3da49a32f1de Mon Sep 17 00:00:00 2001 From: Andrias Meisyal Date: Sat, 4 Dec 2021 20:23:33 +0700 Subject: [PATCH 2189/3171] Translate CVE-2021-32066: A StartTLS stripping vulnerability in Net::IMAP (id) --- ...21-07-07-starttls-stripping-in-net-imap.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 id/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md diff --git a/id/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md b/id/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md new file mode 100644 index 0000000000..0e83033da3 --- /dev/null +++ b/id/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md @@ -0,0 +1,40 @@ +--- +layout: news_post +title: "CVE-2021-32066: Kerentanan StartTLS stripping pada Net::IMAP" +author: "shugo" +translator: "meisyal" +date: 2021-07-07 09:00:00 +0000 +tags: security +lang: id +--- + +Sebuah kerentanan StartTLS *stripping* telah ditemukan pada Net::IMAP. +Kerentanan ini telah ditetapkan dengan penanda CVE +[CVE-2021-32066](https://nvd.nist.gov/vuln/detail/CVE-2021-32066). +Kami sangat merekomendasikan untuk memperbarui Ruby. + +net-imap adalah sebuah *default gem* pada Ruby 3.0.1, tetapi *gem* tersebut +memiliki masalah pengemasan. Sehingga, mohon perbarui Ruby. + +## Detail + +Net::IMAP tidak akan mengeluarkan sebuah *exception* jika StartTLS gagal +dengan sebuah respons yang tidak dikenal, yang mana mungkin memperbolehkan +penyerang *man-in-the-middle* untuk melewati perlindungan TLS dengan +memanfaatkan posisi jaringan antara *client* dan *registry* untuk mengeblok +perintah StartTLS, alias "StartTLS stripping attack." + +## Versi Terimbas + +* Rangkaian Ruby 2.6: 2.6.7 dan sebelumnya +* Rangkaian Ruby 2.7: 2.7.3 dan sebelumnya +* Rangkaian Ruby 3.0: 3.0.1 dan sebelumnya + +## Rujukan + +Terima kasih kepada [Alexandr Savca](https://hackerone.com/chinarulezzz) yang +telah melaporkan kerentanan ini. + +## Riwayat + +* Semula dipublikasikan pada 2021-07-07 09:00:00 UTC From 6a7c5e36a74e64d4b689bb89908be5fa68f1a19a Mon Sep 17 00:00:00 2001 From: billaul Date: Sun, 19 Dec 2021 17:22:33 +0100 Subject: [PATCH 2190/3171] Update index.md --- fr/community/index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fr/community/index.md b/fr/community/index.md index 97898265cd..984296a32d 100644 --- a/fr/community/index.md +++ b/fr/community/index.md @@ -25,6 +25,12 @@ Quelques liens à visiter: disponibles. Si vous avez des questions sur Ruby, les poser sur une de ces listes est un moyen efficace pour obtenir rapidement des réponses. +[Server Discord Ruby (lien d'invitation)][ruby-discord] +: Le serveur Discord Ruby est un endroit où vous pouvez discuter avec + d'autres rubyistes, obtenir de l'aide pour vos questions sur Ruby ou + aider les autres. Discord est un bon point d'entrée pour les nouveaux + développeurs et il est facile à rejoindre. + [IRC (#ruby)](https://web.libera.chat/#ruby) : Le canal IRC anglophone #ruby est un endroit fantastique pour discuter en temps réel avec d’autres rubyistes. @@ -53,5 +59,6 @@ Informations générales [ruby-central]: http://rubycentral.org/ +[ruby-discord]: https://ruby-discord.com/ [ruby-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/ [rails-opendir]: https://dmoztools.net/Computers/Programming/Languages/Ruby/Software/Frameworks/Rails/ From 840bad163a6756708734b5d7626e037c83fc95ff Mon Sep 17 00:00:00 2001 From: Andrias Meisyal Date: Sat, 18 Dec 2021 20:23:19 +0700 Subject: [PATCH 2191/3171] Translate Ruby 2.6.8 released news (id) --- .../_posts/2021-07-07-ruby-2-6-8-released.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 id/news/_posts/2021-07-07-ruby-2-6-8-released.md diff --git a/id/news/_posts/2021-07-07-ruby-2-6-8-released.md b/id/news/_posts/2021-07-07-ruby-2-6-8-released.md new file mode 100644 index 0000000000..0b922bfdcc --- /dev/null +++ b/id/news/_posts/2021-07-07-ruby-2-6-8-released.md @@ -0,0 +1,64 @@ +--- +layout: news_post +title: "Ruby 2.6.8 Dirilis" +author: "usa" +translator: "meisyal" +date: 2021-07-07 09:00:00 +0000 +lang: id +--- + +Ruby 2.6.8 telah dirilis. + +Rilis ini memuat perbaikan keamanan. +Mohon cek topik-topik di bawah ini untuk lebih detail. + +* [CVE-2021-31810: Kerentanan respons FTP PASV yang dipercaya pada Net::FTP]({%link id/news/_posts/2021-07-07-trusting-pasv-responses-in-net-ftp.md %}) +* [CVE-2021-32066: Kerentanan StartTLS stripping pada Net::IMAP]({%link id/news/_posts/2021-07-07-starttls-stripping-in-net-imap.md %}) +* [CVE-2021-31799: Sebuah kerentanan command injection pada RDoc]({%link id/news/_posts/2021-05-02-os-command-injection-in-rdoc.md %}) + +Kami biasanya tidak memperbaiki Ruby 2.6, kecuali perbaikan keamanan. Tetapi, +rilis ini memuat beberapa perbaikan *regressed bug* dan *build problem*. +Lihat [commit logs](https://github.com/ruby/ruby/compare/v2_6_7...v2_6_8) +untuk detail. + +Ruby 2.6 saat ini berada pada fase perawatan keamanan hingga akhir Maret 2022. +Setelah bulan tersebut, perawatan Ruby 2.6 akan berakhir. +Kami merekomendasikan Anda untuk mulai merencanakan migrasi ke Ruby versi +terbaru, seperti 3.0 atau 2.7. + +## Unduh + +{% assign release = site.data.releases | where: "version", "2.6.8" | first %} + +* <{{ release.url.bz2 }}> + + SIZE: {{ release.size.bz2 }} + SHA1: {{ release.sha1.bz2 }} + SHA256: {{ release.sha256.bz2 }} + SHA512: {{ release.sha512.bz2 }} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Komentar Rilis + +Banyak *committer*, pengembang, dan pengguna yang telah menyediakan laporan +*bug* membantu kami untuk membuat rilis ini. Terima kasih atas kontribusinya. From f1e7ad610a7aa5a5e48b4894a6c8b9b205b5afbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Wed, 22 Dec 2021 15:57:40 -0500 Subject: [PATCH 2192/3171] Translation of CVE 2021 41816 to spanish (#2760) * Translation of CVE 2021 41816 to spanish * lang es --- ...errun-in-cgi-escape_html-cve-2021-41816.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 es/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md diff --git a/es/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md b/es/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md new file mode 100644 index 0000000000..6a64284388 --- /dev/null +++ b/es/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md @@ -0,0 +1,46 @@ +--- +layout: news_post +title: "CVE-2021-41816: Desbordamiento de búfer en CGI.escape_html" +author: "mame" +translator: vtamara +date: 2021-11-24 12:00:00 +0000 +tags: security +lang: es +--- + +Una vulnerabilidad de desbordamiento de búfer fue descubierta en +CGI.escape_html. +A esta vulnerabilidad se le ha asignado el identificador CVE +[CVE-2021-41816](https://nvd.nist.gov/vuln/detail/CVE-2021-41816). +Recomendamos enfáticamente actualizar Ruby. + +## Detalles + +Una vulnerabilidad de seguridad que causa desbordamientos de búfer cuando +el usuario pasa una cadenas muy grande (> 700MB) a `CGI.escape_html` en +una plataforma donde el tipo `long` emplee 4 bytes, tipicamente, Windows. + +Por favor actualice la gema cgi a la versión 0.3.1, 0.2,1, y 0.1,1 o posterior. +Puede usar `gem update cgi` para actualizarla. Si está usando bundler, +por favor añada `gem "cgi", ">= 0.3.1"` a su archivo `Gemfile`. +Alternativamente, por favor actualice Ruby a 2.7.5 o a 3.0.3. + +Este problema fue introducido desde Ruby 2.7, así que las versiones de cgi +incorporadas en Ruby 2.6 no es vulnerable. + +## Versiones afectadas + +* Gema cgi 0.1.0 o anterior (que se distribuyó con la serie Ruby 2.7 antes de + Ruby 2.7.5) +* Gema cgi 0.2.0 o anterior (que se distribuyó con la serie Ruby 3.0 antes de + Ruby 3.0.3) +* Gema cgi 0.3.0 o anterior + +## Créditos + +Agradecimientos a [chamal](https://hackerone.com/chamal) por descubrir este +problema. + +## Historia + +* Publicado originalmente el 2021-11-24 12:00:00 (UTC) From b923ddb8c6558223d1f691749d21985022132c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Thu, 23 Dec 2021 09:38:46 -0500 Subject: [PATCH 2193/3171] Translation of CVE 2021-41819 to spanish (#2763) --- ...fing-in-cgi-cookie-parse-cve-2021-41819.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md diff --git a/es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md b/es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md new file mode 100644 index 0000000000..2648f13314 --- /dev/null +++ b/es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md @@ -0,0 +1,59 @@ +--- +layout: news_post +title: "CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse" +author: "mame" +translator: vtamara +date: 2021-11-24 12:00:00 +0000 +tags: security +lang: es +--- + +Se descubrió una vulnerabilidad de suplantación de identidad de prefijos de +galletas (cookies) en CGI::Cookie.parse. +A esta vulnerabilidad se el ha asignado el identificador +CVE [CVE-2021-41819](https://nvd.nist.gov/vuln/detail/CVE-2021-41819). +Recomendamos con énfasis actualizar Ruby. + +## Detalles + +La antigua versión de `CGI::Cookie.parse` aplicaba decodificación de URL a los +nombres de galletas. +Un atacante podría explotar esta vulnerabilidad para suplantar prefijos de +seguridad en los nombres de las galletas, que podría permitirle engañar +a una aplicación vulnerable. + +Con este arreglo, `CGI::Cookie.parse` ya no decodifica los nombres +de las galletas. +Note que esto es una incompatibilidad si los nombres de galletas que +está usando incluyendo carácteres no alfanuméricos que no están +codificados como URL. + +Este es el mismo incidente [CVE-2020-8184](https://nvd.nist.gov/vuln/detail/CVE-2020-8184). + +Si está usando Ruby 2.7 o 3.0: + +* Por favor actualice la gema cgi a la versión 0.3.1, 0.2,1, y 0.1,1 + o posterior. Puede usar `gem update cgi` para actualizarla. Si usa + bundler por favor agregue `gem "cgi", ">= 0.3.1"` a su `Gemfile`. +* De manera alternativa, por favor actualice Ruby a 2.7.5 o 3.0.3. + +Si usa Ruby 2.6: + +* Por favor actualice Ruby a 2.6.9. *No puede usar `gem update cgi` con Ruby 2.6 + o anteriores.* + +## Versiones afectadas + +* ruby 2.6.8 o anteriores (*No* puede usar `gem update cgi` para esta versión.) +* Gema cgi 0.1.0 o anteriores (que son versiones incorporadas en la serie Ruby 2.7 antes de Ruby 2.7.5) +* Gema cgi 0.2.0 o anteriores (que son versiones incorporadas en la serie Ruby 3.0 antes de Ruby 3.0.3) +* Gema cgi 0.3.0 o anteriores + +## Créditos + +Agradecemos a [ooooooo_q](https://hackerone.com/ooooooo_q) por descubrir +este problema. + +## Historia + +* Publicado originalmente el 2021-11-24 12:00:00 (UTC) From 0df598db6ec35d2f8c9070e448110a354a78952a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Thu, 23 Dec 2021 11:53:56 -0500 Subject: [PATCH 2194/3171] Translation of release of Ruby 2.6.9, 2.7.5 and 3.0.3 to spanish (#2764) --- ...fing-in-cgi-cookie-parse-cve-2021-41819.md | 2 +- .../_posts/2021-11-24-ruby-2-6-9-released.md | 63 +++++++++++++++++++ .../_posts/2021-11-24-ruby-2-7-5-released.md | 63 +++++++++++++++++++ .../_posts/2021-11-24-ruby-3-0-3-released.md | 60 ++++++++++++++++++ 4 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 es/news/_posts/2021-11-24-ruby-2-6-9-released.md create mode 100644 es/news/_posts/2021-11-24-ruby-2-7-5-released.md create mode 100644 es/news/_posts/2021-11-24-ruby-3-0-3-released.md diff --git a/es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md b/es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md index 2648f13314..664dbe5b00 100644 --- a/es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md +++ b/es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md @@ -1,6 +1,6 @@ --- layout: news_post -title: "CVE-2021-41819: Cookie Prefix Spoofing in CGI::Cookie.parse" +title: "CVE-2021-41819: Suplantación de identidad del prefijo de galletas en CGI::Cookie.parse" author: "mame" translator: vtamara date: 2021-11-24 12:00:00 +0000 diff --git a/es/news/_posts/2021-11-24-ruby-2-6-9-released.md b/es/news/_posts/2021-11-24-ruby-2-6-9-released.md new file mode 100644 index 0000000000..62f48cbae2 --- /dev/null +++ b/es/news/_posts/2021-11-24-ruby-2-6-9-released.md @@ -0,0 +1,63 @@ +--- +layout: news_post +title: "Publicado Ruby 2.6.9" +author: "usa" +translator: vtamara +date: 2021-11-24 12:00:00 +0000 +lang: es +--- + +Ruby 2.6.9 ha sido publicado. +CVE-2021-41819: Suplantación de identidad del prefijo de galletas en CGI::Cookie.parse +Esta versión incluye correcciones de seguridad. +Por favor revise los temas siguientes para ver detalles. +Please check the topics below for details. + +* [CVE-2021-41817: Vulnerabilidad de denegación de servicio por Expresiones Reguales en los métodos para reconocer fechas]({%link es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41819: Suplantación de identidad del prefijo de galletas en CGI::Cookie.parse]({%link es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) + +Ver detalles en la [bitácora de cambios](https://github.com/ruby/ruby/compare/v2_6_8...v2_6_9). + +Ruby 2.6 ahora está en la fase de mantenimiento de seguridad, hasta el final +de Marzo de 2022. +Tras esa fecha, cesará el mantenimiento a Ruby 2.6. +Le recomendamos empezar a planear la migración a una versińo más +reciente de ruby, tal como 3.0 o 2.7. + +## Descargas + +{% assign release = site.data.releases | where: "version", "2.6.9" | first %} + +* <{{ release.url.bz2 }}> + + SIZE: {{ release.size.bz2 }} + SHA1: {{ release.sha1.bz2 }} + SHA256: {{ release.sha256.bz2 }} + SHA512: {{ release.sha512.bz2 }} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Comentario de la versión + +Muchos contribuidores, desarrolladores y usuarios proveyeron reportes +de fallas que ayudaron a completar esta versión. +Gracias por sus contribuciones. diff --git a/es/news/_posts/2021-11-24-ruby-2-7-5-released.md b/es/news/_posts/2021-11-24-ruby-2-7-5-released.md new file mode 100644 index 0000000000..641d91f64f --- /dev/null +++ b/es/news/_posts/2021-11-24-ruby-2-7-5-released.md @@ -0,0 +1,63 @@ +--- +layout: news_post +title: "Publicado Ruby 2.7.5" +author: "usa" +translator: vtamara +date: 2021-11-24 12:00:00 +0000 +lang: es +--- + +Ruby 2.7.5 ha sido publicado. + +Esta versión incluye correcciones de seguridad. +Por favor revise los temas siguientes para ver detalles. + +* [CVE-2021-41817: Vulnerabilidad de denegación de servicio por Expresiones Reguales en los métodos para reconocer fechas]({%link es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41819: Suplantación de identidad del prefijo de galletas en CGI::Cookie.parse]({%link es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) +* [CVE-2021-41816: Desbordamiento de búfer en CGI.escape_html]({%link es/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) + +Ver detalles en la +[bitácora de cambios](https://github.com/ruby/ruby/compare/v2_7_4...v2_7_5). + + +## Descargas + +{% assign release = site.data.releases | where: "version", "2.7.5" | first %} + + +* <{{ release.url.bz2 }}> + + SIZE: {{ release.size.bz2 }} + SHA1: {{ release.sha1.bz2 }} + SHA256: {{ release.sha256.bz2 }} + SHA512: {{ release.sha512.bz2 }} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Comentario de la versión + +Muchos contribuidores, desarrolladores y usuarios proveyeron reportes +de fallas que nos ayudaron a completar esta versión. +Gracias por sus contribuciones. + +El mantenimiento de Ruby 2.7, incluida esta versión, se basa en el "Acuerdo +para una versión estable de Ruby" de la Asociación Ruby. diff --git a/es/news/_posts/2021-11-24-ruby-3-0-3-released.md b/es/news/_posts/2021-11-24-ruby-3-0-3-released.md new file mode 100644 index 0000000000..1836129518 --- /dev/null +++ b/es/news/_posts/2021-11-24-ruby-3-0-3-released.md @@ -0,0 +1,60 @@ +--- +layout: news_post +title: "Publicación de Ruby 3.0.3" +author: "nagachika" +translator: vtamara +date: 2021-11-24 12:00:00 +0000 +lang: es +--- + +Ruby 3.0.3 ha sido publicado. + +Esta versión incluye correcciones de seguridad. +Por favor revise los temas siguientes para ver detalles. + +* [CVE-2021-41817: Vulnerabilidad de denegación de servicio por Expresiones Reguales en los métodos para reconocer fechas]({%link es/news/_posts/2021-11-15-date-parsing-method-regexp-dos-cve-2021-41817.md %}) +* [CVE-2021-41816: Desbordamiento de búfer en CGI.escape_html]({%link es/news/_posts/2021-11-24-buffer-overrun-in-cgi-escape_html-cve-2021-41816.md %}) +* [CVE-2021-41819: Suplantación de identidad del prefijo de galletas en CGI::Cookie.parse]({%link es/news/_posts/2021-11-24-cookie-prefix-spoofing-in-cgi-cookie-parse-cve-2021-41819.md %}) + +Ver detalles en la +[bitácora de cambios](https://github.com/ruby/ruby/compare/v2_7_4...v2_7_5). + + +## Descargas + +{% assign release = site.data.releases | where: "version", "3.0.3" | first %} + + +* <{{ release.url.bz2 }}> + + SIZE: {{ release.size.bz2 }} + SHA1: {{ release.sha1.bz2 }} + SHA256: {{ release.sha256.bz2 }} + SHA512: {{ release.sha512.bz2 }} + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Comentario de la versión + +Muchos contribuidores, desarrolladores y usuarios proveyeron reportes +de fallas que nos ayudaron a completar esta versión. +Gracias por sus contribuciones. From af3e0d344a11738ea684d0c2cf5e662f9f934228 Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Sat, 25 Dec 2021 19:59:44 +0900 Subject: [PATCH 2195/3171] Ruby 3.1.0 Released (#2765) --- _data/branches.yml | 4 +- _data/downloads.yml | 2 +- _data/releases.yml | 24 ++ .../_posts/2021-12-25-ruby-3-1-0-released.md | 259 ++++++++++++++++++ .../_posts/2021-12-25-ruby-3-1-0-released.md | 256 +++++++++++++++++ 5 files changed, 542 insertions(+), 3 deletions(-) create mode 100644 en/news/_posts/2021-12-25-ruby-3-1-0-released.md create mode 100644 ja/news/_posts/2021-12-25-ruby-3-1-0-released.md diff --git a/_data/branches.yml b/_data/branches.yml index ebd2220b93..a4054fb534 100644 --- a/_data/branches.yml +++ b/_data/branches.yml @@ -9,8 +9,8 @@ # eol_date: date of EOL (YYYY-MM-DD) - name: 3.1 - status: preview - date: + status: normal maintenance + date: 2021-12-25 eol_date: - name: 3.0 diff --git a/_data/downloads.yml b/_data/downloads.yml index 54a2601a06..10644898d1 100644 --- a/_data/downloads.yml +++ b/_data/downloads.yml @@ -4,10 +4,10 @@ # optional preview: - - 3.1.0-preview1 stable: + - 3.1.0 - 3.0.3 - 2.7.5 diff --git a/_data/releases.yml b/_data/releases.yml index 82ff598065..a7a6341109 100644 --- a/_data/releases.yml +++ b/_data/releases.yml @@ -21,6 +21,30 @@ # 3.1 series +- version: 3.1.0 + date: 2021-12-25 + post: /en/news/2021/12/25/ruby-3-1-0-released/ + url: + gz: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.gz + zip: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.zip + xz: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.xz + size: + gz: 19204319 + zip: 23207824 + xz: 14051880 + sha1: + gz: 3945f8043286975cfc016d288abcb334574796d9 + zip: 88963d8244bb122668c1fc8dfa3a8a5289c87146 + xz: 3d5a9cae293763787185ccc04f05aecfb6790703 + sha256: + gz: 8dc75f2f7b5552a3a10abc22ffbf1bf85909326d715647dcdf5ce878c349a81d + zip: 8a051fdd5ba43bd072c3179bbc65c581974c06142b97aa049fe04ec6d5fc8447 + xz: 8594c076e1b06a896143d3a70163ddc12d81ca55c906ee5ee215587c2df52382 + sha512: + gz: ede15d99afb3087412a45038ad9266af67edc953fae08356a64235706766d171715bc927b045e1b07d0736cdf83f1891944b6861dad39f4519482135493cc93c + zip: f52ea893e158d79074ab7f551778df2189c184bc7b931e27ad0e7600ceab743d88d8b07ba3ff400b65c7866aa62734b72efe89216d5c4106391b40476f0d30ac + xz: 0ef0c19b6ae5af9878d8783a7b072e7f86c6d0e747866365564891c94452f334c901419bba80b6361c803c031ffa6b98d237eb4c6e017f8e6fe652cc336572de + - version: 3.1.0-preview1 date: 2021-11-09 post: /en/news/2021/11/09/ruby-3-1-0-preview1-released/ diff --git a/en/news/_posts/2021-12-25-ruby-3-1-0-released.md b/en/news/_posts/2021-12-25-ruby-3-1-0-released.md new file mode 100644 index 0000000000..caf363cc42 --- /dev/null +++ b/en/news/_posts/2021-12-25-ruby-3-1-0-released.md @@ -0,0 +1,259 @@ +--- +layout: news_post +title: "Ruby 3.1.0 Released" +author: "naruse" +translator: +date: 2021-12-25 00:00:00 +0000 +lang: en +--- + +{% assign release = site.data.releases | where: "version", "3.1.0" | first %} + +We are pleased to announce the release of Ruby {{ release.version }}. + + +## YJIT: New experimental in-process JIT compiler + + +Ruby 3.1 merges YJIT, a new in-process JIT compiler developed by Shopify. + +Since [Ruby 2.6 introduced MJIT in 2018](https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/), its performance greatly improved, and finally [we achieved Ruby3x3 last year](https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/). But even though Optcarrot has shown impressive speedups, the JIT hasn't benefited real world business applications. + +Recently Shopify contributed many Ruby improvements to speed up their Rails application. YJIT is an important contribution, and aims to improve the performance of Rails applications. + +Though MJIT is a method-based JIT compiler and uses an external C compiler, YJIT uses Basic Block Versioning and includes JIT compiler inside it. With Lazy Basic Block Versioning (LBBV) it first compiles the beginning of a method, and incrementally compiles the rest when the type of arguments and variables are dynamically determined. See [YJIT: a basic block versioning JIT compiler for CRuby](https://dl.acm.org/doi/10.1145/3486606.3486781) for a detailed introduction. + +With this technology, YJIT achieves both fast warmup time and performance improvements on most real-world software, up to 22% on railsbench, 39% on liquid-render. + +YJIT is still an experimental feature, and as such, it is disabled by default. If you want to use this, specify the `--yjit` command-line option to enable YJIT. It is also limited to Unix-like x86-64 platforms for now. + +* https://bugs.ruby-lang.org/issues/18229 +* https://shopify.engineering/yjit-just-in-time-compiler-cruby +* https://www.youtube.com/watch?v=PBVLf3yfMs8 + +## debug gem: A new debugger + +A completely rewritten debugger [debug.gem](https://github.com/ruby/debug) is bundled. debug.gem has the following features: + +* Improve the debugging performance (it does not slow down the application even with the debugger) +* Support remote debugging +* Support rich debugging frontend (VSCode and Chrome browser are supported now) +* Support multi-process/multi-thread debugging +* Colorful REPL +* And other useful features like recod & replay feature, tracing feature and so on. + + + +Ruby had bundled lib/debug.rb, but it was not well maintained and it had issues about performance and features. debug.gem replaced lib/debug.rb completely. + +## error_highlight: Fine-grained error location in backtrace + +A built-in gem, error_highlight, has been introduced. It includes fine-grained error location in backtrace: + +``` +$ ruby test.rb +test.rb:1:in `
': undefined method `time' for 1:Integer (NoMethodError) + +1.time {} + ^^^^^ +Did you mean? times +``` + +Currently, only `NameError` is supported. + +This gem is enabled by default. You can disable it by using a command-line option `--disable-error_highlight`. See [the repository](https://github.com/ruby/error_highlight) in detail. + +## IRB Autocomplete and Document Display + +The IRB now has an autocomplete feature, where you can just type in the code, and the completion candidates dialog will appear. You can use Tab and Shift+Tab to move up and down. + +If documents are installed when you select a completion candidate, the documentation dialog will appear next to the completion candidates dialog, showing part of the content. You can read the full document by pressing Alt+d. + + + + +## Other Notable New Features + +### Language + +* Values in Hash literals and keyword arguments can be omitted. [Feature #14579] + * `{x:, y:}` is a syntax sugar of `{x: x, y: y}`. + * `foo(x:, y:)` is a syntax sugar of `foo(x: x, y: y)`. + +* Pin operator in pattern matching now takes an expression. [Feature #17411] + +```ruby +Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a +#=> [[3, 5], [5, 7], [11, 13]] +``` + +* Parentheses can be omitted in one-line pattern matching. [Feature #16182] + +```ruby +[0, 1] => _, x +{y: 2} => y: +x #=> 1 +y #=> 2 +``` + +### RBS + +RBS is a language to describe the structure of Ruby programs. See [the repository](https://github.com/ruby/rbs) for details. + +Updates since Ruby 3.0.0: + +* Generic type parameters can be bounded. ([PR](https://github.com/ruby/rbs/pull/844)) +* Generic type aliases are supported. ([PR](https://github.com/ruby/rbs/pull/823)) +* `rbs collection` has been introduced to manage gems' RBSs. ([doc](https://github.com/ruby/rbs/blob/master/docs/collection.md)) +* Many signatures for built-in and standard libraries have been added/updated. +* It includes many bug fixes and performance improvements too. + +See [the CHANGELOG.md](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) for more information. + +### TypeProf + +TypeProf is a static type analyzer for Ruby. It generates a prototype of RBS from non-type-annotated Ruby code. See [the document](https://github.com/ruby/typeprof/blob/master/doc/doc.md) for detail. + +The main updates since Ruby 3.0.0 is an experimental IDE support called "TypeProf for IDE". + +![Demo of TypeProf for IDE](https://cache.ruby-lang.org/pub/media/ruby310_typeprof_ide_demo.png) + +The vscode extension shows a guessed (or explicitly written in a RBS file) method signature above each method definition, draws a red underline under the code that may cause a name error or type error, and completes method names (i.e., shows method candidates). See [the document](https://github.com/ruby/typeprof/blob/master/doc/ide.md) in detail. + +Also, the release includes many bug fixes and performance improvements. + +## Performance improvements + +* MJIT + * For workloads like Rails, the default `--jit-max-cache` is changed from 100 to 10000. + The JIT compiler no longer skips compilation of methods longer than 1000 instructions. + * To support Zeitwerk of Rails, JIT-ed code is no longer cancelled + when a TracePoint for class events is enabled. + +## Other notable changes since 3.0 + +* One-line pattern matching, e.g., `ary => [x, y, z]`, is no longer experimental. +* Multiple assignment evaluation order has been changed slightly. [[Bug #4443]](https://bugs.ruby-lang.org/issues/4443) + * `foo[0], bar[0] = baz, qux` was evaluated in order `baz`, `qux`, `foo`, and then `bar` in Ruby 3.0. In Ruby 3.1, it is evaluated in order `foo`, `bar`, `baz`, and then `qux`. +* Variable Width Allocation: Strings (experimental) [[Bug #18239]](https://bugs.ruby-lang.org/issues/18239) + +* Psych 4.0 changes `Psych.load` as `safe_load` by the default. + You may need to use Psych 3.3.2 for migrating to this behavior. + [[Bug #17866]](https://bugs.ruby-lang.org/issues/17866) + +### Standard libraries updates + +* The following default gem are updated. + * RubyGems 3.3.3 + * base64 0.1.1 + * benchmark 0.2.0 + * bigdecimal 3.1.1 + * bundler 2.3.3 + * cgi 0.3.1 + * csv 3.2.2 + * date 3.2.2 + * did_you_mean 1.6.1 + * digest 3.1.0 + * drb 2.1.0 + * erb 2.2.3 + * error_highlight 0.3.0 + * etc 1.3.0 + * fcntl 1.0.1 + * fiddle 1.1.0 + * fileutils 1.6.0 + * find 0.1.1 + * io-console 0.5.9 + * io-wait 0.2.1 + * ipaddr 1.2.3 + * irb 1.4.1 + * json 2.6.1 + * logger 1.5.0 + * net-http 0.2.0 + * net-protocol 0.1.2 + * nkf 0.1.1 + * open-uri 0.2.0 + * openssl 3.0.0 + * optparse 0.2.0 + * ostruct 0.5.2 + * pathname 0.2.0 + * pp 0.3.0 + * prettyprint 0.1.1 + * psych 4.0.3 + * racc 1.6.0 + * rdoc 6.4.0 + * readline 0.0.3 + * readline-ext 0.1.4 + * reline 0.3.0 + * resolv 0.2.1 + * rinda 0.1.1 + * ruby2_keywords 0.0.5 + * securerandom 0.1.1 + * set 1.0.2 + * stringio 3.0.1 + * strscan 3.0.1 + * tempfile 0.1.2 + * time 0.2.0 + * timeout 0.2.0 + * tmpdir 0.1.2 + * un 0.2.0 + * uri 0.11.0 + * yaml 0.2.0 + * zlib 2.1.1 +* The following bundled gems are updated. + * minitest 5.15.0 + * power_assert 2.0.1 + * rake 13.0.6 + * test-unit 3.5.3 + * rexml 3.2.5 + * rbs 2.0.0 + * typeprof 0.21.1 +* The following default gems are now bundled gems. You need to add the following libraries to `Gemfile` under the bundler environment. + * net-ftp 0.1.3 + * net-imap 0.2.2 + * net-pop 0.1.1 + * net-smtp 0.3.1 + * matrix 0.4.2 + * prime 0.1.2 + * debug 1.4.0 + +See [NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md) +or [commit logs](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}) +for more details. + +With those changes, [{{ release.stats.files_changed }} files changed, {{ release.stats.insertions }} insertions(+), {{ release.stats.deletions }} deletions(-)](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}#file_bucket) +since Ruby 3.0.0! + +Merry Christmas, Happy Holidays, and enjoy programming with Ruby 3.1! + +## Download + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## What is Ruby + +Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993, +and is now developed as Open Source. It runs on multiple platforms +and is used all over the world especially for web development. diff --git a/ja/news/_posts/2021-12-25-ruby-3-1-0-released.md b/ja/news/_posts/2021-12-25-ruby-3-1-0-released.md new file mode 100644 index 0000000000..b8f5a29bfa --- /dev/null +++ b/ja/news/_posts/2021-12-25-ruby-3-1-0-released.md @@ -0,0 +1,256 @@ +--- +layout: news_post +title: "Ruby 3.1.0 リリース" +author: "naruse" +translator: +date: 2021-12-25 00:00:00 +0000 +lang: ja +--- + +Ruby 3.1系初のリリースである、Ruby 3.1.0 が公開されました。 + +{% assign release = site.data.releases | where: "version", "3.1.0" | first %} + + +## YJIT: New experimental in-process JIT compiler + +Ruby 3.1では、Shopifyが開発した新しいプロセス内JITコンパイラであるYJITをマージしました。 + +[2018年のRuby 2.6でMJITをマージ](https://www.ruby-lang.org/ja/news/2018/12/25/ruby-2-6-0-released/)して以来、そのパフォーマンスは年々改善され、去年には[Ruby3x3を無事達成](https://www.ruby-lang.org/ja/news/2020/12/25/ruby-3-0-0-released/)しました。比較的大規模なOptcarrotベンチマークでは輝かしい高速化を達成したMJITですが、一方で現実の業務アプリケーションの性能はこれまで改善出来ていませんでした。 + +近年Shopifyは彼らのRailsアプリケーションを高速化するため、Rubyに対して多くの貢献をしてきました。YJITはその中でも重要な貢献であり、Railsアプリケーションをさらに高速化するために開発されました。 + +MJITがメソッドベースのJITコンパイラであり、外部のCコンパイラを利用しているのに対し、YJITではBasic Block Versioningという技術を用いた独自のJITコンパイラをRuby内部に持っています。YJITの用いているLazy Basic Block Versioning (LBBC)では、まずメソッドの冒頭のみをコンパイルし、実行時に実際に値が渡されて引数や変数の値が明らかになってから残りをコンパイルするという手法を用いることで、動的プログラミング言語においても効率のよいJITを実現しています。詳細は [YJIT: a basic block versioning JIT compiler for CRuby](https://dl.acm.org/doi/10.1145/3486606.3486781) を参照ください。 + +これらの技術によって、YJITでは素早い起動と高速な実行を多くの実世界のアプリケーションに対して実現しており、railsbenchでは最大22%、liquied-renderでは39%の高速化を達成しています。 + +YJITはまだ実験的機能なため、デフォルトでは無効化されています。試してみたい場合には `--yjit` コマンドラインオプションを指定することでYJITを有効化出来ます。現在YJITはx86-64上のUnix系プラットフォームでのみ実行出来ます。 + +* https://bugs.ruby-lang.org/issues/18229 +* https://shopify.engineering/yjit-just-in-time-compiler-cruby +* https://www.youtube.com/watch?v=PBVLf3yfMs8 + +## debug gem: 新しいデバッガ + +完全に0から書き直したデバッガである [debug.gem](https://github.com/ruby/debug) が同梱されました。次のような特徴があります。 + +* デバッグ時の速度低下を極力生じないよう改善 +* リモートデバッグのサポート +* リッチなデバッガフロントエンドに対応(現在 VSCode と Chrome ブラウザに対応) +* マルチプロセス、マルチスレッドプログラムのデバッグに対応 +* カラフルな REPL +* そのほか、Record & Replay 機能やトレース機能など、様々な便利機能 + + + +Rubyにはこれまでも lib/debug.rb が同梱されていましたが、あまりメンテナンスされておらず、性能や機能に問題がありました。debug.gem はこれを完全に置き換えます。 + +## error_highlight: バックトレース中の詳細なエラー位置表示 + +error_highlightという組み込みgemが導入されました。これにより、バックトレース中でエラーが発生した詳細な位置が表示されます。 + +``` +$ ruby test.rb +test.rb:1:in `
': undefined method `time' for 1:Integer (NoMethodError) + +1.time {} + ^^^^^ +Did you mean? times +``` + +現在のところ、位置が表示されるのは`NameError`のみです。 + +このgemはデフォルトで有効になっています。`--disable-error_highlight`コマンドラインオプションを指定することで無効化できます。詳しくは[ruby/error_highlightリポジトリ](https://github.com/ruby/error_highlight)を見てください。 + +## IRB のオートコンプリートとドキュメント表示 + +IRB にオートコンプリート機能が実装され、コードを入力するだけで補完候補ダイアログが表示されるようになりました。Tab と Shift+Tab で上下に移動できます。 + +また、補完候補を選択している時に、ドキュメントがインストールされている場合、補完候補ダイアログの横にドキュメントダイアログが表示され、内容が一部表示されます。Alt+d を押すことでドキュメント全文を読むことができます。 + + + +## その他の主要な新機能 + +### 言語機能 + +* ハッシュリテラルやキーワード引数の値が省略可能になりました。 [Feature #14579] + * `{x:, y:}` は、`{x: x, y: y}` の糖衣構文です。 + * `foo(x:, y:)` は、`foo(x: x, y: y)` の糖衣構文です。 + +* パターンマッチ中のピン演算子に任意の式を書けるようになりました。 [Feature #17411] + +```ruby +Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a +#=> [[3, 5], [5, 7], [11, 13]] +``` + +* 一行パターンマッチで括弧が省略できるようになりました. [Feature #16182] + +```ruby +[0, 1] => _, x +{y: 2} => y: +x #=> 1 +y #=> 2 +``` + + +### RBS + +[RBS](https://github.com/ruby/rbs)はRubyプログラムの型を定義するための言語です。 + +3.0.0からは、次の様なアップデートがありました。 + +* ジェネリクスの型パラメータに制約を与えることができるようになりました。 ([PR](https://github.com/ruby/rbs/pull/844)) +* ジェネリックな型エイリアスが定義できようになりました。 ([PR](https://github.com/ruby/rbs/pull/823)) +* gemのRBSを管理するための`rbs collection`コマンドが導入されました。 ([doc](https://github.com/ruby/rbs/blob/master/docs/collection.md)) +* いろいろな組み込みクラスの型定義が追加、更新されました。 +* 多数のバグ修正と性能の改善が含まれています。 + +詳しくは[CHANGELOG.md](https://github.com/ruby/rbs/blob/master/CHANGELOG.md)を確認してください。 + +### TypeProf + +TypeProfはRubyの静的型解析器です。型注釈のないRubyコードから、RBSのプロトタイプを生成します。詳しくは[ドキュメント](https://github.com/ruby/typeprof/blob/master/doc/doc.md)をご参照ください. + +Ruby 3.0.0からの主なアップデートは、"TypeProf for IDE"という実験的なIDEサポートです。 + +![Demo of TypeProf for IDE](https://cache.ruby-lang.org/pub/media/ruby310_typeprof_ide_demo.png) + +このVSCode拡張は、推定された(またはRBSファイルに手で明記された)メソッドのシグネチャを、各メソッド定義の上に表示します。 +また、NameErrorやTypeErrorを起こしうるコードを赤い下線で示します。 +さらに、メソッド名の補完(メソッド名の候補の表示)を行います。 +詳しくは[ドキュメント](https://github.com/ruby/typeprof/blob/master/doc/ide.md)をご参照ください。 + +また、数多くのバグ修正やパフォーマンス向上がなされています。 + +## パフォーマンスの改善 + +* MJIT + * For workloads like Rails, the default `--jit-max-cache` is changed from 100 to 10000. + The JIT compiler no longer skips compilation of methods longer than 1000 instructions. + * To support Zeitwerk of Rails, JIT-ed code is no longer cancelled + when a TracePoint for class events is enabled. + + +## その他の注目すべき 3.0 からの変更点 + +* 一行パターンマッチ(たとえば `ary => [x, y, z]`)が実験的機能ではなくなりました。 + +* 多重代入の評価順序が若干変更されました。[[Bug #4443]](https://bugs.ruby-lang.org/issues/4443) + * `foo[0], bar[0] = baz, qux` は、Ruby 3.0 では `baz`, `qux`, `foo`, `bar` という順序で評価されていましたが、Ruby 3.1 では `foo`, `bar`, `baz`, `qux` の順で表kされます。 + +* 可変幅アロケーション(Variable Width Allocation)が実装されました。現在は試験的にStringが対応しています。 [[Bug #18239]](https://bugs.ruby-lang.org/issues/18239) + +* Psych 4.0 では `Psych.load` が `safe_load` を利用するように変更されました。この挙動が影響ある場合は、従来の挙動である `unsafe_load` を利用する Psych 3.3.2 を移行パスとして利用できます。[[Bug #17866]](https://bugs.ruby-lang.org/issues/17866) + +## 標準添付ライブラリのアップデート + +* 以下の default gems のバージョンがアップデートされました。 + * RubyGems 3.3.3 + * base64 0.1.1 + * benchmark 0.2.0 + * bigdecimal 3.1.1 + * bundler 2.3.3 + * cgi 0.3.1 + * csv 3.2.2 + * date 3.2.2 + * did_you_mean 1.6.1 + * digest 3.1.0 + * drb 2.1.0 + * erb 2.2.3 + * error_highlight 0.3.0 + * etc 1.3.0 + * fcntl 1.0.1 + * fiddle 1.1.0 + * fileutils 1.6.0 + * find 0.1.1 + * io-console 0.5.9 + * io-wait 0.2.1 + * ipaddr 1.2.3 + * irb 1.4.1 + * json 2.6.1 + * logger 1.5.0 + * net-http 0.2.0 + * net-protocol 0.1.2 + * nkf 0.1.1 + * open-uri 0.2.0 + * openssl 3.0.0 + * optparse 0.2.0 + * ostruct 0.5.2 + * pathname 0.2.0 + * pp 0.3.0 + * prettyprint 0.1.1 + * psych 4.0.3 + * racc 1.6.0 + * rdoc 6.4.0 + * readline 0.0.3 + * readline-ext 0.1.4 + * reline 0.3.0 + * resolv 0.2.1 + * rinda 0.1.1 + * ruby2_keywords 0.0.5 + * securerandom 0.1.1 + * set 1.0.2 + * stringio 3.0.1 + * strscan 3.0.1 + * tempfile 0.1.2 + * time 0.2.0 + * timeout 0.2.0 + * tmpdir 0.1.2 + * un 0.2.0 + * uri 0.11.0 + * yaml 0.2.0 + * zlib 2.1.1 +* 以下の bundled gems のバージョンがアップデートされました。 + * minitest 5.15.0 + * power_assert 2.0.1 + * rake 13.0.6 + * test-unit 3.5.3 + * rexml 3.2.5 + * rbs 2.0.0 + * typeprof 0.21.1 +* 以下のライブラリが新たに bundled gems になりました。Bundler から利用する場合は Gemfile に明示的に指定してください。 + * net-ftp 0.1.3 + * net-imap 0.2.2 + * net-pop 0.1.1 + * net-smtp 0.3.1 + * matrix 0.4.2 + * prime 0.1.2 + * debug 1.4.0 + + +その他詳細については、[NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md) ファイルまたは[コミットログ](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }})を参照してください。 + +なお、こうした変更により、Ruby 3.0.0 以降では [{{ release.stats.files_changed }} 個のファイルに変更が加えられ、{{ release.stats.insertions }} 行の追加と {{ release.stats.deletions }} 行の削除が行われました](https://github.com/ruby/ruby/compare/v3_0_0...{{ release.tag }}#file_bucket) ! + +メリークリスマス、様々な機能が追加された Ruby 3.1 をぜひお楽しみ下さい! + +## ダウンロード + +* <{{ release.url.gz }}> + + SIZE: {{ release.size.gz }} + SHA1: {{ release.sha1.gz }} + SHA256: {{ release.sha256.gz }} + SHA512: {{ release.sha512.gz }} + +* <{{ release.url.xz }}> + + SIZE: {{ release.size.xz }} + SHA1: {{ release.sha1.xz }} + SHA256: {{ release.sha256.xz }} + SHA512: {{ release.sha512.xz }} + +* <{{ release.url.zip }}> + + SIZE: {{ release.size.zip }} + SHA1: {{ release.sha1.zip }} + SHA256: {{ release.sha256.zip }} + SHA512: {{ release.sha512.zip }} + +## Ruby とは + +Rubyはまつもとゆきひろ (Matz) によって1993年に開発が始められ、今もオープンソースソフトウェアとして開発が続けられています。Rubyは様々なプラットフォームで動き、世界中で、特にWebアプリケーション開発のために使われています。 From 9d266cfb613f62b4adb37cf857aca5e93a96171b Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Sat, 25 Dec 2021 20:41:25 +0900 Subject: [PATCH 2196/3171] Ruby 3 1 0 released 2 (#2766) * fix videos * Add stats to _data/releases.yml --- _data/releases.yml | 5 +++++ en/news/_posts/2021-12-25-ruby-3-1-0-released.md | 5 ++--- ja/news/_posts/2021-12-25-ruby-3-1-0-released.md | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/_data/releases.yml b/_data/releases.yml index a7a6341109..d84d0c9226 100644 --- a/_data/releases.yml +++ b/_data/releases.yml @@ -24,6 +24,11 @@ - version: 3.1.0 date: 2021-12-25 post: /en/news/2021/12/25/ruby-3-1-0-released/ + tag: ruby_3_1_0 + stats: + files_changed: 3123 + insertions: 551754 + deletions: 99153 url: gz: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.gz zip: https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.zip diff --git a/en/news/_posts/2021-12-25-ruby-3-1-0-released.md b/en/news/_posts/2021-12-25-ruby-3-1-0-released.md index caf363cc42..9e80c9e092 100644 --- a/en/news/_posts/2021-12-25-ruby-3-1-0-released.md +++ b/en/news/_posts/2021-12-25-ruby-3-1-0-released.md @@ -71,11 +71,10 @@ The IRB now has an autocomplete feature, where you can just type in the code, an If documents are installed when you select a completion candidate, the documentation dialog will appear next to the completion candidates dialog, showing part of the content. You can read the full document by pressing Alt+d. -