I have inherited a project with many poorly written Rake tasks that I need to clean up a bit. Since Rakefiles are huge and often prone to bizarre, pointless dependencies, I simplify things a bit and isolate things by reorganizing everything into classes.
In particular, this template is as follows:
namespace :foobar do
desc "Frozz the foobar."
task :frozzify do
unless Rake.application.lookup('_frozzify')
require 'tasks/foobar'
Foobar.new.frozzify
end
Rake.application['_frozzify'].invoke
end
end
As tasks/foobar.rbI have something like this:
class Foobar
def frozzify()
end
end
, , . Rakefile require, . , .
, . :
:xyz_abc tasks/[namespace].rb tasks/... , XyzAbc.
. , :foo_bar :apples, def apples() ... FooBar, tasks/foo_bar.rb.
:t "-" _t ( ), .
desc , , . , , , , Rakefile.
, - , , , , . - ?