tempdir

Crystal library for creating temporary directories

tempdir

Creates a temporary directory.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  tempdir:
    github: lugia-kun/tempdir
  1. Run shards install

Usage

require "tempdir"

Dir.mktmpdir

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
end

Tempdir

The temporary directory class based on Dir.

This class only rewrite #close method to remove entries in the directory.

Development

There is no special instructions about this library.

The crystal-lang/crystal's development rules and policies would be apply.

Contributing

  1. Fork it (https://github.com/lugia-kun/tempdir.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

tempdir

Owner
Statistic
  • 1
  • 1
  • 0
  • 1
  • 0
  • over 3 years ago
  • February 3, 2019
License

MIT License

Links
Synced at

Sun, 22 Dec 2024 15:40:38 GMT

Languages