Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
giterlizzi committed Jun 13, 2023
2 parents de58232 + 47d59e2 commit 1b8d29e
Show file tree
Hide file tree
Showing 17 changed files with 1,057 additions and 200 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/linux.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/perltest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
perl: [ 'latest' ]
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- run: perl -V
- run: cpanm Module::Install
- run: cpanm -n --installdeps .
- run: prove -lv t

coverage:
runs-on: ubuntu-latest
container: davorg/perl-coveralls:latest
name: Test coverage
steps:
- uses: actions/checkout@v3
- name: Install modules Module::Install
run: cpanm Module::Install
- name: Install dependencies
run: cpanm -n --installdeps .
- name: Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cover -test -report Coveralls
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Revision history for Perl extension URI::PackageURL.

2.00 2023-06-13
- Added "purl-tool(1)" (giterlizzi/perl-URI-PackageURL#3)
- Added "URI::PackageURL::Util::purl_to_urls" helper
- Fixed name qualifier for "cpan" (giterlizzi/perl-URI-PackageURL#2)
- Fixed some little issues

1.10 2022-08-01
- Fixed "namespace vs name" (RT#143917)
- Fixed substitution warning when "version" component is not provided
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can also look for information at:

## LICENSE AND COPYRIGHT

Copyright (C) 2022 Giuseppe Di Terlizzi
Copyright (C) 2022-2023 Giuseppe Di Terlizzi

This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a
Expand Down
7 changes: 6 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
bin/purl-tool
Changes
INSTALL.md
lib/URI/PackageURL.pm
lib/URI/PackageURL/CLI.pm
lib/URI/PackageURL/Util.pm
LICENSE
Makefile.PL
MANIFEST
MANIFEST This list of files
README.md
t/00-load.t
t/10-encode.t
t/20-decode.t
t/30-util.t
t/40-cli.t
t/99-official-purl-test-suite.t
t/manifest.t
t/pod-coverage.t
Expand Down
40 changes: 16 additions & 24 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,28 @@ use warnings;
use ExtUtils::MakeMaker;

WriteMakefile(
NAME => 'URI::PackageURL',
AUTHOR => q{Giuseppe Di Terlizzi <gdt@cpan.org>},
VERSION_FROM => 'lib/URI/PackageURL.pm',
ABSTRACT_FROM => 'lib/URI/PackageURL.pm',
LICENSE => 'artistic_2',
EXE_FILES => [],
MIN_PERL_VERSION => 5.010,
PL_FILES => {},
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '0',
},
TEST_REQUIRES => {
'Test::More' => '0',
'JSON::PP' => '0',
},
PREREQ_PM => {
},
META_MERGE => {
'meta-spec' => { version => 2 },
NAME => 'URI::PackageURL',
AUTHOR => q{Giuseppe Di Terlizzi <gdt@cpan.org>},
VERSION_FROM => 'lib/URI/PackageURL.pm',
ABSTRACT_FROM => 'lib/URI/PackageURL.pm',
LICENSE => 'artistic_2',
EXE_FILES => ['bin/purl-tool'],
MIN_PERL_VERSION => 5.010,
PL_FILES => {},
CONFIGURE_REQUIRES => {'ExtUtils::MakeMaker' => '0',},
TEST_REQUIRES => {'Test::More' => '0', 'JSON::PP' => '0',},
PREREQ_PM => {},
META_MERGE => {
'meta-spec' => {version => 2},
'resources' => {
bugtracker => {
web => 'https://github.com/giterlizzi/perl-URI-PackageURL/issues',
},
bugtracker => {web => 'https://github.com/giterlizzi/perl-URI-PackageURL/issues'},
repository => {
type => 'git',
url => 'git://github.com/giterlizzi/perl-URI-PackageURL',
web => 'https://github.com/giterlizzi/perl-URI-PackageURL'
},
}
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'URI-PackageURL-*' },
dist => {COMPRESS => 'gzip -9f', SUFFIX => 'gz',},
clean => {FILES => 'URI-PackageURL-*'},
);
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ use URI::PackageURL;
# OO-interface

# Encode components in PackageURL string
$purl = URI::PackageURL->new(type => cpan, name => 'URI::PackageURL', version => '1.10');
$purl = URI::PackageURL->new(type => cpan, namespace => 'GDT', name => 'URI-PackageURL', version => '2.00');

say $purl; # pkg:cpan/URI::PackageURL@1.10
say $purl; # pkg:cpan/GDT/URI-PackageURL@2.00

# Parse PackageURL string
$purl = URI::PackageURL->from_string('pkg:cpan/URI::PackageURL@1.10');
$purl = URI::PackageURL->from_string('pkg:cpan/GDT/URI-PackageURL@2.00');

# exported funtions

$purl = decode_purl('pkg:cpan/URI::PackageURL@1.10');
$purl = decode_purl('pkg:cpan/GDT/URI-PackageURL@2.00');
say $purl->type; # cpan

$purl_string = encode_purl(type => cpan, name => 'URI::PackageURL', version => '1.10');
$purl_string = encode_purl(type => cpan, namespace => 'GDT', name => 'URI::PackageURL', version => '2.00');
```

## Install
Expand All @@ -49,4 +49,4 @@ Using App::cpanminus:

## Copyright

- Copyright 2022 © Giuseppe Di Terlizzi
- Copyright 2022-2023 © Giuseppe Di Terlizzi
71 changes: 71 additions & 0 deletions bin/purl-tool
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/perl

use strict;
use warnings;
use utf8;

use URI::PackageURL::CLI;

exit URI::PackageURL::CLI->run(@ARGV) unless caller();

1;

__END__
=encoding utf-8
=head1 NAME
purl-tool - PackageURL tool
=head1 SYNOPSIS
purl-tool [OPTIONS]...STRING
purl-tool [--help|--man|--version]
Options:
--help Brief help message
--man Full documentation
--version Print version
--download-url Download URL
--repository-url Repository URL
-0, --null Return NULL char instead of new line
--format=FORMAT Output format
--dumper Data::Dumper format (--format=dumper)
--json JSON output format (--format=json)
--yaml YAML output format (--format=yaml)
--env ENV output format (--format=env)
Examples:
purl-tool pkg:cpan/GDT/URI-PackageURL@2.00 --json | jq
wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.00 --download-url)
=head1 DESCRIPTION
C<purl-tool> PackageURL tool
=head1 EXAMPLES
Parse the given PackageURL string and return JSON and send the STDOUT to L<jq>:
B<purl-tool pkg:cpan/GDT/URI-PackageURL@2.00 --json | jq>
Download the package from the repository using PackageURL string:
B<wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.00 --download-url)>
=head1 AUTHOR
L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>
=head1 COPYRIGHT AND LICENSE
Copyright © 2022-2023 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>
You may use and distribute this module according to the same terms
that Perl is distributed under.
Loading

0 comments on commit 1b8d29e

Please sign in to comment.