Creates a temporary directory.
- Add the dependency to your
shard.yml:
dependencies:
tempdir:
github: lugia-kun/tempdir- Run
shards install
require "tempdir"dir = Dir.mktmpdir(*args)Creates a temporary directory. Given arguments are not checked by
here, this method passes them to File.tmpname as-is. See
File.tempname.
The returning object is Tempdir. It removes all entries when
#close-d.
With block, the created directory will be removed after block is left.
Dir.mktmpdir(...) do |dir|
# work with dir
endThe temporary directory class based on Dir.
This class only rewrite #close method to remove entries in the
directory.
There is no special instructions about this library.
The crystal-lang/crystal's development rules and policies would be apply.
- Fork it (https://github.com/lugia-kun/tempdir.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
- Hajime Yoshimori - creator and maintainer