Module: Bones::Plugins::Notes

Extended by:
Notes
Includes:
Helpers
Included in:
Notes
Defined in:
lib/bones/plugins/notes.rb

Constant Summary

Constants included from Helpers

Helpers::DEV_NULL, Helpers::GEM, Helpers::HAVE, Helpers::HAVE_SVN, Helpers::RCOV, Helpers::RDOC, Helpers::SUDO

Instance Method Summary collapse

Methods included from Helpers

#find_file, #have?, #paragraphs_of, #quiet, #remove_desc_for_task

Instance Method Details

#define_tasksObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/bones/plugins/notes.rb', line 31

def define_tasks
  config = ::Bones.config

  desc "Enumerate all annotations"
  task :notes do |t|
    id = if t.application.top_level_tasks.length > 1
      t.application.top_level_tasks.slice!(1..-1).join(' ')
    end
    Bones::AnnotationExtractor.enumerate(
        config, config.notes.tags.join('|'), id, :tag => true)
  end

  namespace :notes do
    config.notes.tags.each do |tag|
      desc "Enumerate all #{tag} annotations"
      task tag.downcase.to_sym do |t|
        id = if t.application.top_level_tasks.length > 1
          t.application.top_level_tasks.slice!(1..-1).join(' ')
        end
        Bones::AnnotationExtractor.enumerate(config, tag, id)
      end
    end
  end
end

#initialize_notesObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/bones/plugins/notes.rb', line 6

def initialize_notes
  ::Bones.config {
    desc 'Configuration for extracting annotations from project files.'
    notes {
      exclude [], :desc => <<-__
        A list of regular expression patterns that will be used to exclude
        certain files from the annotation search. Each pattern is given as a
        string, and they are all combined using the regular expression or
        "|" operator.
      __

      extensions %w[.txt .rb .erb .rdoc .md] << '', :desc => <<-__
        Only files with these extensions will be searched for annotations.
      __

      tags %w[FIXME OPTIMIZE TODO], :desc => <<-__
        The list of annotation tags that will be extracted from the files
        being searched.
      __
    }
  }

  have?(:notes) { true }
end