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) ⇒ RakeTask
constructor
A new instance of RakeTask.
- #tags_to_pattern ⇒ Object
Constructor Details
#initialize(name = :notes) ⇒ RakeTask
10 11 12 13 14 |
# File 'lib/annotations/rake_task.rb', line 10 def initialize(name = :notes) @name = name = [:optimize, :fixme, :todo] 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 end |
Instance Method Details
#define ⇒ Object
Define tasks
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/annotations/rake_task.rb', line 21 def define desc "Enumerate all annotations" task name do Annotations::Extractor.enumerate(, :tag => true) 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, :tag => true) end end desc "Enumerate a custom annotation, specify with ANNOTATION=CUSTOM" task :custom, :annotation do |annotation| puts annotation SourceAnnotationExtractor.enumerate ENV['ANNOTATION'] end end # desc name == :notes ? "Compile assets" : "Compile #{name} assets" # desc "Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)" # task name do # with_logger do # manifest.compile(assets) # end # end # desc name == :assets ? "Remove all assets" : "Remove all #{name} assets" # task "clobber_#{name}" do # with_logger do # manifest.clobber # end # end # task :clobber => ["clobber_#{name}"] # desc name == :assets ? "Clean old assets" : "Clean old #{name} assets" # task "clean_#{name}" do # with_logger do # manifest.clean(keep) # end # end # task :clean => ["clean_#{name}"] end |
#tags_to_pattern ⇒ Object
16 17 18 |
# File 'lib/annotations/rake_task.rb', line 16 def .map { |t| t.to_s.upcase }.join("|") end |