doc/rantfile.rdoc in rant-0.3.4 vs doc/rantfile.rdoc in rant-0.3.6

- old
+ new

@@ -24,17 +24,20 @@ additional generators. Example: to use the +RubyPackage+ generator you have to <tt>import "rubypackage"</tt> first. +plugin+:: Instantiate a plugin. Example: <tt>plugin :Configure</tt> instantiates the Configure plugin. -+sys+:: When given argument(s), runs an external program. - Otherwise you can call methods to interact with the OS - on it. ++sys+:: Run external commands or call portable file system + manipulation methods (copy files, unlink files, + install, ...). +source+:: Takes a filename as argument and causes Rant to read it in as Rantfile. +subdirs+:: Takes a list of subdirectories in which Rant should look for Rantfiles. ++var+:: Provides access to variables accessible in Rantfiles + and from the commandline. ++rac+:: The "Rant compiler" which is compiling the Rantfiles. === Defining a task Just call the +task+ function and give it a task name as argument. The task name may be a string or symbol: @@ -201,27 +204,35 @@ The task "program" depends on all files ending in ".o". Rant uses the Dir::glob method internally to resolve patterns, so you can read the ri docs to get an overview: ri Dir::glob + From now on we'll call <tt>sys[...]</tt> the <it>glob + operator</it>. + You can give more patterns: c_files = sys["**/*.h", "**/*.c"] gives a list of all files ending in ".h" or ".c" in the current directory and all subdirectories. - The object returned by sys#[] _behaves_ like a list of string, so - it is possible to pass it to methods expecting an array. If you're - getting errors or experience strange behaviour convert the list - explicetely to an array: + The object returned by the glob operator _behaves_ like a list of + string, so it is possible to pass it to methods expecting an array. + If you're getting errors or experience strange behaviour convert + the list explicetely to an array: sys.touch c_files.to_a === Generators The *gen* function takes a generator which usually creates one or more -tasks for you. Currently are two generators immediately available: +tasks for you. The following list of generators is immediately +available: +Directory+:: Create directories. +Task+:: Define custom task. ++Rule+:: Define a rule (a rule produces tasks on the fly). ++Action+:: Run a block of code immediately. + The Action generator is discussed in + doc/advanced.rdoc[link:files/doc/advanced_rdoc.html]. === The +Directory+ generator An example usage of the +Directory+ generator would be the backup example shown in the README file: @@ -292,14 +303,23 @@ === Importing additional generators The +import+ function lets you import additional generators. Currently the following are coming with Rant: ++Clean+:: Remove selected files. ++AutoClean+:: Remove all files generated by any file task (including + those generated by rules). ++DirectedRule+:: A Rule which takes sources from one or more + directories and puts generated files into a specified + directory. +RubyTest+:: Run Test::Unit tests for your Ruby code. +RubyDoc+:: Run RDoc. +RubyPackage+:: Generate tar, zip and gem packages of your Ruby application/library. -As these are all Ruby specific, please read the Ruby project howto. + +Read doc/advanced.rdoc[link:files/doc/advanced_rdoc.html] and +doc/rubyproject.rdoc[link:files/doc/rubyproject_rdoc.html] for +documentation. === The +subdirs+ command The +subdirs+ command allows you to give Rant a list of subdirectories (relative to the Rantfile) where it should look for additional