なるようになるブログ

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

rails commit log流し読み(2015/05/14)

2015/05/14分のコミットです。

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

activesupport/CHANGELOG.md

actionview/CHANGELOG.md


Add Integer#positive? and Integer#negative? query methods in the vein of Fixnum#zero?

activesupport/lib/active_support/core_ext/integer/inquiry.rbの修正です。

値が正負かどうかの判定をするためのInteger#positive?Integer#negative?メソッドを追加しています。

1.positive?  # => true
0.positive?  # => false
-1.positive? # => false

-1.negative? # => true
0.negative?  # => false
1.negative?  # => false

Ruby本体にNumeric#positive?Numeric#negative?メソッドがあっても良いのでは、という流れになっておりmatzのAcceptも出たようなので、いずれRuby本体に入るかもですねえ。

Feature #11151: Numeric#positive? and Numeric#negative? - Ruby trunk - Ruby Issue Tracking System


Minor comment fix. [ci skip]

activesupport/lib/active_support/core_ext/integer/inquiry.rbのdocの修正です。

Integer#negative?メソッドのdocがInteger#positive?メソッドのdocと全く同じになていたのを、適切な内容に修正しています。


Rails documentation standard is american english. [ci skip]

RELEASING_RAILS.rdocのdocの修正です。

realise -> realizeにアメリカ英語を使用するよう修正しています。


remove redundant parenthesis.

actionview/test/template/atom_feed_helper_test.rbの修正です。

メソッド呼び出し時に不要な丸括弧(数が多かった)があったのを削除しています。


remove redundant parenthesis

activerecord/test/cases/type/integer_test.rbの修正です。

先のコミット同様、メソッド呼び出し時に不要な丸括弧(数が多かった)があったのを削除しています。


[ci skip] Improve phrasing in AR migrations docs.

rails guideのActive Record Migrationsの修正です。

グラマーの修正を行っています。


Do not put partial name to local_assigns when rendering without an object

actionview/lib/action_view/renderer/partial_renderer.rbの修正です。

object / collectionの指定無しにpartialメソッドを使用した際、local_assignsメソッドに部分テンプレート名を設定しないよう修正しています。

# _partial_name_in_local_assigns.erb
<%= local_assigns.has_key?(:partial_name_in_local_assigns) %>
render(partial: 'test/partial_name_in_local_assigns') => # false
render(partial: 'test/partial_name_in_local_assigns', object: nil) # => true

Merge pull request #20113 from claudiob/remove-rails31-refs

メソッドのdocの修正です。

docからRails 3系の挙動について説明している箇所を削除しています。


remove warning from integer ext test

activesupport/test/core_ext/integer_ext_test.rbの修正です。

Integer#positive?Integer#native?メソッドのテストでwarning: ambiguous first argumentのwarningが出力されていたので、メソッドの引数を括弧で囲んで対応しています。