3 %bcond_without tests # do not perform "make test"
5 %include /usr/lib/rpm/macros.perl
8 Summary: Return::Value - Polymorphic Return Values
9 Summary(pl.UTF-8): Return::Value - Polimorficzne zwracanie wartości
10 Name: perl-Return-Value
14 License: GPL v1+ or Artistic
15 Group: Development/Languages/Perl
16 Source0: http://www.cpan.org/modules/by-authors/id/R/RJ/RJBS/%{pdir}-%{pnam}-%{version}.tar.gz
17 # Source0-md5: 03128d525392c88e458aa2cd14eb107a
18 URL: http://search.cpan.org/dist/Return-Value/
19 BuildRequires: perl-devel >= 1:5.8.0
20 BuildRequires: rpm-perlprov >= 4.1-13
22 BuildRequires: perl(Test::More) >= 0.47
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 Polymorphic return values are really useful. Often, we just want to
29 know if something worked or not. Other times, we'd like to know what
30 the error text was. Still others, we may want to know what the error
31 code was, and what the error properties were. We don't want to handle
32 objects or data structures for every single return value, but we do
33 want to check error conditions in our code because that's what good
36 When functions are successful they may return true, or perhaps some
37 useful data. In the quest to provide consistent return values, this
38 gets confusing between complex, informational errors and successful
41 This module provides these features with a simple API that should get
42 you what you're looking for in each context a return value is used in.
44 %description -l pl.UTF-8
45 Polimorficzne wartości zwracane bywają naprawdę przydatne. Często
46 chcemy tylko wiedzieć, czy coś zadziałało, czy nie. Innym razem
47 chcielibyśmy poznać tekstową postać błędu. W jeszcze innym przypadku
48 możemy chcieć poznać kod błędu i jego właściwości. Nie chcemy
49 obsługiwać obiektów czy struktur danych dla każdej zwracanej wartości,
50 ale chcemy sprawdzić w naszym kodzie wystąpienie błędu, ponieważ tak
51 robią dobrzy programiści.
53 W przypadku sukcesu funkcje mogą zwrócić wartość true albo jakieś
54 przydatne dane. Przy poszukiwaniu sposobu dostarczenia spójnych
55 wartości błędów, staje się to coraz bardziej zagmatwane pomiędzy
56 złożonymi, informacyjnymi błędami a poprawnymi zwracanymi wartościami.
58 Ten moduł dostarcza te możliwości z prostym API, które powinno
59 zapewnić to, czego szukamy w każdym kontekście wykorzystania zwracanej
63 %setup -q -n %{pdir}-%{pnam}-%{version}
66 %{__perl} Makefile.PL \
70 %{?with_tests:%{__make} test}
73 rm -rf $RPM_BUILD_ROOT
76 DESTDIR=$RPM_BUILD_ROOT
79 rm -rf $RPM_BUILD_ROOT
82 %defattr(644,root,root,755)
84 %dir %{perl_vendorlib}/Return
85 %{perl_vendorlib}/Return/Value.pm