# # spec file for package perl-SUPER # # Copyright (c) 2015 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 # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: perl-SUPER Version: 1.20141117 Release: 27.16 %define cpan_name SUPER Summary: Control Superclass Method Dispatch License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/SUPER/ Source0: http://www.cpan.org/authors/id/C/CH/CHROMATIC/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Module::Build) BuildRequires: perl(Scalar::Util) >= 1.20 BuildRequires: perl(Sub::Identify) >= 0.03 Requires: perl(Scalar::Util) >= 1.20 Requires: perl(Sub::Identify) >= 0.03 %{perl_requires} %description When subclassing a class, you occasionally want to dispatch control to the superclass -- at least conditionally and temporarily. The Perl syntax for calling your superclass is ugly and unwieldy: $self->SUPER::method(@_); especially when compared to its Ruby equivalent: super; It's even worse in that the normal Perl redispatch mechanism only dispatches to the parent of the class containing the method _at compile time_. That doesn't work very well for mixins and roles. This module provides nicer equivalents, along with the universal method 'super' to determine a class' own superclass. This allows you to do things such as: goto &{$_[0]->super('my_method')}; if you don't like wasting precious stack frames. If you are using roles or mixins or otherwise pulling in methods from other packages that need to dispatch to their super methods, or if you want to pass different arguments to the super method, use the 'SUPER()' method: $self->SUPER( qw( other arguments here ) ); %prep %setup -q -n %{cpan_name}-%{version} %build %{__perl} Build.PL installdirs=vendor ./Build build flags=%{?_smp_mflags} %check ./Build test %install ./Build install destdir=%{buildroot} create_packlist=0 %perl_gen_filelist %files -f %{name}.files %defattr(-,root,root,755) %doc Changes LICENSE README %changelog * Sat Aug 8 2015 coolo@suse.com - updated to 1.20141117 see /usr/share/doc/packages/perl-SUPER/Changes 1.20141117 2014-11-17 09:12:01-08:00 America/Los_Angeles - improved export mechanism - removed useless Exporter tests - improved docs (RT #79681) 1.20141116 2014-11-16 14:07:18-08:00 America/Los_Angeles - resolved Test::More changes (RT #97939) * Tue Jun 4 2013 coolo@suse.com - updated to 1.20120705 - resolved PAUSE packaging nit (Oliver Mengué, RT #77110) - converted to dzil * Tue Nov 30 2010 coolo@novell.com - switch to perl_requires macro * Tue Aug 3 2010 chris@computersalat.de - initial package 1.17 * created by cpanspec 1.78