Class: Rake::Notes::RakeTask

Inherits:
TaskLib
  • Object
show all
Includes:
DSL
Defined in:
lib/rake/notes/rake_task.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) {|_self| ... } ⇒ RakeTask

Returns a new instance of RakeTask.

Yields:

  • (_self)

Yield Parameters:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rake/notes/rake_task.rb', line 11

def initialize(*args)
  yield self if block_given?

  desc "Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)"
  task :notes do
    SourceAnnotationExtractor.enumerate "OPTIMIZE|FIXME|TODO", :tag => true
  end

  namespace :notes do
    ["OPTIMIZE", "FIXME", "TODO"].each do |annotation|
      desc "Enumerate all #{annotation} annotations"
      task annotation.downcase.intern do
        SourceAnnotationExtractor.enumerate annotation
      end
    end

    desc "Enumerate a custom annotation, specify with ANNOTATION=CUSTOM"
    task :custom do
      SourceAnnotationExtractor.enumerate ENV['ANNOTATION']
    end
  end
end