Class | Bee::Task::Default |
In: |
lib/bee_task_default.rb
|
Parent: | Package |
Package for default tasks (tasks with no package).
Run another bee build file.
Example
- bee: file: "doc/build.yml" target: "pdf" properties: true
Print contents of a given file on the console. Parameter is the name of the file to output, as a String.
Example
- cat: "doc/welcome-message.txt"
Change working directory. This change will persist for all tasks in the current target. Entering a new target, working directory will recover its default value, which is the directory of the build file (or property ‘base’). Parameter is a String with directory to change to.
Example
- cd: "build"
Change permissions for a set of files. Parameters is a Hash with following entries:
Example:
- chmod: files: /usr/local/bin/* mode: 0755
Note:
This task is not implemented under Windows.
Change owner and group for a set of files. Parameters is a Hash with following entries:
Example:
- chown: files: /home/casa user: casa group: staff recursive: true
Note:
This task is not implemented under Windows.
Copy filtered files. Parameter is a hash with following entries:
Example:
To copy all files from directory ‘src’, except those living in ‘CVS’ directories, into directory ‘destination’, you could write:
- copy: root: src includes: **/* excludes: **/CVS/**/* dest: destination
Note: this task only deals with files. Thus, ‘includes’ and ‘excludes’ globs should be ones for files.
Copy files or directories to destination file or directory. Parameter is a Hash with following entries:
Example
- cp: src: "img/*" dest: :doc
Print a message on console. If message is not a string, this task outputs the inspected value of the object.
Example
- echo: "Hello World!"
Run an ERB file or source in bee context and store result in a file or property. Parameter is a Hash with following entries:
Example
- erb: { src: "gem.spec.erb", dest: "gem.spec" }
Notes
In these ERB files, you can access a property foo writing:
<p>Hello <%= foo %>!</p>
Find files for a glob or list of globs and store list in a property. Parameter is a Hash with entries:
Example
To find all PNG in files in ‘img’ directory, and store the list in property image_files, one could write:
- find: root: "img" includes: "**/*.png" property: "image_files"
Generate a Gem package in current directory, named after the Gem name and version. Parameter is the name of the Gem description file.
Example
- gem: :gem_spec
Get a given URL and store its content in a given file. Parameters is a Hash with following entries:
Example
- get: url: http://rubyforge.org/frs/download.php/22185/bee-0.4.0.zip
Expand a GZIP archive for a given file. Parameter is a Hash with following entries:
Example
- gunzip: src: "dist.tar.gz" dest: "dist.tar"
Generate a GZIP archive for a given file. Parameter is a Hash with following entries:
Example
- gzip: src: "dist.tar" dest: "dist.tar.gz"
Make a symbolic link from a source file to a destination one. Parameter is a Hash with following entries:
Example
- ln: old: /usr/local new: /opt
Note:
This task is not implemented under Windows.
Make a directory, and parent directories if necessary. Doesn‘t complain if directory already exists. Parameter is directory to create as a String or a list of directories as an Array of Strings.
Example
- mkdir: "foo/bar"
Move filtered files. Parameter is a hash with following entries:
Example:
To move all files from directory ‘src’, except those living in ‘CVS’ directories, into directory ‘destination’, you could write:
- move: root: src includes: **/* excludes: **/CVS/**/* dest: destination
Note: this task only deals with files. Thus, ‘includes’ and ‘excludes’ globs should be ones for files and directories from root will not be affected by this task.
Moves files or directories to destination file or directory. Parameter is a Hash with following entries:
Example
- mv: src: "**/*~" dest: :trash
Prompt the user for the value of a given property matching a pattern.
Example
- prompt: message: "Enter your age" property: "age" default: 18 pattern: "^\\d+$" error: "Age must be a positive integer"
Put working directory in a given property. Parameter is the name of the property to write current directory into.
Example
- pwd: current_dir
Generate RDoc documentation for a given list of globs to include or exclude and a destination directory. Parameter is a Hash with following entries:
Example
- rdoc: includes: ["README", "LICENSE", "#{src}/**/*"] dest: :api
Tests a required library and prints an error message if import fails. Parameter is a Hash with entries:
Example
- required: library: foo message: > Library foo must be installed (gem install foo) to run task bar.
Delete files for a given glob or list of globs. Parameter is a glob or list of globs for files to delete. This task will raise an error if told to delete a directory. Use task ‘rmrf’ to do so.
Example
- rm: ["**/*~", "**/.DS_Store"]
Delete files and directories recursively. Parameter is a glob or list of globs for files and directories to delete.
Example
- rmrf: :build
Wait for a given amount of time.
Example
- sleep: 3.5
Generate a TAR archive. Parameter is a Hash with following entries:
Example
- tar: includes: "**/*" excludes: ["build", "build/**/*", "**/*~"] dest: :tar_archive
Note
If archive already exists, it‘s overwritten.
Generate a TAR.GZ archive. Parameter is a Hash with following entries:
Example
- targz: excludes: ["build/**/*", "**/*~"] dest: :targz_archive
Note
If archive already exists, it‘s overwritten.
Run Ruby unit tests listed as a glob or list of globs in a given directory (that defaults to current one). Parameter is a Hash with following entries:
Example
- find: root: :test includes: "**/tc_*.rb" dir: "test"
Update modification time and access time of files in a list. Files are created if they don‘t exist. Parameter is a glob or list of globs for files to touch.
Example
- touch: '#{target}/classes/**/*.class'
Extract TAR archive to a destination directory. Gziped archives are managed if their extension is ’.tgz’ or ’.tar.gz’. Extracted files are overwritten if they already exist. Parameter is a Hash with following entries:
Example
- untar: src: myarchive.tar.gz dest: mydir
Extract ZIP archive to a destination directory. Existing extracted files are not overwritten and result in an error. Parameter is a Hash with following entries:
Example
- unzip: src: myarchive.zip dest: mydir
Generate a ZIP archive. Parameter is a Hash with following entries:
Example
- zip: excludes: ["build/**/*", "**/*~"] dest: :zip_archive
Note
If archive already exists, files are added to the archive.