module Comandante::Cleaner
Extended Modules
Defined in:
comandante/cleaner.crClass Method Summary
-
.debug
Debug Mode, you can use an action to set this with a global --debug option
-
.debug=(debug)
Debug Mode, you can use an action to set this with a global --debug option
-
.exit_on_pipe_error
Exit on pipe error, sometimes you to exit on pipe errors
-
.exit_on_pipe_error=(exit_on_pipe_error)
Exit on pipe error, sometimes you to exit on pipe errors
-
.failure_behavior
The desired failure_behavior, see
FailureMode
-
.failure_behavior=(failure_behavior)
The desired failure_behavior, see
FailureMode
- .verbose
- .verbose=(verbose)
Instance Method Summary
-
#cleanup : Nil
Runs cleanup manually before end of block or from outside it.
-
#exit_failure(msg : String, status = 1) : Nil
Will exit or raise exception with a message in accordance with
.failure_behavior
. -
#exit_success(msg : String = "", status = 0) : Nil
Will exit with a message.
-
#register(proc : SimpleProc) : Nil
Register a cleanup proc to be executed on exit from Cleanup::run block.
-
#run(&) : Nil
Runs a block with cleanup afterwards.
-
#tempdir(name = File.tempname) : Dir
Create a tempdir that will be removed on exit as long as you are running inside a
#run
block -
#tempdir(name = File.tempname, &) : Nil
Create a tempdir that will be removed on exit from block
-
#tempfile : File
Create a tempfile that will be removed on exit as long as you are running inside a
#run
block -
#tempfile(&) : Nil
Create a tempfile that will be removed on exit from block
Class Method Detail
Exit on pipe error, sometimes you to exit on pipe errors
Instance Method Detail
Runs cleanup manually before end of block or from outside it. will run user cleanup procs first, then remove any tempfiles or tempdirs.
Will exit or raise exception with a message in accordance with
.failure_behavior
. Will run cleanup first.
Will exit with a message. Will run cleanup first.
Register a cleanup proc to be executed on exit from Cleanup::run block.
Example:
register ->{ my_cleaner; puts "cleanup done!" }
Runs a block with cleanup afterwards.
You should wrap your app.run
inside
Examples:
Cleaner.run do
app.run
end
Will capture exceptions and run user cleanup function at end of block.
Create a tempdir that will be removed on exit as long as you are
running inside a #run
block
Create a tempdir that will be removed on exit from block