なるようになるブログ

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

rails commit log流し読み(2015/10/23)

2015/10/23分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

actionpack/CHANGELOG.md


config.generators should be docummented since it is public API

railties/lib/rails/engine/configuration.rbのdocの修正です。

config.generatorsメソッドから、:nodoc:の指定を削除しています。

config.generatorsはpublic API(ユーザが通常使用するメソッド)の為、API docに表示されるよう、:nodoc:を削除したようです。


[ci skip] removed extra comma

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

Active Jobの項の説明部分から、不要と思われるカンマを削除しています。

-[Sidekiq](https://github.com/mperham/sidekiq), and more.
+[Sidekiq](https://github.com/mperham/sidekiq) and more.

が、元のカンマ書き方(Oxford comma)が今のRailsのdocのguideline的には正しい為、すぐrevertされています。


Revert "[ci skip] removed extra comma"

というわけで、[ci skip] removed extra comma をrevertしています。


API guidelines reword re the Oxford comma [ci skip]

rails guideのAPI Documentation Guidelinesの修正です。

Commaの項のタイトルを、Oxford Commaに修正しています。


[ci skip] Add more code examples for Module#anonymous? docs

activesupport/lib/active_support/core_ext/module/anonymous.rbのdocの修正です。

Module#anonymous?メソッドのdocにexampleを追加しています。


Remove no need binds.empty? checking

activerecord/lib/active_record/connection_adapters/mysql_adapter.rbの修正です。

exec_stmtメソッド内で行っていたbinds引数がemptyかどうかのチェック処理を削除しています。

exec_stmtメソッドはprivate methodで、exec_queryメソッドからしか呼び出されておらず、そこでbindsは必ず設定されるため、との事です。


remove unnecessary readme in dummy application

railties/lib/rails/generators/rails/plugin/plugin_generator.rbの修正です。

plugin generatorがdummy applicationを作成する、不要なREADMEを削除するよう修正しています。


FIX: Randomly failing test when running without GIL.

actionpack/test/controller/live_stream_test.rbの修正です。

GILのないJRubyなどでlive streamingのテストがコケてしまう事があったのを修正しています。

     def test_exception_callback_when_committed
+      current_threads = Thread.list
+
       capture_log_output do |output|
         get :exception_with_callback, format: 'text/event-stream'
+
+        # Wait on the execution of all threads
+        (Thread.list - current_threads).each(&:join)

スレッドの終了待ちが足りてなかったようですねえ。


Catch invalid UTF-8 querystring values and respond with BadRequest

actionpack/lib/action_dispatch/http/request.rbactionpack/lib/action_dispatch/request/utils.rbの修正です。

クエリ文字列に不正なUTF8データが無いかチェック、及び、不正な値があった場合ActionController::BadRequestをraiseするよう修正しています。