2015/03/01分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Merge pull request #18965 from hjoo/rake_restart
railties/lib/rails/tasks.rb
、
railties/lib/rails/tasks/restart.rake
の修正です。
rake restart
タスクを追加しています。中身はtmp/restart.txt
をtouch
しているだけです。
[ci skip] Update documentation for Range#to_formatted_s
activesupport/lib/active_support/core_ext/range/conversions.rb
のdocの修正です。
Range#to_formatted_s
メソッドのdocに、exampleを追加及び独自のformatを追加する方法についての説明を追加しています。
rails guideのActive Support Core Extensions
の修正です。
to_query
メソッドのexampleで、出力例の部分をクォートされてなかったのを修正しています。
rails guideのActive Support Core Extensions
の修正です。
String#remove
メソッドのexampleの出力例のコメントの箇所に#
が無かったのを追加しています。
Reduce allocated memory for Module#delegate.
activesupport/lib/active_support/core_ext/module/delegation.rb
の修正です。
Module#delegate
メソッドで、メモリ割り当てを削減するよう改善しています。
- file, line = caller.first.split(':', 2) + file, line = caller(1, 1).first.split(':', 2)
テストスクリプトは以下。
require 'test_helper' class DocumentsIntegrationTest < ActionDispatch::IntegrationTest test "create" do post '/documents', params: { document: { title: "New things", content: "Doing them" } } document = Document.last assert_equal 'New things', document.title assert_equal 'Doing them', document.content end end report = MemoryProfiler.report do Minitest.run_one_method(DocumentsIntegrationTest, 'test_create') end report.pretty_print
実行結果。
# before allocated memory by gem ----------------------------------- activesupport/lib x 486470 allocated memory by file ----------------------------------- /home/guoxiang/work/rails-dev-box/rails/activesupport/lib/active_support/core_ext/module/delegation.rb x 195005 allocated memory by location ----------------------------------- /home/guoxiang/work/rails-dev-box/rails/activesupport/lib/active_support/core_ext/module/delegation.rb:170 x 136119
# after llocated memory by gem ----------------------------------- activesupport/lib x 354170 allocated memory by file ----------------------------------- /home/guoxiang/work/rails-dev-box/rails/activesupport/lib/active_support/core_ext/module/delegation.rb x 62705 allocated memory by location ----------------------------------- # Does not show in report
[ci skip] Add code examples for Module#anonymous? documentation
activesupport/lib/active_support/core_ext/module/anonymous.rb
のdocの修正です。
Module#anonymous?
メソッドのdocにexampleを追加しています。
drop allocations when handling model url generation
actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
の修正です。
Stringオブジェクトの生成処理を減らすよう修正しています。
- named_route = prefix + "#{name}_#{suffix}" + named_route = "#{prefix}#{name}_#{suffix}"
activejob/README.md
の修正です。
Sending
-> sending
、API documentation is at
-> API documentation is at:
にそれぞれ修正しています。
guides/Rakefile
の修正です。
kindlegen
のリンクを http://www.amazon.com/kindlepublishing
-> http://www.amazon.com/gp/feature.html?docId=1000765211
に修正しています。
[ci skip] Fix fenced code block lang
rails guideのForm Helpers
の修正です。
Basic Structures
の項のexample
のmarkdownの言語の設定をerb
-> ruby
に修正しています。
Fix segmentation fault in ActionPack tests
actionpack/test/dispatch/response_test.rb
の修正です。
rails本体のバグ(Segfault from keyword rest arg when coercing an object that defines to_hash)の影響でsegmentation faultしてしまうActionPackのテストがあったのを修正しています。
args + kwargsの組み合わせでセグフォルしてしまうようです。
例。
def foo(*args, **kwargs) puts "args: #{args}" puts "kwargs: #{kwargs}" end foo('foo' => 'bar')
とりあえずテストのコードの方を修正しています。
Lines of code can be 100,000+ in a Rails app
railties/lib/rails/code_statistics.rb
の修正です。
5桁までしか出力する事を想定してなかったrake stats
を、コードの行数が6桁以上の場合でも崩れず表示されるよう修正しています。
rails guideのRuby on Rails 4.0 Release Notes
の修正です。
Major Features
の一覧で行の最後にピリオドが無い箇所があったのを追加しています。