なるようになるブログ

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

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

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

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


Shrink a couple of deprecation warnings to one-liners

actionpack/lib/action_dispatch/http/mime_type.rbの修正です。

deprecationメッセージに不要な空白が大量にあったのを、他のdeprecationメッセージ同様1行で表示するよう修正しています。


Move command_name_for to private section.

railties/lib/rails/commands/command.rbの修正です。

Rails::Commands::Command.command_name_forメソッドを、privateセクションに移動しています。


exists? isn't for users.

railties/lib/rails/commands/command.rbのdocのです。

rails内部用APIRails::Commands::Command#exists?メソッドに、:nodoc:を設定しています。


Spruce up command_for.

railties/lib/rails/commands/command.rbの修正です。

Rails::Commands::Command.command_name_forメソッドリファクタリングとして、不要なnilのリターンの削除、不要な一時変数の削除を、行っています。


Default argv to an empty array.

railties/lib/rails/commands/command.rbの修正です。

Rails::Commands::Command.newメソッドargv引数のデフォルト値を空のStringから空のArrayに変更しています。RubyARGVはArrayであり、それに型を合わせる為。


Remove _instance suffix from command.

railties/lib/rails/commands/command.rbの修正です。

Rails::Commands::Command#runメソッドで使用している各コマンドクラスを格納する変数の名前をcommand_instance -> commandに省略可しています。


Merge pull request #22202 from grosser/grosser/write-consistent

activesupport/lib/active_support/cache/mem_cache_store.rbの修正です。

MemCacheStoreクラスでデータの書き込みに失敗した場合も、成功した場合同様raw valueを返すよう修正しています。


Replace -> {} with a proc.

railties/lib/rails/commands/command.rbの修正です。

Rails::Commands::Command#parse_options_forメソッドでコマンドオプションをfetchする際に、ラムダ式->にを使用していたのをprocを使用するよう修正しています。引数を複数受け取れるようにする為。


Merge pull request #19977 from prathamesh-sonpatki/mention-redirect-path-in-assert-response

actionpack/lib/action_dispatch/testing/assertions/response.rbの修正です。

assert_responseメソッドで、redierct処理が行われた場合、エラーメソッドに明確にredirect処理が行われた旨表示するよう修正しています。

# before
Expected response to be a <success>, but was <302>

# after
Expected response to be a <success>, but was a redirect to <http://test.host/posts/lol>

Add class level run to Rails command.

railties/lib/rails/commands/command.rbrailties/lib/rails/commands/commands_tasks.rbの修正です。

Rails::Commands::Command.runメソッドを追加しています。.runメソッドでは、タスク名からコマンド名への変更、及びコマンドがあればそのコマンドの実行(実行はRails::Commands::Command#runメソッドで実行)を行うようになっています。


Remove "run with rake" suggestion.

railties/lib/rails/commands/commands_tasks.rbの修正です。

bin/rails経由でコマンドが見つからなかった場合に、rake経由でタスクを実行するようサジェストを表示していたのを、サジェストを表示しないよう修正しています。

全てのrakeタスクをbin/rails経由で実行出来るようにする予定であり、rakeを使用する必要はなくなる為、との事です。


Invert command and commands tasks reference.

railtiesのcommand処理の修正です。

commands tasksとcommand classの参照の順番を逆に(command classの参照を先に)しています。

元々のbin/railsのtask(generate、server等)もいずれcommand classを作成し、そちら経由で実行するようにする為のようです。


Ditch Commands namespace for base command.

railtiesのcommand処理の修正です。

Rails::Commands::CommandクラスをRails::Commandに移動(Commands namespaceを削除)しています。