Sha256: 765de56285b74a9c6bc1064c98ea55c84d5e2f1cc9b4048aa71820de62b7f2f6

Contents?: true

Size: 1013 Bytes

Versions: 7

Compression:

Stored size: 1013 Bytes

Contents

require 'rake'
require 'rake/tasklib'

require 'rake/notes/source_annotation_extractor'

module Rake
  module Notes
    class RakeTask < ::Rake::TaskLib
      include ::Rake::DSL if defined?(::Rake::DSL)

      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
    end
  end
end

Rake::Notes::RakeTask.new

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rake-notes-1.0.0 lib/rake/notes/rake_task.rb
rake-notes-1.0.0.beta lib/rake/notes/rake_task.rb
rake-notes-0.2.2 lib/rake/notes/rake_task.rb
rake-notes-0.2.1 lib/rake/notes/rake_task.rb
rake-notes-0.2.0 lib/rake/notes/rake_task.rb
rake-notes-0.1.0 lib/rake/notes/rake_task.rb
rake-notes-0.0.1 lib/rake/notes/rake_task.rb