Dist::...Archive(3pm)

πŸ“¦
version 0.927 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Dist::Metadata::Archive β€” bestie, it's the base class for Dist::Metadata archive files ✨

(oh and btw this whole thing lives in the Dist::...Archive(3pm) page of the User Contributed Perl Documentation, iykyk πŸŽ€)


🌸 VERSION 🌸

version 0.927 πŸ’…


✨ SYNOPSIS ✨

  my $dist = Dist::Metadata->new(file => $path_to_archive);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so listen. This is a subclass of Dist::Metadata::Dist, and what it does is enable you to figure out the metadata from an archive file. slay.

It's the base class for the archive file formats, and the way that it's giving parent-figure energy for:

  • Dist::Metadata::Tar
  • Dist::Metadata::Zip
fr fr, it is not useful on its own 😭 it's a base class, bestie. You're supposed to use it from "new" in Dist::Metadata. Don't come for it directly, it's not built for that πŸ’€

πŸ‘‘ METHODS πŸ‘‘

🌟 new

  $dist = Dist::Metadata::Archive->new(file => $path);

Accepts a single "file" argument that should be a path to a file. that's it, that's the whole vibe 🫢

And here's the iconic part: if you call "new()" from this base class, it will delegate to a subclass based on the filename and hand you back a blessed instance of that subclass. main character behavior honestly.

🌟 archive

Returns an object representing the archive file. cute, right? πŸŽ€

🌟 default_file_spec

Returns "Unix" since most archive files are be in unix format. yes bestie, that's the real reason πŸ’…

🌟 determine_name_and_version

Attempts to parse name and version from file name. detective work βœ¨πŸ”

🌟 file

The "file" attribute passed to the constructor, used to load "archive". it's literally just holding onto what you gave it 🫢

🌟 read_archive

  $dist->read_archive($file);

Returns a format-specific object representing the specified file.

⚠️ This must be defined by subclasses. Like, for real. It's not gonna define itself, bestie 😭

πŸ’œ AUTHOR πŸ’œ

Randy Stauner <rwstauner@cpan.org> β€” we stan πŸ‘‘


This software is copyright (c) 2011 by Randy Stauner.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt πŸ’…


ok that's the whole page!! 🌈 this was perl v5.34.0, dated 2022-06-13, from the Dist::...Archive(3pm) man page β€” go forth and read your archives, bestie πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from