Badger...rkplace(3pm)
β¨ NAME β¨
Badger::Workplace β a place to do work π
(yes bestie, this is the Badger::Workplace(3pm) page from the User Contributed Perl Documentation, we're being so official rn)
πΈ DESCRIPTION πΈ
okay so picture this: it's a very simple base class for modules that operate on or around a particular filesystem directory. that's it. that's the whole vibe. it's giving "foundation, not feature set" π«Ά
wanna see it out in the wild being used for real? go peek at Badger::Config::Filesystem β that's the example of it in use. iconic of them honestly.
π CONFIGURATION OPTIONS π
these are the lil knobs you can set, bestie, turn them gently π§
root/dir/directoryβ you can hand over any ofroot,dirordirectoryto say where the root directory of the workplace lives. three names, one job, we love a flexible queen πurnβ set this to define a Universal Resource Name (URN) for the workplace, just for reference purposes. if you leave it undefined it defaults to the name of the root directory. no extra effort required, she does it herself β¨uriβ set this to define a Universal Resource Identifier (URN) for the workplace, again for reference purposes. if it's undefined it defaults to the name of the value ofurn. chain reaction, so slay π«mkdirβ here's the tea π«: the object constructor will fail if the root directory you specified viaroot(ordir, ordirectory) doesn't exist. BUT. if you set themkdiroption to any true value, the directory gets created automatically. no cap. it just makes it for you ποΈ
π¦ METHODS π¦
dir($name) / directory($name)
returns a Badger::Filesystem::Directory object for a named sub-directory relative to the workplace root ποΈ
and plot twist: when you call it with any arguments, it returns a Badger::Filesystem::Directory object for the workplace root directory itself. main character behaviour tbh.
file($name)
returns a Badger::Filesystem::File object for a named files relative to the workplace root π
uri($path)
when you call this one with no arguments at all, it hands you back the base URI for the workspace. like:
print $workspace->uri; # e.g. foo
but when you call it with a relative URI path as an argument? it returns the URI resolved relative to the project base URI. look at her go:
print $workspace->uri('bar'); # e.g. foo/bar
resolved. relative. gorgeous. periodt π
π AUTHOR π
Andy Wardley <http://wardley.org/> β the legend themselves π«Ά
π COPYRIGHT π
Copyright (C) 2008-2014 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page bestie, you're officially fluent in Badger::Workplace now πβ¨ this was perl v5.36.0, dated 2023-08-28 β go forth and make directories, ily, bye π¦π
π¦ where this page comes from
- debian trixie: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms