Class: Annotations::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Annotations::RakeTask
- Defined in:
- lib/annotations/rake_task.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
-
#define ⇒ Object
Define tasks.
-
#initialize(name = :notes) {|_self| ... } ⇒ RakeTask
constructor
A new instance of RakeTask.
- #tags_to_pattern ⇒ Object
Constructor Details
#initialize(name = :notes) {|_self| ... } ⇒ RakeTask
Returns a new instance of RakeTask.
10 11 12 13 14 15 16 |
# File 'lib/annotations/rake_task.rb', line 10 def initialize(name = :notes) @name = name @tags = [:optimize, :fixme, :todo] @extensions = ENV["ext"] yield self if block_given? define end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/annotations/rake_task.rb', line 8 def name @name end |
#tags ⇒ Object
Returns the value of attribute tags.
8 9 10 |
# File 'lib/annotations/rake_task.rb', line 8 def @tags end |
Instance Method Details
#define ⇒ Object
Define tasks
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/annotations/rake_task.rb', line 23 def define desc "Enumerate all annotations" task name do Annotations::Extractor.enumerate(, :show_tag => true, :extensions => @extensions) end namespace name do .each do |tagname| desc "Enumerate all #{tagname.to_s.upcase} annotations" task tagname.to_sym do Annotations::Extractor.enumerate(tagname.to_s.upcase, :show_tag => true, :extensions => @extensions) end end desc "Enumerate a custom annotation, specify with ANNOTATION=CUSTOM" task :custom, :annotation do |annotation| puts annotation Annotations::Extractor.enumerate(ENV['ANNOTATION'], :extensions => @extensions) end end end |
#tags_to_pattern ⇒ Object
18 19 20 |
# File 'lib/annotations/rake_task.rb', line 18 def @tags.map { |t| t.to_s.upcase }.join("|") end |