なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2016/06/07)

2016/06/07分のコミットです。

CHANGELOGへの追加はありませんでした。


Merge pull request #25279 from maclover7/jm-add-backticks-1

rails guideのRuby on Rails 5.0 Release Notesの修正です。

ActiveRecord::Base.whereメソッドについて説明している箇所に、バッククォートを追加しています。


Merge pull request #25283 from javan/actioncable/blade-on-eventmachine1-2

GemfileGemfile.lockの修正です。

最新のバージョンを使えるようにする為に、bladeblade-sauce_labs_pluginのバージョン固定を外しています。Action Cableのテストを通せるようにする為との事です。


Merge pull request #25294 from Zorbash/cache-fetch-race-condition-ttl-doc https://github.com/rails/rails/pull/25294 activesupport/lib/active_support/cache.rbのdocの修正です。

ActiveSupport::Cache::Store#fetchメソッドのdoc内のexampleで、race_condition_ttlオプションにActiveSupport::Durationの値を指定するよう修正しています。

      #   Thread.new do
-      #     val_1 = cache.fetch('foo', race_condition_ttl: 10) do
+      #     val_1 = cache.fetch('foo', race_condition_ttl: 10.seconds) do
       #       sleep 1

race_condition_ttlにはActiveSupport::Durationの値を指定するのが正しい為。


Require Nokogiri >= 1.6.8

GemfileGemfile.lockの修正です。

1.6.8以上のnokogiriを使用するよう修正しています。1.6.8で複数のCVEの対応が行われている為。参考:[ANN] nokogiri security update


Do not suggest nonsensical OpenSSL verify modes [ci skip]

actionmailer/lib/action_mailer/base.rbのdoc、 guides/source/action_mailer_basics.md及びguides/source/configuring.mdの修正です。

ActionMailersmtp_settingsオプションに設定出来る値の一覧の例、client_once(SSL_VERIFY_CLIENT_ONCE)、fail_if_no_peer_cert(SSL_VERIFY_FAIL_IF_NO_PEER_CERT)が記載されいたのを、削除しています。

SMTPコネクションでは、OpenSSLのソケットはclient modeが使われるのですが、SSL_VERIFY_CLIENT_ONCESSL_VERIFY_FAIL_IF_NO_PEER_CERTオプションはclient modeでは無視されるので、例としては不適切だろうという事で削除したようです。

SSL_VERIFY_FAIL_IF_NO_PEER_CERT
  Server mode: if the client did not return a certificate, the TLS/SSL
handshake is immediately terminated with a "handshake failure" alert.
This flag must
  be used together with SSL_VERIFY_PEER.

  Client mode: ignored

SSL_VERIFY_CLIENT_ONCE
  Server mode: only request a client certificate on the initial TLS/SSL
handshake. Do not ask for a client certificate again in case of a
renegotiation.
  This flag must be used together with SSL_VERIFY_PEER.

  Client mode: ignored

Remove FORCE option as it was only needed for tests

railties/lib/rails/tasks/framework.rakeの修正です。

templateタスクでRails::Generators::AppGeneratorインスタンスを生成する際にforceオプションを使用していたのを、使用しないよう修正しています。

          gen = Rails::Generators::AppGenerator.new ["rails"],
-                                                    { api: !!Rails.application.config.api_only, update: true, force: ENV['FORCE'] },
+                                                    { api: !!Rails.application.config.api_only, update: true },

テストでのみ使用していた為、テストの方を調整するようにし対応しています。