diff options
author | Annie-Claude Côté <hello@annie.codes> | 2018-06-26 17:12:07 -0400 |
---|---|---|
committer | Annie-Claude Côté <hello@annie.codes> | 2018-07-04 14:30:14 -0400 |
commit | edf5da4b6c14eddc1fb540d8e7eec97c23baf12f (patch) | |
tree | af00c95570544a08764983477253132f9768b4bb /railties/lib/rails/tasks | |
parent | 21f7dadbffdf4532e4401f1cbfa1771a8e5750da (diff) | |
download | rails-edf5da4b6c14eddc1fb540d8e7eec97c23baf12f.tar.gz rails-edf5da4b6c14eddc1fb540d8e7eec97c23baf12f.tar.bz2 rails-edf5da4b6c14eddc1fb540d8e7eec97c23baf12f.zip |
Port Annotations rake task to use Rails::NotesCommand
* Invokes the notes Rails::Command and passes the rake task ENV variables as annotations options to it
* Adds a deprecation warning for unsupported commands
* Gets rid of reference to ENV["SOURCE_ANNOTATION_DIRECTORIES"] in SourceAnnotationExtractor since its now dealt with in the NotesCommand
* Gets rid of rake desc for each rake notes task so they are not documented while using `rails -T` or `rails --help`
Diffstat (limited to 'railties/lib/rails/tasks')
-rw-r--r-- | railties/lib/rails/tasks/annotations.rake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/railties/lib/rails/tasks/annotations.rake b/railties/lib/rails/tasks/annotations.rake index 60bcdc5e1b..65af778a15 100644 --- a/railties/lib/rails/tasks/annotations.rake +++ b/railties/lib/rails/tasks/annotations.rake @@ -2,21 +2,21 @@ require "rails/source_annotation_extractor" -desc "Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)" task :notes do - Rails::SourceAnnotationExtractor.enumerate "OPTIMIZE|FIXME|TODO", tag: true + Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning + Rails::Command.invoke :notes end namespace :notes do ["OPTIMIZE", "FIXME", "TODO"].each do |annotation| - # desc "Enumerate all #{annotation} annotations" task annotation.downcase.intern do - Rails::SourceAnnotationExtractor.enumerate annotation + Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning + Rails::Command.invoke :notes, ["--annotations", annotation] end end - desc "Enumerate a custom annotation, specify with ANNOTATION=CUSTOM" task :custom do - Rails::SourceAnnotationExtractor.enumerate ENV["ANNOTATION"] + Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning + Rails::Command.invoke :notes, ["--annotations", ENV["ANNOTATION"]] end end |