From: Stefan Lang Date: 2005-04-04T04:47:35+09:00 Subject: Re: [ANN] Rant 0.3.2 On Sunday 03 April 2005 19:23, Jamis Buck wrote: > On Apr 3, 2005, at 10:40 AM, Stefan Lang wrote: > > Rant is a flexible build tool written entirely in Ruby, > > similar to Rake. > > Could you expand on that a little bit more? What are some of the > differences between Rake and Rant? From the name it sounds like the > relationship might be "Rake is to Make as Rant is to Ant", but that's > just a shot in the dark. > > - Jamis During development I use the following build tools as reference: * Ant (Java) * Nant (C#) * make * SCons (Python) * Rake Since the name Rake was already taken, I choose Rant. (Although Rant perhaps sounds a bit "ambiguous" to (native) English speakers :-) WRT comparison with Rake: I replied to a post of Florian Gross in which i explained some differences between Rake and Rant. Just look for the header "Re: [ANN] First release of Rant". If you like, I can send you the relevant email. Anyway a short list of differences here: Since the last release, Rant lets you define subdirectories: file "prog" => "src/main.o" do # puts some actions here end subdirs "src", "doc" Now Rant will look for a task "main.o" in an Rantfile in "src/". src/Rantfile could contain: file "main.o" => "main.c" do # compile main.c to main.o end A short Rantfile for your Ruby application could look like: import %w(rubytest rubydoc rubypackage) lib_files = Dir["lib/**/*.rb"] dist_files = lib_files + %w(Rantfile README) + Dir["{test,bin}/*"] desc "Run unit tests." gen RubyTest do |t| t.test_dir = "test" t.pattern = "tc_*.rb" end desc "Generate html documentation." gen RubyDoc do |t| t.opts = %w(--title wgrep --main README README) end desc "Create packages." gen RubyPackage, :wgrep do |t| t.version "1.0.0" t.summary "Simple grep program." t.files dist_files t.bindir "bin" t.executable "wgrep" t.package_task end task :clean do sys.rm_rf %w(doc packages) end With this Rantfile, rant runs unit tests, RDoc, creates tar.gz, zip and gem packages and provides the "clean" task. We use +import+ in this file, which does a similar thing as require. But it allows the following: % rant-import --auto ant And now you have an Rant script in the file "ant" which makes your project independent from an Rant installation. Just run: % ruby ant You can define tasks and run Rant from irb, use it as a library or invoke your Rantfile directly. Although it looks like Rant would introduce methods in the global namespace, it doesn't. Methods of the FileUtils module can be called through the +sys+ method. Besides that, Rant provides (primitive) support for C# and a "Configure" plugin. I recommend to read the Rant documentation at http://make.rubyforge.org/. Stefan