2014/07/31分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actionmailer/CHANGELOG.md
Deprecate *_path
methods in mailers
mailersで*_path
メソッドはdeprecateになりました。代わりに、 *_url
を使用するようにとの事です。
そもそもメール文中に相対パスで記載するのはおかしいので、絶対パスで書こうね、との事で。
Prevent using String#scrub on Rubinius
activesupport/lib/active_support/multibyte/unicode.rb
の修正です。
Rubiniusの場合、String#scrub
を使用しないよう対応しています。String#scrub
メソッド自体はあるらしいのですが、ASCII外文字は対応していない為との事です。
Remove redundant self.
in class method calls
activerecord/lib/active_record/migration.rb
の修正です。
不要なself.
を削除しています。
add
will remove the method if it exists already
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
define_url_helper
メソッド内でremove_possible_method
を行っていたのを削除しています。何故、かは良く解らない…。この処理に来る前に削除されているからなのかなあ。
split path_helpers and url_helpers
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
元々helpers
変数にpath_helpersとurl_helpers両方保持していたのを、それぞれ別変数に保持するようリファクタリングしています。処理がスッキリして良い感じです。
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
変数名をroute_methods
->url_helpers
に修正しています。
avoid instrospection on the module
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
instance_methods
を使用して取得していたpath_helpers
の情報を、メソッドを使用せず、先程のコミットで対応した変数を使用するよう修正しています。
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
不要なalias_method_chain
を削除しています。
don't access named routes internals
actionview/lib/action_view/test_case.rb
の修正です。
routingが設定済みかどうかを確認するのに、route_defined?
メソッドを使用するよう修正しています。
Removed unnecessary call to 'convert_key' in 'HashWithIndifferentAccess#to_hash'
HashWithIndifferentAccess#to_hash
メソッドの修正です。
不要なconvert_key
処理を削除しています。keyは全てStringに変換済みなので、不要との事です。
turn scope in to a linked list
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
scope格納用にScope
クラスを新設し、連結リストでデータを保持するよう修正しています。
push options inside the scope object
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
SCOPE_OPTIONS
を先程作成したScope
クラス配下に格納するよう修正しています。
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
不要なdup
メソッドを削除しています。
Remove some globals from configuration tests
railties/test/application/configuration_test.rb
の修正です。
グローバル変数に設定していた値を、Rails.configuration
配下の変数に設定するよう修正しています。
railties/test/application/configuration_test.rb
の修正です。
適切なassertメソッドを使用したり、assert_equal
の引数の順番が誤っていたのを修正しています。
そもそもこのテスト、assert_equal
ではなく、assert
、assert_not
を使用した方がテストが明確になる気が。
Remove some more globals from tests
railties/test/application/multiple_applications_test.rb
の修正です。
グローバル変数をローカル変数に変更しています。そもそもグローバルである必要が無かった感じです。
Invert unless..else conditions on JRuby checks
railties/test/generators/app_generator_test.rb
の修正です。
JRubyのチェック処理でunless..elseを使用していたのをif..elseに修正しています。if..elseの方が分り易い、という判断何ですかね。
Simplify plugin tests a bit, leave the regexp work for minitest
railties/test/generators/plugin_generator_test.rb
の修正です。
テスト内で行っていたRegexp.escape
を削除しています。assert_match
メソッド、Regexp.escape
無しでも正常に動作する為のようです。
railties/test/generators/generators_test_helper.rb
の修正です。
file load処理を修正しています。
- @root ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'fixtures')) + @root ||= File.expand_path('../../fixtures', __FILE__)
個人的には修正前の方が好みですねえ。
Use default argument when testing generators without the need for extra args
railties/test/generators/app_generator_test.rb
の修正です。
run_generator
呼び出し時に設定していた引数を削除しています。デフォルト引数で問題無い箇所についてのみ対応しているようです。
Avoid defining the test if it does not need to when not on JRuby
railties/test/generators/app_generator_test.rb
の修正です。
JRubyのチェック処理をメソッド定義の外側で行うよう修正しています。
- def test_config_jdbc_database_when_no_option_given - if defined?(JRUBY_VERSION) + if defined?(JRUBY_VERSION) + def test_config_jdbc_database_when_no_option_given
Properly assert for the expected messages
actionview/test/activerecord/polymorphic_routes_test.rb
の修正です。
エラーがraiseされたかどうか確認していたのを、エラーメッセージの内容を確認するよう修正しています。
- assert_raise ArgumentError, "Nil location provided. Can't build URI." do + exception = assert_raise ArgumentError do polymorphic_url(nil) end + assert_equal "Nil location provided. Can't build URI.", exception.message
本来やりたかった事はこっちな気がします。
Raise a descriptive error if non-positive integer passed to in_groups_of.
activesupport/lib/active_support/core_ext/array/grouping.rb
の修正です。
Array#in_groups_of
に0以下の値を設定した場合に、ArgumentErrorをおこすよう修正しています。
[1, 2, 3].in_groups_of(0) # =>ArgumentError: Group size must be a positive integer, was 0
エラーが明確で分り易くなってますね。
activesupport/test/core_ext/hash_ext_test.rb
の修正です。
HashWithIndifferentAccess
のコンストラクタにブロックを指定した場合のテストケースを追加しています。
Remove unnecessary call to #tap
actionpack/test/dispatch/routing_test.rb
の修正です。
ActionDispatch::Routing::RouteSet
を生成している箇所で不要なtap
メソッドを削除しています。
activesupport/lib/active_support/hash_with_indifferent_access.rb
の修正です。
不要なHash生成処理を行わないよう修正しています。
activesupport/test/subscriber_test.rb
の修正です。
test_does_not_attach_private_methods
テストで、assertの引数の順番が誤っていたのを集成しています。
actionpack/lib/action_controller/metal/url_for.rb
の修正です。
不要なHash生成処理を行わないよう修正しています。merge
ではなく、`merge!を使用するようにしています。
Simplify code branch, remove #tap
actionpack/lib/action_controller/metal/url_for.rb
の修正です。
tap
メソッドを削除し、値を変数に格納するよう修正しています。
- @_url_options.dup.tap do |options| + options = @_url_options.dup
インデントが一つ減っているので、ちょっと見通しは良くなかったかと。