なるようになるブログ

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

rails commit log流し読み(2015/06/01)

2015/06/01分のコミットです。

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

activesupport/CHANGELOG.md

actionpack/CHANGELOG.md


Use any? rather than present? to check args

actionpack/lib/action_controller/test_case.rbactionpack/lib/action_dispatch/testing/integration.rbの修正です。

引数の配列に値が設定されているかどうか確認するのに、present?メソッドを使用していたのを、any?メソッドを使用するよう修正しています。

presentメソッドActiveSupportで提供しているメソッドであり、極力他のライブラリに依存しないようにする為に、Ruby標準のany?メソッドを使用するようにしたとの事です。


Fixed typos. [ci skip]

guides/source/documents.yamlの修正です。

各guideのdescriptionにあった、タイポ・グラマーの修正を行っています。


[ci skip] Fix above -> below

rails guideのDevelopment Dependencies Installの修正です。

The Hard Wayの項、see section belowsee section aboveにタイポしていたのを修正しています。


Remove description of dependency_loading option

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

既に存在しないconfig.dependency_loadingについての説明を削除しています。


Fix a range of values for parameters of the Time#change

activesupport/lib/active_support/core_ext/time/calculations.rbの修正です。

Time#changeメソッドnsecオプションに999999999を指定した場合に、エラーにならないよう修正しています。

以下のような値を指定した場合に、エラーになってしまっていたとの事です。

Time.new(2015, 5, 9, 10, 00, 00, '+03:00').change(nsec: 999999999) # => ArgumentError: argument out of range
Time.new(2015, 5, 9, 10, 00, 00, '+03:00').change(usec: Rational(999999999, 1000)) # => ArgumentError: argument out of range

[ci skip] Used 'instance_variables' in example for consistency.

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

byebugの使い方に説明している箇所で、instance_variablesメソッドについて説明している箇所で、実際の実行結果とexampleが違う箇所があったのを修正しています。


actually test what the name says

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

Authorization ヘッダーのテストで、実際のデータに近い値でテストを行うよう修正しています。


allow Bearer as well as Token

actionpack/lib/action_controller/metal/http_authentication.rbの修正です。

Authorization-HeaderのtokenキーワードにBearerを指定できるよう修正しています。

RFC 6750 - The OAuth 2.0 Authorization Framework: Bearer Token Usage によると、Bearerも指定可能との事です。知らなかった。


[skip ci] Update documentation for QueueAdapters::lookup

activejob/lib/active_job/queue_adapters.rbのdocの修正です。

QueueAdapters::lookupメソッドにdocを追加しています。


Map :bigint as NUMBER(19) sql_type by using :limit => 19 for Oracle

activerecord/test/cases/connection_adapters/type_lookup_test.rbactiverecord/test/cases/migration/change_schema_test.rbの修正です。

OracleAdapterの場合、bigintを指定した場合NUMBER(19)にmapされるので、テストを`NUMBER(19)'に変換される旨内容を修正しています。

         if current_adapter?(:OracleAdapter)
-          assert_equal 'NUMBER(8)', eight.sql_type
+          assert_equal 'NUMBER(19)', eight.sql_type
         elsif current_adapter?(:SQLite3Adapter)

Use --no-document option instead of --no-rdoc and --no-ri option

install.rbの修正です。

gemのインストールの際、--no-ri --no-rdocオプションの代わりに、--no-documentオプションを使用するよう修正しています。--no-ri--no-rodcオプションがdeprecateになっていたんですね。知らなかった。ご参考: Command Reference - RubyGems Guides