method

when_writing

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: FileUtilsExt

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2_2_9) is shown here.

when_writing(msg=nil) public

Use this function to prevent potentially destructive ruby code from running when the :nowrite flag is set.

Example:

when_writing("Building Project") do
  project.build
end

The following code will build the project under normal conditions. If the nowrite(true) flag is set, then the example will print:

DRYRUN: Building Project

instead of actually building the project.

Show source
Register or log in to add new notes.