From 554ad4d1f5f72eb5a4b46469451a9bb69e1f2999 Mon Sep 17 00:00:00 2001 From: Brad Clawsie Date: Wed, 25 Jan 2023 14:34:20 -0600 Subject: [PATCH] v0.007; documentation --- Changelog | 10 ++++++++-- lib/Lang/Go/Mod.pm | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Changelog b/Changelog index 450cb29..4154bdf 100644 --- a/Changelog +++ b/Changelog @@ -8,5 +8,11 @@ - Add some metadata for metacpan 0.004 2021-07-29 -- Merge https://github.com/bradclawsie/Lang-Go-Mod/pull/1 for - comment processing + - Merge https://github.com/bradclawsie/Lang-Go-Mod/pull/1 for + comment processing + +0.006 2023-01-16 + - Add support for "retract" sections + +0.007 2023-01-25 + - Documentation updates diff --git a/lib/Lang/Go/Mod.pm b/lib/Lang/Go/Mod.pm index 096c54b..043dc4f 100644 --- a/lib/Lang/Go/Mod.pm +++ b/lib/Lang/Go/Mod.pm @@ -13,7 +13,7 @@ use Path::Tiny qw(path); # ABSTRACT: parse and model go.mod files -our $VERSION = '0.006'; +our $VERSION = '0.007'; our $AUTHORITY = 'cpan:bclawsie'; our @EXPORT_OK = qw(read_go_mod parse_go_mod _parse_retract); @@ -246,28 +246,34 @@ Lang::Go::Mod - parse and model go.mod files # require ( # golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect # ) + # retract ( + # v1.0.0 // this version should not be used + # ) use Lang::Go::Mod qw(read_go_mod parse_go_mod); my $go_mod_path = '/path/to/go.mod'; # read and parse the go.mod file + # # all errors croak, so wrap this in your favorite variant of try/catch # to gracefully manage errors my $m = read_go_mod($go_mod_path); # use parse_go_mod to parse the go.mod content if it is already in a scalar + # my $m = parse_go_mod($go_mod_file_content); print $m->{module}; # github.com/example/my-project print $m->{go}; # 1.16 print $m->{exclude}->{'example.com/whatmodule'}; # [v1.4.0] print $m->{replace}->{'github.com/example/my-project/pkg/app'}; # ./pkg/app print $m->{'require'}->{'golang.org/x/sys'}; # v0.0.0-20210510120138-977fb7262007 + print $m->{retract}->{'v1.0.0'}; # 1 =head1 DESCRIPTION This module creates a hash representation of a C file. -Both single line and multiline C, C, and C -sections are supported. For a full reference of the C format, see +Both single line and multiline C, C, C and C +sections are supported. For a full reference of the C format, see L @@ -280,10 +286,10 @@ return the hash representation of the contents. All errors C. =head2 C -Given a scalar of the contents of a C file, parse it and +Given a scalar of the contents of a C file, parse it and return the hash representation of the contents. All errors C. -=head1 LICENSE +=head1 LICENSE Lang::Go::Mod is licensed under the same terms as Perl itself. @@ -292,5 +298,6 @@ L =head1 CONTRIBUTORS Ben Bullock (L) +Brad Clawsie (L) =cut -- 2.38.4