diff options
-rw-r--r-- | railties/lib/rails/source_annotation_extractor.rb | 2 | ||||
-rw-r--r-- | railties/test/application/rake/notes_test.rb | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb index b5f1ca1602..af6d90b5bd 100644 --- a/railties/lib/rails/source_annotation_extractor.rb +++ b/railties/lib/rails/source_annotation_extractor.rb @@ -28,7 +28,7 @@ class SourceAnnotationExtractor self.extensions[/\.(#{extensions.join("|")})$/] = block end - register_extensions("builder", "rb", "rake") { |tag| /#\s*(#{tag}):?\s*(.*)$/ } + register_extensions("builder", "rb", "rake", "yml", "yaml", "ruby") { |tag| /#\s*(#{tag}):?\s*(.*)$/ } register_extensions("css", "js") { |tag| /\/\/\s*(#{tag}):?\s*(.*)$/ } register_extensions("erb") { |tag| /<%\s*#\s*(#{tag}):?\s*(.*?)\s*%>/ } diff --git a/railties/test/application/rake/notes_test.rb b/railties/test/application/rake/notes_test.rb index 2191de32af..b6b1bd63f4 100644 --- a/railties/test/application/rake/notes_test.rb +++ b/railties/test/application/rake/notes_test.rb @@ -24,6 +24,9 @@ module ApplicationTests app_file "app/controllers/application_controller.rb", 1000.times.map { "" }.join("\n") << "# TODO: note in ruby" app_file "lib/tasks/task.rake", "# TODO: note in rake" app_file 'app/views/home/index.html.builder', '# TODO: note in builder' + app_file 'config/locales/en.yml', '# TODO: note in yml' + app_file 'config/locales/en.yaml', '# TODO: note in yml' + app_file "app/views/home/index.ruby", "# TODO: note in ruby" boot_rails require 'rake' @@ -42,8 +45,10 @@ module ApplicationTests assert_match(/note in css/, output) assert_match(/note in rake/, output) assert_match(/note in builder/, output) + assert_match(/note in yml/, output) + assert_match(/note in yaml/, output) - assert_equal 6, lines.size + assert_equal 9, lines.size lines.each do |line| assert_equal 4, line[0].size |