From: Stefan Lang Date: 2005-04-09T00:56:58+09:00 Subject: Re: [ANN] Rant 0.3.2 On Thursday 07 April 2005 03:09, Lionel Thiry wrote: > � require 'rake' > � # do rake stuff but more explicitly > � # no more implicit tasks or rules > � # no more implicit management of options > > Not being able to do this is what disturbs me the most about rake. You can do this with Rant. Short example: require 'rant/rantlib' rac = Rant::RantApp.new cx = rac.context # you can call all methods on cx which you'd call # directly in an Rantfile cx.gen Rant::Generators::Rule, '.o' => '.c' do |t| cx.sys "cc -c -o #{t.name} #{t.source}" end tasks_a = rac.resolve 'a.o' # run all tasks for 'a.o', in this case it will be only one task tasks_a.each { |t| t.invoke } cx.task :clean do cx.rm_f Dir["*.o"] end # rac2 runs in directory rac2 = Rant::RantApp.new rac2.rootdir = "directory" # since we didn't define any task, it looks for an Rantfile # in directory if rac2.run == 0 # success else # failure end # We defined tasks for rac, so it doesn't look for an Rantfile. # We could explicitely load one: # cx.source "Rantfile" rac.run In this manner, you can manipulate Rant in many different ways and adopt it for your current needs. Stefan