From f3073773a31d2a6a4f3946dc706a31400c0f53a0 Mon Sep 17 00:00:00 2001 From: Josh Crowder Date: Thu, 15 Aug 2013 11:30:01 +0100 Subject: [PATCH] Adding LESS to rake notes --- railties/CHANGELOG.md | 4 ++++ railties/lib/rails/source_annotation_extractor.rb | 2 +- railties/test/application/rake/notes_test.rb | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 2f41d92f55..cc9722e59c 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,7 @@ +* rake notes now searches *.less files + + *Josh Crowder* + * Generate nested route for namespaced controller generated using `rails g controller`. Fixes #11532. diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb index 290634290f..b806b922b7 100644 --- a/railties/lib/rails/source_annotation_extractor.rb +++ b/railties/lib/rails/source_annotation_extractor.rb @@ -82,7 +82,7 @@ class SourceAnnotationExtractor case item when /\.(builder|rb|coffee|rake)$/ /#\s*(#{tag}):?\s*(.*)$/ - when /\.(css|scss|sass|js)$/ + when /\.(css|scss|sass|less|js)$/ /\/\/\s*(#{tag}):?\s*(.*)$/ when /\.erb$/ /<%\s*#\s*(#{tag}):?\s*(.*?)\s*%>/ diff --git a/railties/test/application/rake/notes_test.rb b/railties/test/application/rake/notes_test.rb index 9a92c5f6ff..46ed500167 100644 --- a/railties/test/application/rake/notes_test.rb +++ b/railties/test/application/rake/notes_test.rb @@ -25,6 +25,7 @@ module ApplicationTests app_file "app/assets/stylesheets/application.css", "// TODO: note in css" app_file "app/assets/stylesheets/application.css.scss", "// TODO: note in scss" app_file "app/assets/stylesheets/application.css.sass", "// TODO: note in sass" + app_file "app/assets/stylesheets/application.css.less", "// TODO: note in less" 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" @@ -48,6 +49,7 @@ module ApplicationTests assert_match(/note in css/, output) assert_match(/note in scss/, output) assert_match(/note in sass/, output) + assert_match(/note in less/, output) assert_match(/note in rake/, output) assert_equal 10, lines.size