なるようになるブログ

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

rails commit log流し読み(2016/01/11)

2016/01/11分のコミットです。

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


Merge pull request #21995 from tak1n/master

rails guideのConfiguring Rails Applicationsの修正です。

Custom configurationの項に、#config_forメソッドを使用した場合のexampleを追加しています。


Merge pull request #22983 from bronson/update-mysql-in-guides

rails guideのContributing to Ruby on RailsDevelopment Dependencies Installの修正です。

Merge pull request #22642 from seuros/remove-mysql-adapter · rails/rails@4a58aef でRail本体から削除された古いMySQL adapterについての説明が残っている箇所があったので、まとめて削除しています。


Merge pull request #21181 from denisenkom/mypatch

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

basic authのpasswordに記号を使用した場合のテストを追加しています。


Added multiple line filters support for test runner

railties/lib/rails/test_unit/line_filtering.rbの修正です。

test runnerで行を指定してテストを実行する際に、複数行を指定出来るよう対応しています。

PRより。

# test/models/user_test.rb
require 'test_helper'

class UserTest < ActiveSupport::TestCase
  test "the truth" do
    assert_equal 3, 2 + 1
  end

  test "the false" do
    assert_equal 3, 1 + 1
  end
end
bin/rails test test/models/user_test.rb:4:8

上記を実行すると、4行目(the truth)と8行目(the false)の両方のテストが実行されます。

上記の例だと2つですが、:を繋げる事で、幾つでもまとめて実行出来るようになっています。


Pass the current locale to Inflector from the pluralize text helper.

actionview/lib/action_view/helpers/text_helper.rbの修正です。

pluralize text helperに現在のlocaleがデフォルトで設定されるよう対応しています。

合わせて、元々第三引数に指定していたpluralがキーワード引数に変更になっており、今後値を渡す場合はキーワード引数として指定する必要があります。

helper.pluralize(1, 'person', 'people')
#=> DEPRECATION WARNING: Passing plural as a positional argument is deprecated and will be removed in Rails 5.1. Use e.g. pluralize(1, 'person', plural: 'people') instead

Extract MySQL::Column class to connection_adapters/mysql/column.rb

Active Recordの修正です。

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rbに定義されていたMySQL::Columnクラスを、別ファイル(connection_adapters/mysql/column.rb)に切り出しています。


Extract MySQL::TypeMetadata class to connection_adapters/mysql/type_metadata.rb

Active Recordの修正です。

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rbに定義されていたMySQL::MysqlTypeMetadataクラスを、別ファイル(connection_adapters/mysql/type_metadata.rb)に切り出しています。


remove warnings from rake test

railties/test/application/rake_test.rbの修正です。

rakeのテストでRubyのワーニング(ambiguous first argument; put parentheses or a space even after/' operator)が出ていたので、メソッドを()`で囲って対応しています。


delete only unnecessary reporter

railties/lib/rails/test_unit/minitest_plugin.rbの修正です。

Minitest.plugin_rails_initメソッドで、ロード済みのminitest reporterを全て削除していたのを、railsのreporterに影響があるるreporter(SummaryReporterProgressReporterクラス及びその子クラス)のみ削除するよう修正しています。

railsのreporterに影響が無いreporterについては、そのまま利用したかった為。