The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Dist::Zilla::Role::GetDistFileURL - Get URL to a file inside a Perl distribution

VERSION

This document describes version 0.002 of Dist::Zilla::Role::GetDistFileURL (from Perl distribution Dist-Zilla-Role-GetDistFileURL), released on 2023-11-09.

PROVIDED METHODS

get_dist_file_url

Usage:

my $url = $obj->get_dist_file_url($hosting, $path);

Example:

my $url = $obj->get_dist_file_url('metacpan', 'share/image/image1.jpg');
my $url = $obj->get_dist_file_url('github', 'META.json');

Known hosting:

  • metacpan

    This is the default because all distributions uploaded to PAUSE/CPAN will normally show up on metacpan.org. Note that for images, some people advise not to abuse metacpan.org to host images because metacpan.org is not an image hosting service. However, at the time of this writing, I couldn't find any mention of this in the metacpan.org FAQ or About pages.

  • github

    This can only be used if the distribution specifies its repository in its metadata, and the repository URL's host is github.com.

  • gitlab

    This can only be used if the distribution specifies its repository in its metadata, and the repository URL's host is gitlab.org.

  • bitbucket

    This can only be used if the distribution specifies its repository in its metadata, and the repository URL's host is bitbucket.org.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Dist-Zilla-Role-GetDistFileURL.

SOURCE

Source repository is at https://github.com/perlancar/perl-Dist-Zilla-Role-GetDistFileURL.

SEE ALSO

AUTHOR

perlancar <perlancar@cpan.org>

CONTRIBUTING

To contribute, you can send patches by email/via RT, or send pull requests on GitHub.

Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:

% prove -l

If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by perlancar <perlancar@cpan.org>.

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

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Role-GetDistFileURL

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.