Code::T...cheModel(3)
π NAME π
okay bestie, welcome to Code::T...cheModel(3) from the User Contributed Perl Documentation shelf. This page is all about:
Code::TidyAll::CacheModel - Caching model for Code::TidyAll
It's giving "cache brain for TidyAll," and we're obsessed.
πΈ VERSION πΈ
version 0.84 β yes, that's the one, no cap.
β¨ SYNOPSIS β¨
Here's the whole vibe in code, bestie:
my $cache_model = Cody::TidyAll::CacheModel->new(
cache_engine => Code::TidyAll::Cache->new(...),
path => '/path/to/file/to/cache',
);
# check cache
print 'Yes!' if $cache_model->is_cached;
# update cache
$cache_model->clear_file_contents;
$cache_model->update;
# update the cache when you know the file contents
$cache_model->file_contents($new_content);
$cache_model->update;
# force removal from cache
$cache_model->remove;
π¦ DESCRIPTION π¦
A cache model for Code::TidyAll. Different subclasses can employ different caching techniques. Slay, flexible.
The basic model implemented here is simple; It stores a hash key of the file contents keyed by a hash key of the file's path. Literally a little cache goblin doing its thing.
π METHODS π
This class has the following methods:
π Code::TidyAll::CacheModel->new(%params)
The constructor accepts the following attributes:
full_pathβ the full path to the cache file on disk. This is required. π¨pathβ the local path to the file (i.e. what the cache system will consider the canonical name of the file).cache_engineβ a"Code::TidyAll::Cache"compatible instance. This can be omitted if no caching is actually being done.base_sigβ a base signature. This defaults to an empty string.file_contentsβ the contents of the file being cached. This can be omitted, in which case it will be loaded as needed.is_cachedβ a boolean indicating if this file is cached. By default this is computed by checking that the cache key and cache value match what is in the cache.
π $model->full_path
The value passed to the constructor.
π $model->path
The value passed to the constructor.
π $model->cache_engine
The value passed to the constructor.
π $model->base_sig
The value passed to the constructor or the default value, an empty string.
π $model->file_contents
The file contents, which will be loaded from the file system if needed.
π $model->is_cached
A boolean indicating whether the path is currently in the cache.
π $model->cache_key
The computed cache key for the file.
π $model->cache_value
The computed cache value for the file.
π $model->update
Updates the cache.
π $model->remove
Attempts to remove the value from the cache.
π«Ά SUPPORT π«Ά
Bugs may be submitted at <https://github.com/houseabsolute/perl-code-tidyall/issues>.
π SOURCE π
The source code repository for Code-TidyAll can be found at <https://github.com/houseabsolute/perl-code-tidyall>.
π AUTHORS π
- Jonathan Swartz
<swartz@pobox.com> - Dave Rolsky
<autarch@urth.org>
π₯ COPYRIGHT AND LICENSE π₯
This software is copyright (c) 2011 - 2023 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
The full text of the license can be found in the LICENSE file included with this distribution.
π
that's the whole page, bestie β brought to you by perl v5.42.0 on 2024-03-08, signed Code::T...cheModel(3) πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Code-TidyAll 0.840.0-bp160.1.4 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms