diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2014-03-17 17:47:24 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2014-03-17 17:47:24 -0500 |
commit | 4a69c933cf07ee296a4ae1e2612c31922019eeab (patch) | |
tree | 8c545944c3ad918e0bb172e9063780d2274aa0a3 /guides | |
parent | ba3ad256c6d33aa7789319666d4cef4e7210758c (diff) | |
parent | 3b073ac19530b657d7585047027dcf78a452161c (diff) | |
download | rails-4a69c933cf07ee296a4ae1e2612c31922019eeab.tar.gz rails-4a69c933cf07ee296a4ae1e2612c31922019eeab.tar.bz2 rails-4a69c933cf07ee296a4ae1e2612c31922019eeab.zip |
Merge pull request #14379 from robertomiranda/rake-notes.config
Add Public Api for Register New Extensions for Rake Notes
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/command_line.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/guides/source/command_line.md b/guides/source/command_line.md index 8949ef4c78..57283f7c40 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -411,7 +411,7 @@ The `doc:` namespace has the tools to generate documentation for your app, API d ### `notes` -`rake notes` will search through your code for comments beginning with FIXME, OPTIMIZE or TODO. The search is done in files with extension `.builder`, `.rb`, `.erb`, `.haml`, `.slim`, `.css`, `.scss`, `.js`, `.coffee`, `.rake`, `.sass` and `.less` for both default and custom annotations. +`rake notes` will search through your code for comments beginning with FIXME, OPTIMIZE or TODO. The search is done in files with extension `.builder`, `.rb`, `.rake`, `.yml`, `.yaml`, `.ruby`, `.css`, `.js` and `.erb` for both default and custom annotations. ```bash $ rake notes @@ -425,6 +425,12 @@ app/models/school.rb: * [ 17] [FIXME] ``` +You can add support for new file extensions using `config.annotations.register_extensions` option, which receives a list of the extensions with its corresponding regex to match it up. + +```ruby +config.annotations.register_extensions("scss", "sass", "less") { |annotation| /\/\/\s*(#{annotation}):?\s*(.*)$/ } +``` + If you are looking for a specific annotation, say FIXME, you can use `rake notes:fixme`. Note that you have to lower case the annotation's name. ```bash |