I have been carrying this Rakefile around between projects, that uses another file which reopens the
FlogTask class and adds an
attr_accessor to it, which the task definition in the Rakefile then uses.
This works but, as you can readily tell, it's less than ideal. In particular, the
Rakefile defines multiple tasks which are the same for each project; the only change is usually the Flog threshold value.
What I want to be able to do is:
- Subclass a tool's standard Rake task (e.g.,
FlogTask). The subclass'
#initializemethod would then set up our standard settings as is presently done in the Rakefile;
- Define namespaced Rake tasks (in, e.g.,
lib/tasks/custom_flog.rake) that use those subclasses rather than the tool's standard Rake task; reducing boilerplate and possibility of copy/paste errors;
- Have those tasks be available in