Class: DNote::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- DNote::RakeTask
- Defined in:
- lib/dnote/rake/dnotetask.rb
Overview
Developmerās Notes Rake Task
Constant Summary collapse
- DEFAULT_LABELS =
Default note labels to looked for in source code.
%w[TODO FIXME OPTIMIZE DEPRECATE].freeze
Instance Attribute Summary collapse
-
#exclude ⇒ Object
Exclude paths.
-
#files ⇒ Object
File paths to search.
-
#formats ⇒ Object
Formats (xml, html, rdoc, rdoc/list and so on).
-
#ignore ⇒ Object
Ignore paths based on any part of pathname.
-
#labels ⇒ Object
Labels to document.
-
#output ⇒ Object
Output directory to save notes file.
-
#title ⇒ Object
Title to use if temaplte can use it.
Instance Method Summary collapse
-
#clean ⇒ Object
Remove output files.
- #define ⇒ Object
-
#document ⇒ Object
Generate notes document(s).
- #init ⇒ Object
Instance Attribute Details
#exclude ⇒ Object
Exclude paths.
24 25 26 |
# File 'lib/dnote/rake/dnotetask.rb', line 24 def exclude @exclude end |
#files ⇒ Object
File paths to search.
15 16 17 |
# File 'lib/dnote/rake/dnotetask.rb', line 15 def files @files end |
#formats ⇒ Object
Formats (xml, html, rdoc, rdoc/list and so on).
21 22 23 |
# File 'lib/dnote/rake/dnotetask.rb', line 21 def formats @formats end |
#ignore ⇒ Object
Ignore paths based on any part of pathname.
27 28 29 |
# File 'lib/dnote/rake/dnotetask.rb', line 27 def ignore @ignore end |
#labels ⇒ Object
Labels to document. Defaults are: TODO, FIXME, OPTIMIZE and DEPRECATE.
18 19 20 |
# File 'lib/dnote/rake/dnotetask.rb', line 18 def labels @labels end |
#output ⇒ Object
Output directory to save notes file. Defaults to dnote/
under the project log directory (eg. log/dnote/
).
31 32 33 |
# File 'lib/dnote/rake/dnotetask.rb', line 31 def output @output end |
#title ⇒ Object
Title to use if temaplte can use it.
34 35 36 |
# File 'lib/dnote/rake/dnotetask.rb', line 34 def title @title end |
Instance Method Details
#clean ⇒ Object
Remove output files.
72 73 74 75 76 |
# File 'lib/dnote/rake/dnotetask.rb', line 72 def clean formats.each do |format| clean_format format end end |
#define ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/dnote/rake/dnotetask.rb', line 49 def define desc "Collect Developer's Notes" task "dnote" do document end task "dnote:clobber" do clean end task clobber: ["dnote:clobber"] end |
#document ⇒ Object
Generate notes document(s).
61 62 63 64 65 66 67 68 69 |
# File 'lib/dnote/rake/dnotetask.rb', line 61 def document abort "dnote: #{output} is not a directory" unless output.directory? session = new_session formats.each do |format| generate_document_for_format(session, format) end end |
#init ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/dnote/rake/dnotetask.rb', line 40 def init require "dnote" require "dnote/format" @files = "**/*.rb" @output = "log/dnote" @formats = ["index"] @labels = nil end |