Update to 0.38

- New upstream release 0.38
  - Cope with GLD output changes in version 0.103 (GH#13)
This commit is contained in:
Paul Howarth 2019-01-28 09:20:26 +00:00
parent 87383fdabc
commit f37abef7aa
3 changed files with 9 additions and 87 deletions

View File

@ -1,78 +0,0 @@
commit 91da15eed08ede5d7486ccc3eec9b70ae493d627
Author: Paul Howarth <paul@city-fan.org>
Date: Tue Aug 21 16:47:12 2018 +0100
Cope with GLD output changes in version 0.103
The output text format of Getopt::Long::Descriptive changed yet again
at version 0.103 and broke some of the tests. This change fixes the
tests without breaking compatibility with older versions of
Getopt::Long::Descriptive.
diff --git a/t/104_override_usage.t b/t/104_override_usage.t
index bdee6c6..bc45029 100644
--- a/t/104_override_usage.t
+++ b/t/104_override_usage.t
@@ -55,9 +55,15 @@ use Test::Exception;
\t--foo INT A foo
}
:
+ $Getopt::Long::Descriptive::VERSION < 0.103 ?
qq{usage: 104_override_usage.t [-?] [long options...]
\t-? --usage --help Prints this usage information.
\t--foo INT A foo
+}
+ :
+ qq{usage: 104_override_usage.t [-?] [long options...]
+\t-? --[no-]usage --[no-]help Prints this usage information.
+\t--foo INT A foo
}
];
diff --git a/t/107_no_auto_help.t b/t/107_no_auto_help.t
index 1091fd2..27f87f5 100644
--- a/t/107_no_auto_help.t
+++ b/t/107_no_auto_help.t
@@ -60,7 +60,7 @@ END {
warning_like {
throws_ok { Class->new_with_options }
#usage: 107_no_auto_help.t [-?] [long options...]
- qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\s+\Q-? --usage --help\E\s+\QPrints this usage information.\E.\s+--configfile/ms,
+ qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\s+\Q-? --\E(\[no-\])?usage --(\[no-\])?\Qhelp\E\s+\QPrints this usage information.\E.\s+--configfile/ms,
'usage information looks good';
}
qr/^Specified configfile \'this_value_unimportant\' does not exist, is empty, or is not readable$/,
diff --git a/t/109_help_flag.t b/t/109_help_flag.t
index adc6e0c..8c658e2 100644
--- a/t/109_help_flag.t
+++ b/t/109_help_flag.t
@@ -40,7 +40,7 @@ foreach my $args ( ['--help'], ['--usage'], ['--?'], ['-?'] )
local @ARGV = @$args;
throws_ok { MyClass->new_with_options() }
- qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --usage --help\E\s+\QPrints this usage information.\E$/ms,
+ qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --\E(\[no-\])?usage --(\[no-\])?help\s+\QPrints this usage information.\E$/ms,
'Help request detected; usage information properly printed';
}
diff --git a/t/110_sort_usage_by_attr_order.t b/t/110_sort_usage_by_attr_order.t
index 3eb4a49..e7dd177 100644
--- a/t/110_sort_usage_by_attr_order.t
+++ b/t/110_sort_usage_by_attr_order.t
@@ -54,6 +54,16 @@ usage: 110_sort_usage_by_attr_order.t [-?] [long options...]
--baz STR Documentation for "baz"
USAGE
}
+if ( $Getopt::Long::Descriptive::VERSION >= 0.103 )
+{
+$expected = <<'USAGE';
+usage: 110_sort_usage_by_attr_order.t [-?] [long options...]
+ -? --[no-]usage --[no-]help Prints this usage information.
+ --foo STR Documentation for "foo"
+ --bar STR Documentation for "bar"
+ --baz STR Documentation for "baz"
+USAGE
+}
$expected =~ s/^[ ]{4}/\t/xmsg;
is($obj->usage->text, $expected, 'Usage text has nicely sorted options');

View File

@ -1,11 +1,10 @@
Name: perl-MouseX-Getopt
Summary: Mouse role for processing command line options
Version: 0.37
Release: 10%{?dist}
Version: 0.38
Release: 1%{?dist}
License: GPL+ or Artistic
URL: https://metacpan.org/release/MouseX-Getopt
Source0: https://cpan.metacpan.org/authors/id/G/GF/GFUJI/MouseX-Getopt-%{version}.tar.gz
Patch0: MouseX-Getopt-0.37-gld103.patch
Source0: https://cpan.metacpan.org/modules/by-module/MouseX/MouseX-Getopt-%{version}.tar.gz
BuildArch: noarch
# Module Build
BuildRequires: perl-generators
@ -49,9 +48,6 @@ objects using parameters passed in from the command line.
%prep
%setup -q -n MouseX-Getopt-%{version}
# Fix compatibility with GLD 0.103 (GH#12, GH#13)
%patch0 -p1
%build
perl Build.PL --installdirs=vendor
./Build
@ -63,7 +59,7 @@ perl Build.PL --installdirs=vendor
./Build test
%files
# Note: malformed LICENSE file in 0.35 .. 0.37 not shipped
# Note: malformed LICENSE file in 0.35 .. 0.38 not shipped
# https://github.com/gfx/mousex-getopt/issues/2
%doc Changes README.md
%{perl_vendorlib}/MouseX/
@ -79,6 +75,10 @@ perl Build.PL --installdirs=vendor
%{_mandir}/man3/MouseX::Getopt::Strict.3*
%changelog
* Mon Jan 28 2019 Paul Howarth <paul@city-fan.org> - 0.38-1
- Update to 0.38
- Cope with GLD output changes in version 0.103 (GH#13)
* Tue Aug 21 2018 Paul Howarth <paul@city-fan.org> - 0.37-10
- Fix compatibility with GLD 0.103 (GH#12, GH#13)

View File

@ -1 +1 @@
080b1895635b525f2b9792a672b2569e MouseX-Getopt-0.37.tar.gz
SHA512 (MouseX-Getopt-0.38.tar.gz) = 2a1f870f45f8b9ceae5f16421257f7b0b5fe97e09af9968686a00cbf320c56cfd6ad3ba7b2fcf714f22add98b0843a7e2b46f8d9b3c9ce36b2e9840b2ca5e621