diff --git a/Class-Accessor-0.34.tar.gz b/Class-Accessor-0.34.tar.gz deleted file mode 100644 index 2382146..0000000 --- a/Class-Accessor-0.34.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cdb1e0cdf8380fb9b63b44c33ce5afc1068736d55ac5904bf0eaa1efc1c3cefc -size 12315 diff --git a/Class-Accessor-0.51.tar.gz b/Class-Accessor-0.51.tar.gz new file mode 100644 index 0000000..5162be0 --- /dev/null +++ b/Class-Accessor-0.51.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf12a3e5de5a2c6e8a447b364f4f5a050bf74624c56e315022ae7992ff2f411c +size 13013 diff --git a/cpanspec.yml b/cpanspec.yml new file mode 100644 index 0000000..76ad4a4 --- /dev/null +++ b/cpanspec.yml @@ -0,0 +1,28 @@ +--- +#description_paragraphs: 3 +#description: |- +# override description from CPAN +#summary: override summary from CPAN +#no_testing: broken upstream +#sources: +# - source1 +# - source2 +#patches: +# foo.patch: -p1 +# bar.patch: +#preamble: |- +# BuildRequires: gcc-c++ +#post_prep: |- +# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'` +# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL +#post_build: |- +# rm unused.files +#post_install: |- +# sed on %{name}.files +#license: SUSE-NonFree +#skip_noarch: 1 +#custom_build: |- +#./Build build flags=%{?_smp_mflags} --myflag +#custom_test: |- +#startserver && make test +#ignore_requires: Bizarre::Module diff --git a/perl-Class-Accessor.changes b/perl-Class-Accessor.changes index d3c4b5a..5612284 100644 --- a/perl-Class-Accessor.changes +++ b/perl-Class-Accessor.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon Oct 23 05:08:18 UTC 2017 - coolo@suse.com + +- updated to 0.51 + see /usr/share/doc/packages/perl-Class-Accessor/Changes + + 0.50 2017-10-20 + Thanks to Jonas B. Nielsen for working through the RT queue. + - patch for speed increase RT#84838 + - patch for faster constructor RT#57353 + - fixed typos for RT#61304 and RT#86422 + ------------------------------------------------------------------- Fri Nov 18 11:08:48 UTC 2011 - coolo@suse.com diff --git a/perl-Class-Accessor.spec b/perl-Class-Accessor.spec index 5c0c0a8..88eaf8a 100644 --- a/perl-Class-Accessor.spec +++ b/perl-Class-Accessor.spec @@ -1,7 +1,7 @@ # # spec file for package perl-Class-Accessor # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2017 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 @@ -15,44 +15,79 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - Name: perl-Class-Accessor +Version: 0.51 +Release: 0 %define cpan_name Class-Accessor Summary: Automated accessor generation -Version: 0.34 -Release: 12 -License: Artistic License .. +License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl -Url: http://search.cpan.org/dists/Class-Accessor -Source: %{cpan_name}-%{version}.tar.gz +Url: http://search.cpan.org/dist/Class-Accessor/ +Source0: https://cpan.metacpan.org/authors/id/K/KA/KASEI/%{cpan_name}-%{version}.tar.gz +Source1: cpanspec.yml +BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build -%{perl_requires} BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(Sub::Name) -Requires: perl(Carp) -Requires: perl(Sub::Name) -Provides: %{cpan_name} +%{perl_requires} %description -This module automatically generates accessor/mutators for your class. Most of -the time, writing accessors is an exercise in cutting and pasting. +This module automagically generates accessors/mutators for your class. -If you make your module a subclass of Class::Accessor and declare your accessor -fields with mk_accessors() then you'll find yourself with a set of +Most of the time, writing accessors is an exercise in cutting and pasting. +You usually wind up with a series of methods like this: + + sub name { + my $self = shift; + if(@_) { + $self->{name} = $_[0]; + } + return $self->{name}; + } + + sub salary { + my $self = shift; + if(@_) { + $self->{salary} = $_[0]; + } + return $self->{salary}; + } + + # etc... + +One for each piece of data in your object. While some will be unique, doing +value checks and special storage tricks, most will simply be exercises in +repetition. Not only is it Bad Style to have a bunch of repetitious code, +but it's also simply not lazy, which is the real tragedy. + +If you make your module a subclass of Class::Accessor and declare your +accessor fields with mk_accessors() then you'll find yourself with a set of automatically generated accessors which can even be customized! -Authors: --------- - Michael G Schwern +The basic set up is very simple: + + package Foo; + use base qw(Class::Accessor); + Foo->mk_accessors( qw(far bar car) ); + +Done. Foo now has simple far(), bar() and car() accessors defined. + +Alternatively, if you want to follow Damian's _best practice_ guidelines +you can use: + + package Foo; + use base qw(Class::Accessor); + Foo->follow_best_practice; + Foo->mk_accessors( qw(far bar car) ); + +*Note:* you must call 'follow_best_practice' before calling 'mk_accessors'. %prep %setup -q -n %{cpan_name}-%{version} %build -%{__perl} Makefile.PL OPTIMIZE="$RPM_OPT_FLAGS -Wall" +%{__perl} Makefile.PL INSTALLDIRS=vendor %{__make} %{?_smp_mflags} %check @@ -63,11 +98,8 @@ Authors: %perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf $RPM_BUILD_ROOT - %files -f %{name}.files -%defattr(-,root,root) -%doc Changes README examples +%defattr(-,root,root,755) +%doc Changes examples README %changelog