2015/07/11分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- active_support/indifferent_hash: fix cloning default_proc on dup
- active_support/indifferent_hash: dont raise on to_hash when default_proc raises
active_support/indifferent_hash: fix cloning default_proc on dup
activesupport/lib/active_support/hash_with_indifferent_access.rb
の修正です。
default_proc
を設定したHashWithIndifferentAccess
のオブジェクトをdup
した際に、default_proc
に設定した情報が正しく渡せていなかったバグがあったのを修正しています。
active_support/indifferent_hash: dont raise on to_hash when default_proc raises
activesupport/lib/active_support/hash_with_indifferent_access.rb
の修正です。
HashWithIndifferentAccess
にdefault_proc
を設定し、かつdefault_proc
内でraise
した場合の挙動が、RubyのHash
と異なっていたのを、挙動を合わせるよう修正しています。
h = HashWithIndifferentAccess.new h.default_proc = proc { |h, k| raise "OMG" } h.dup # => RuntimeError: OMG h = {} h.default_proc = proc { |h, k| raise "OMG” } h.dup # => {}
test/hash: move lonely indifferent hash test
activesupport/test/hash_with_indifferent_access_test.rb
にあったテストを、他のHashWithIndifferentAccess
のテスト同様、activesupport/test/core_ext/hash_ext_test.rb
内に移動しています。
Reuse the same test for HWIA reverse_merge!
activesupport/test/core_ext/hash_ext_test.rb
の修正です。
別のテストケースとして2つ定義されていたHashWithIndifferentAccess#reverse_merge!
メソッドに関するテストを、ひとつのテストケース内で行うよう整理しています。
drop a conditional by always assigning
actionpack/lib/action_dispatch/middleware/params_parser.rb
の修正です。
ParamsParser#call
メソッドから、params
の存在チェック処理を削除しています。params
は必ず設定されている筈であり、チェックは不要な為との事です。
start disconnecting the parameter parser from the instance
actionpack/lib/action_dispatch/middleware/params_parser.rb
の修正です。
ParamsParser#parse_formatted_parameters
メソッドの引数にparsers
を追加しています。
元々はインスタンス変数を参照するようになっていたのですが、インスタンスから変数を削除するリファクタリングを行う為、必要に応じて値を渡せるようにしたようです。
Require yaml for time_with_zone isolation test
activesupport/test/core_ext/time_with_zone_test.rb
の修正です。
yaml
のrequireが不足していたのを追加しています。
encode / decode parameters before assigning them to the request
actionpack/lib/action_controller/test_case.rb
の修正です。
テスト用にrequestオブジェクトにパラメータを設定する前に、パラメータのエンコード/デコード処理を行うよう修正しています。
実際使われる場合(ブラウザからのリクエストの場合)に近い形でテストした方が良いだろう、という事で修正したようです。
actionpack/lib/action_controller/test_case.rb
の修正です。
TestRequest#assign_parameters
メソッドから、パラメータのdup処理を削除しています。
パラメータをシリアライズするようになり、dupする必要がなくなった為との事。
actionpack/lib/action_controller/test_case.rb
の修正です。
assign_parameters
メソッド内のnon_path_parameters
変数をHashWithIndifferentAccess
クラスからHash
クラスに変更しています。
non_path_parameters
は内部用の変数であり、HashWithIndifferentAccess
を使用する必要は無い為との事です。
Parameters are converted to a query string
actionpack/lib/action_controller/test_case.rb
の修正です。
TestCase#process
で行っていたパラメータのフォーマット処理を削除しています。パラメータは文字列として扱うようになり、不要になった為削除したようです。
start collecting env
mutations
actionpack/lib/action_controller/test_case.rb
の修正です。
TestCase#assign_parameters
メソッドの各箇所で行われていたenv
Hashへの値の設定処理を、一ヶ所にまとめています。
call the path_parameters=
setter rather than rely on mutations
actionpack/lib/action_controller/test_case.rb
の修正です。
pathパラメータを設定するのに、path_parameters
メソッドを使用するよう修正しています。
actionpack/lib/action_controller/test_case.rb
の修正です。
assign_parameters
メソッドから使用していない変数を削除しています。
always default the SCRIPT_NAME to whatever is on the controller
actionpack/lib/action_controller/test_case.rb
の修正です。
build_request_uri
メソッドで、env["SCRIPT_NAME"]
を必ず設定処理を行うよう修正しています。
default PATH_INFO
to the generated path
actionpack/lib/action_controller/test_case.rb
の修正です。
assign_parameters
メソッドで、@env["PATH_INFO"]
に既に生成済みのpathの情報を設定するよう修正しています。
actionpack/lib/action_controller/test_case.rb
の修正です。
build_request_uri
メソッドからenv["PATH_INFO"]
の設定処理を削除しています。
先のコミットにより、assign_parameters
メソッドでPATH_INFO
を設定するようになり、不要になった為との事です。
we don't really need an extra method to set the script name
actionpack/lib/action_controller/test_case.rb
の修正です。
先のコミットにより、build_request_uri
メソッドがSCRIPT_NAME
を設定する1行だけの処理になってしまったので、メソッドを削除し、process
メソッド内で直接SCRIPT_NAME
を設定するよう修正しています。
Add multiple expected calls to assert_called_with.
activesupport/lib/active_support/testing/method_call_assertions.rb
の修正です。
assert_called_with
メソッドに、一つのメソッドに複数の引数を渡すパターンを一度に渡せるよう対応しています。
Use private method call assertions in Active Model tests.
ActiveModelのテストの修正です。
mockが必要なテストで、Minitest::Mock
を使用していたのを、assert_called_with
メソッドを使用するよう修正しています。
Require yaml for time_zone isolation test.
activesupport/test/time_zone_test.rb
の修正です。
yaml
のrequireが不足していたのを追加しています。
Merge pull request #17102 from matthewd/load-interlock
もともと、eager_load
及びcache_classes
を使用していない場合、マルチスレッド環境ではタイミングによりクラスのロード処理が上手くいかないケースがあり、その対応として、Webrick
を使用している場合に限り、Rack::Lock
を使用するようにしてリクエストが同期的に処理が行わるようになっていました。
ただRack::Lock
ではリクエスト全体に影響が出てしまい、パフォーマンス的に宜しく無いので、クラスのロード処理(ActiveSupport::Dependencies
)の中に新規にマルチスレッド処理用のクラス(ActiveSupport::Dependencies::Interlock
)を作成し、そちらで排他処理を実施するよう修正しています。
Require yaml for XML mini isolation test.
activesupport/test/xml_mini_test.rb
の修正です。
yaml
のrequireが不足していたのを追加しています。
railties/lib/rails/commands/server.rb
の修正です。
ActionDispatch::LoadInterlock
の対応に伴い、不要になったRack::Lock
を使用しないよう修正しています。
Remove the reference to mocha in activemodel
activemodel/test/cases/validations/i18n_validation_test.rb
のdocの修正です。
テスト内のコメントに、mochaを使用している、というコメントがあるのですが、実際はもう使用していない為、コメントを修正しています。
the key is that the behavior is incorrect [ci skip]
rails guideのContributing to Ruby on Rails
の修正です。
What about Feature Requests?
の項、バグとフィーチャーの違いついて説明している箇所の言い回しの修正を行っています。
Merge pull request #20838 from TheBlasfem/improve_duplicable_documentation
activesupport/lib/active_support/core_ext/object/duplicable.rb
のdocの修正です。
Object#duplicable?
メソッドのdocのduplicate出来ない対象の一覧にmethod
を追加、及びBigDecimal#duplicable?
メソッドのdocを追加しています。
activesupport/CHANGELOG.md
の修正です。
HashWithIndifferentAccess
をHashWithIndifferentAcess
にタイポしていたのを修正しています。
Removes unnecessary comments from i18n validations tests [ci skip]
activemodel/test/cases/validations/i18n_validation_test.rb
の修正です。
テスト内のコメントに、mochaを使用している、というコメントがあるのですが、実際はもう使用していない為、コメントを修正しています。