class Crystal::CacheDir
inherits Reference
¶
Manages cache files in the ".crystal" directory.
For each compiled program a directory is created in the cache that stores .bc and .o files that could possibly be reused from a previous compilation.
To keep the cache dir small, only the 10 most recently used directories are kept. We use the directory's modification time for this.
Class methods¶
Methods¶
#cleanup
¶
Keeps the 10 most recently used directories in the cache, and removes all others.
#directory_for(sources : Array(Compiler::Source))
¶
(sources : Array(Compiler::Source))
Returns the directory where cache files related to the given sources will be stored. The directory will be created if it doesn't exist.
#directory_for(filename : String)
¶
(filename : String)
Returns the directory where cache files related to the given filenames will be stored. The directory will be created if it doesn't exist.