mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
edf5da4b6c
* 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`
22 lines
659 B
Ruby
22 lines
659 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails/source_annotation_extractor"
|
|
|
|
task :notes do
|
|
Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning
|
|
Rails::Command.invoke :notes
|
|
end
|
|
|
|
namespace :notes do
|
|
["OPTIMIZE", "FIXME", "TODO"].each do |annotation|
|
|
task annotation.downcase.intern do
|
|
Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning
|
|
Rails::Command.invoke :notes, ["--annotations", annotation]
|
|
end
|
|
end
|
|
|
|
task :custom do
|
|
Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning
|
|
Rails::Command.invoke :notes, ["--annotations", ENV["ANNOTATION"]]
|
|
end
|
|
end
|