Hello community,
here is the log from the commit of package perl-Devel-OverloadInfo for
openSUSE:Factory checked in at 2018-02-09 15:47:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Devel-OverloadInfo (Old)
and /work/SRC/openSUSE:Factory/.perl-Devel-OverloadInfo.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Devel-OverloadInfo"
Fri Feb 9 15:47:43 2018 rev:3 rq:573993 version:0.005
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Devel-OverloadInfo/perl-Devel-OverloadInfo.changes
2015-08-27 08:56:33.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Devel-OverloadInfo.new/perl-Devel-OverloadInfo.changes
2018-02-09 15:47:46.442899924 +0100
@@ -1,0 +2,9 @@
+Wed Feb 7 16:23:31 UTC 2018 - [email protected]
+
+- updated to 0.005
+ see /usr/share/doc/packages/perl-Devel-OverloadInfo/Changes
+
+ 0.005 2018-01-22 00:45:49+00:00 Europe/London
+ - Add overload_op_info() function for info about a single op
+
+-------------------------------------------------------------------
Old:
----
Devel-OverloadInfo-0.004.tar.gz
New:
----
Devel-OverloadInfo-0.005.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Devel-OverloadInfo.spec ++++++
--- /var/tmp/diff_new_pack.0ER2cb/_old 2018-02-09 15:47:47.182873351 +0100
+++ /var/tmp/diff_new_pack.0ER2cb/_new 2018-02-09 15:47:47.182873351 +0100
@@ -1,7 +1,7 @@
#
# spec file for package perl-Devel-OverloadInfo
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,14 @@
Name: perl-Devel-OverloadInfo
-Version: 0.004
+Version: 0.005
Release: 0
%define cpan_name Devel-OverloadInfo
Summary: Introspect Overloaded Operators
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Devel-OverloadInfo/
-Source0:
http://www.cpan.org/authors/id/I/IL/ILMARI/%{cpan_name}-%{version}.tar.gz
+Source0:
https://cpan.metacpan.org/authors/id/I/IL/ILMARI/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -42,9 +42,9 @@
%{perl_requires}
%description
-Devel::OverloadInfo returns information about overload operators for a
+Devel::OverloadInfo returns information about overloaded operators for a
given class (or object), including where in the inheritance hierarchy the
-overloads are declared and where the code implementing it is.
+overloads are declared and where the code implementing them is.
%prep
%setup -q -n %{cpan_name}-%{version}
@@ -63,6 +63,7 @@
%files -f %{name}.files
%defattr(-,root,root,755)
-%doc Changes LICENSE README
+%doc Changes README
+%license LICENSE
%changelog
++++++ Devel-OverloadInfo-0.004.tar.gz -> Devel-OverloadInfo-0.005.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/Changes
new/Devel-OverloadInfo-0.005/Changes
--- old/Devel-OverloadInfo-0.004/Changes 2015-08-13 18:35:34.000000000
+0200
+++ new/Devel-OverloadInfo-0.005/Changes 2018-01-22 01:45:50.000000000
+0100
@@ -1,5 +1,8 @@
Revision history for Devel-OverloadInfo
+0.005 2018-01-22 00:45:49+00:00 Europe/London
+ - Add overload_op_info() function for info about a single op
+
0.004 2015-08-13 17:35:32+01:00 Europe/London
- Document that existence of undef 'fallback' varies between perl versions
- Add tests for empty, inherited-only and no overloading
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/MANIFEST
new/Devel-OverloadInfo-0.005/MANIFEST
--- old/Devel-OverloadInfo-0.004/MANIFEST 2015-08-13 18:35:34.000000000
+0200
+++ new/Devel-OverloadInfo-0.005/MANIFEST 2018-01-22 01:45:50.000000000
+0100
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v5.039.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v6.009.
Changes
LICENSE
MANIFEST
@@ -9,6 +9,6 @@
dist.ini
lib/Devel/OverloadInfo.pm
t/author-pod-spell.t
+t/author-pod-syntax.t
t/basic.t
-t/release-pod-syntax.t
t/rt106379-inheritance-corruption.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/META.json
new/Devel-OverloadInfo-0.005/META.json
--- old/Devel-OverloadInfo-0.004/META.json 2015-08-13 18:35:34.000000000
+0200
+++ new/Devel-OverloadInfo-0.005/META.json 2018-01-22 01:45:50.000000000
+0100
@@ -1,10 +1,10 @@
{
"abstract" : "introspect overloaded operators",
"author" : [
- "Dagfinn Ilmari Mannsåker <[email protected]>"
+ "Dagfinn Ilmari Manns\u00e5ker <[email protected]>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 5.039, CPAN::Meta::Converter version
2.150001",
+ "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version
2.150010",
"license" : [
"perl_5"
],
@@ -43,7 +43,6 @@
"requires" : {
"Test::Fatal" : "0",
"Test::More" : "0.88",
- "base" : "0",
"parent" : "0",
"perl" : "5.006"
}
@@ -61,6 +60,7 @@
"web" : "https://github.com/ilmari/Devel-OverloadInfo"
}
},
- "version" : "0.004"
+ "version" : "0.005",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 3.0233"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/META.yml
new/Devel-OverloadInfo-0.005/META.yml
--- old/Devel-OverloadInfo-0.004/META.yml 2015-08-13 18:35:34.000000000
+0200
+++ new/Devel-OverloadInfo-0.005/META.yml 2018-01-22 01:45:50.000000000
+0100
@@ -5,14 +5,13 @@
build_requires:
Test::Fatal: '0'
Test::More: '0.88'
- base: '0'
parent: '0'
perl: '5.006'
configure_requires:
ExtUtils::MakeMaker: '0'
perl: '5.006'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.039, CPAN::Meta::Converter version
2.150001'
+generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version
2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -31,4 +30,5 @@
resources:
bugtracker:
http://rt.cpan.org/Public/Dist/Display.html?Name=Devel-OverloadInfo
repository: git://github.com/ilmari/Devel-OverloadInfo.git
-version: '0.004'
+version: '0.005'
+x_serialization_backend: 'YAML::Tiny version 1.70'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/Makefile.PL
new/Devel-OverloadInfo-0.005/Makefile.PL
--- old/Devel-OverloadInfo-0.004/Makefile.PL 2015-08-13 18:35:34.000000000
+0200
+++ new/Devel-OverloadInfo-0.005/Makefile.PL 2018-01-22 01:45:50.000000000
+0100
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker
v5.039.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker
v6.009.
use strict;
use warnings;
@@ -29,10 +29,9 @@
"TEST_REQUIRES" => {
"Test::Fatal" => 0,
"Test::More" => "0.88",
- "base" => 0,
"parent" => 0
},
- "VERSION" => "0.004",
+ "VERSION" => "0.005",
"test" => {
"TESTS" => "t/*.t"
}
@@ -47,7 +46,6 @@
"Sub::Identify" => 0,
"Test::Fatal" => 0,
"Test::More" => "0.88",
- "base" => 0,
"overload" => 0,
"parent" => 0,
"strict" => 0,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/README
new/Devel-OverloadInfo-0.005/README
--- old/Devel-OverloadInfo-0.004/README 2015-08-13 18:35:34.000000000 +0200
+++ new/Devel-OverloadInfo-0.005/README 2018-01-22 01:45:50.000000000 +0100
@@ -1,7 +1,7 @@
This archive contains the distribution Devel-OverloadInfo,
-version 0.004:
+version 0.005:
introspect overloaded operators
@@ -11,5 +11,5 @@
the same terms as the Perl 5 programming language system itself.
-This README file was generated by Dist::Zilla::Plugin::Readme v5.039.
+This README file was generated by Dist::Zilla::Plugin::Readme v6.009.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/dist.ini
new/Devel-OverloadInfo-0.005/dist.ini
--- old/Devel-OverloadInfo-0.004/dist.ini 2015-08-13 18:35:34.000000000
+0200
+++ new/Devel-OverloadInfo-0.005/dist.ini 2018-01-22 01:45:50.000000000
+0100
@@ -11,6 +11,10 @@
-remove = GatherDir
[PkgVersion]
+:version = 5.010
+die_on_existing_version = 1
+die_on_line_insertion = 1
+
[AutoPrereqs]
skip = \A(?:Base|Child)Class\z
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/lib/Devel/OverloadInfo.pm
new/Devel-OverloadInfo-0.005/lib/Devel/OverloadInfo.pm
--- old/Devel-OverloadInfo-0.004/lib/Devel/OverloadInfo.pm 2015-08-13
18:35:34.000000000 +0200
+++ new/Devel-OverloadInfo-0.005/lib/Devel/OverloadInfo.pm 2018-01-22
01:45:50.000000000 +0100
@@ -1,5 +1,5 @@
package Devel::OverloadInfo;
-$Devel::OverloadInfo::VERSION = '0.004';
+$Devel::OverloadInfo::VERSION = '0.005';
# ABSTRACT: introspect overloaded operators
#pod =head1 DESCRIPTION
@@ -7,7 +7,7 @@
#pod Devel::OverloadInfo returns information about L<overloaded|overload>
#pod operators for a given class (or object), including where in the
#pod inheritance hierarchy the overloads are declared and where the code
-#pod implementing it is.
+#pod implementing them is.
#pod
#pod =cut
@@ -20,7 +20,7 @@
use MRO::Compat;
use Exporter 5.57 qw(import);
-our @EXPORT_OK = qw(overload_info is_overloaded);
+our @EXPORT_OK = qw(overload_info overload_op_info is_overloaded);
sub stash_with_symbol {
my ($class, $symbol) = @_;
@@ -60,14 +60,18 @@
);
}
-#pod =func overload_info
+#pod =func overload_op_info
#pod
-#pod my $info = overload_info($class_or_object);
+#pod my $info = overload_op_info($class_or_object, $op);
#pod
-#pod Returns a hash reference with information about all the overloaded
-#pod operators of the argument, which can be either a class name or a blessed
-#pod object. The keys are the overloaded operators, as specified in
-#pod C<%overload::ops> (see L<overload/Overloadable Operations>).
+#pod Returns a hash reference with information about the specified
+#pod overloaded operator of the named class or blessed object.
+#pod
+#pod Returns C<undef> if the operator is not overloaded.
+#pod
+#pod See L<overload/Overloadable Operations> for the available operators.
+#pod
+#pod The keys in the returned hash are as follows:
#pod
#pod =over
#pod
@@ -103,6 +107,52 @@
#pod
#pod =cut
+sub overload_op_info {
+ my ($class, $op) = @_;
+ $class = blessed($class) || $class;
+
+ return undef unless is_overloaded($class);
+ my $op_method = $op eq 'fallback' ? "()" : "($op";
+ my ($stash, $func) = stash_with_symbol($class, "&$op_method")
+ or return undef;
+ my $info = {
+ class => $stash->name,
+ };
+ if ($func == \&overload::nil) {
+ # Named method or fallback, stored in the scalar slot
+ if (my $value_ref = $stash->get_symbol("\$$op_method")) {
+ my $value = $$value_ref;
+ if ($op eq 'fallback') {
+ $info->{value} = $value;
+ } else {
+ $info->{method_name} = $value;
+ if (my ($impl_stash, $impl_func) = stash_with_symbol($class,
"&$value")) {
+ $info->{code_class} = $impl_stash->name;
+ $info->{code} = $impl_func;
+ }
+ }
+ }
+ } else {
+ $info->{code} = $func;
+ }
+ $info->{code_name} = sub_fullname($info->{code})
+ if exists $info->{code};
+
+ return $info;
+}
+
+#pod =func overload_info
+#pod
+#pod my $info = overload_info($class_or_object);
+#pod
+#pod Returns a hash reference with information about all the overloaded
+#pod operators of specified class name or blessed object. The keys are the
+#pod overloaded operators, as specified in C<%overload::ops> (see
+#pod L<overload/Overloadable Operations>), and the values are the hashes
+#pod returned by L</overload_op_info>.
+#pod
+#pod =cut
+
sub overload_info {
my $class = blessed($_[0]) || $_[0];
@@ -110,31 +160,9 @@
my (%overloaded);
for my $op (map split(/\s+/), values %overload::ops) {
- my $op_method = $op eq 'fallback' ? "()" : "($op";
- my ($stash, $func) = stash_with_symbol($class, "&$op_method")
+ my $info = overload_op_info($class, $op)
or next;
- my $info = $overloaded{$op} = {
- class => $stash->name,
- };
- if ($func == \&overload::nil) {
- # Named method or fallback, stored in the scalar slot
- if (my $value_ref = $stash->get_symbol("\$$op_method")) {
- my $value = $$value_ref;
- if ($op eq 'fallback') {
- $info->{value} = $value;
- } else {
- $info->{method_name} = $value;
- if (my ($impl_stash, $impl_func) =
stash_with_symbol($class, "&$value")) {
- $info->{code_class} = $impl_stash->name;
- $info->{code} = $impl_func;
- }
- }
- }
- } else {
- $info->{code} = $func;
- }
- $info->{code_name} = sub_fullname($info->{code})
- if exists $info->{code};
+ $overloaded{$op} = $info
}
return \%overloaded;
}
@@ -161,14 +189,14 @@
=head1 VERSION
-version 0.004
+version 0.005
=head1 DESCRIPTION
Devel::OverloadInfo returns information about L<overloaded|overload>
operators for a given class (or object), including where in the
inheritance hierarchy the overloads are declared and where the code
-implementing it is.
+implementing them is.
=head1 FUNCTIONS
@@ -185,14 +213,18 @@
doesn't trigger various bugs associated with it in versions of perl
before 5.16.
-=head2 overload_info
+=head2 overload_op_info
- my $info = overload_info($class_or_object);
+ my $info = overload_op_info($class_or_object, $op);
-Returns a hash reference with information about all the overloaded
-operators of the argument, which can be either a class name or a blessed
-object. The keys are the overloaded operators, as specified in
-C<%overload::ops> (see L<overload/Overloadable Operations>).
+Returns a hash reference with information about the specified
+overloaded operator of the named class or blessed object.
+
+Returns C<undef> if the operator is not overloaded.
+
+See L<overload/Overloadable Operations> for the available operators.
+
+The keys in the returned hash are as follows:
=over
@@ -226,6 +258,16 @@
=back
+=head2 overload_info
+
+ my $info = overload_info($class_or_object);
+
+Returns a hash reference with information about all the overloaded
+operators of specified class name or blessed object. The keys are the
+overloaded operators, as specified in C<%overload::ops> (see
+L<overload/Overloadable Operations>), and the values are the hashes
+returned by L</overload_op_info>.
+
=head1 CAVEATS
Whether the C<fallback> key exists when it has its default value of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/t/author-pod-spell.t
new/Devel-OverloadInfo-0.005/t/author-pod-spell.t
--- old/Devel-OverloadInfo-0.004/t/author-pod-spell.t 2015-08-13
18:35:34.000000000 +0200
+++ new/Devel-OverloadInfo-0.005/t/author-pod-spell.t 2018-01-22
01:45:50.000000000 +0100
@@ -1,8 +1,8 @@
BEGIN {
unless ($ENV{AUTHOR_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for testing by the author');
+ print qq{1..0 # SKIP these tests are for testing by the author\n};
+ exit
}
}
@@ -10,18 +10,18 @@
use warnings;
use Test::More;
-# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006009
+# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005
use Test::Spelling 0.12;
use Pod::Wordlist;
add_stopwords(<DATA>);
-all_pod_files_spelling_ok( qw( bin lib ) );
+all_pod_files_spelling_ok( qw( bin lib ) );
__DATA__
Dagfinn
+Devel
Ilmari
Mannsåker
+OverloadInfo
ilmari
lib
-Devel
-OverloadInfo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/t/author-pod-syntax.t
new/Devel-OverloadInfo-0.005/t/author-pod-syntax.t
--- old/Devel-OverloadInfo-0.004/t/author-pod-syntax.t 1970-01-01
01:00:00.000000000 +0100
+++ new/Devel-OverloadInfo-0.005/t/author-pod-syntax.t 2018-01-22
01:45:50.000000000 +0100
@@ -0,0 +1,15 @@
+#!perl
+
+BEGIN {
+ unless ($ENV{AUTHOR_TESTING}) {
+ print qq{1..0 # SKIP these tests are for testing by the author\n};
+ exit
+ }
+}
+
+# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
+use strict; use warnings;
+use Test::More;
+use Test::Pod 1.41;
+
+all_pod_files_ok();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/t/basic.t
new/Devel-OverloadInfo-0.005/t/basic.t
--- old/Devel-OverloadInfo-0.004/t/basic.t 2015-08-13 18:35:34.000000000
+0200
+++ new/Devel-OverloadInfo-0.005/t/basic.t 2018-01-22 01:45:50.000000000
+0100
@@ -3,7 +3,7 @@
use warnings;
use Test::More 0.88;
-use Devel::OverloadInfo qw(overload_info is_overloaded);
+use Devel::OverloadInfo qw(overload_info overload_op_info is_overloaded);
sub MyModule::negate { -$_[0] }
@@ -61,6 +61,9 @@
ok !is_overloaded($class), "$class is not overloaded";
}
+is overload_op_info('BaseClass', 'cmp'), undef,
+ 'overload_op_info() returns undef for non-overloaded op';
+
my $boi = overload_info('BaseClass');
# Whether undef fallback exists varies between perl versions
@@ -69,6 +72,13 @@
class => 'BaseClass',
value => undef,
}, 'BaseClass fallback is undef';
+ is_deeply overload_op_info('BaseClass', 'fallback'),
+ $fallback,
+ "overload_op_info('BaseClass','fallback') matches overload_info()";
+}
+else {
+ is overload_op_info('BaseClass', 'fallback'), undef,
+ "overload_op_info('BaseClass','fallback') matches overload_info()";
}
is_deeply $boi,
@@ -127,10 +137,20 @@
},
"ChildClass overload info" or note explain $coi;
+for my $op (sort keys %$coi) {
+ is_deeply overload_op_info('ChildClass', $op),
+ $coi->{$op},
+ "overload_op_info('ChildClass', $op)";
+}
+
+
is_deeply overload_info('InheritedOnly'),
overload_info('BaseClass'),
'InheritedOnly has same overloads as BaseClass';
+is overload_op_info('NoOverload', 'fallback'), undef,
+ 'overload_op_info on non-overloaded class';
+
is_deeply overload_info('NoOverload'), {},
'NoOverload has no overloads';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-OverloadInfo-0.004/t/release-pod-syntax.t
new/Devel-OverloadInfo-0.005/t/release-pod-syntax.t
--- old/Devel-OverloadInfo-0.004/t/release-pod-syntax.t 2015-08-13
18:35:34.000000000 +0200
+++ new/Devel-OverloadInfo-0.005/t/release-pod-syntax.t 1970-01-01
01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-#!perl
-
-BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate
testing');
- }
-}
-
-# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
-use Test::More;
-use Test::Pod 1.41;
-
-all_pod_files_ok();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Devel-OverloadInfo-0.004/t/rt106379-inheritance-corruption.t
new/Devel-OverloadInfo-0.005/t/rt106379-inheritance-corruption.t
--- old/Devel-OverloadInfo-0.004/t/rt106379-inheritance-corruption.t
2015-08-13 18:35:34.000000000 +0200
+++ new/Devel-OverloadInfo-0.005/t/rt106379-inheritance-corruption.t
2018-01-22 01:45:50.000000000 +0100
@@ -17,7 +17,7 @@
{
package SubFoo;
# Must have subclass inheriting the overload
- use base 'Foo';
+ use parent -norequire => 'Foo';
}
Devel::OverloadInfo::overload_info('SubFoo');