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://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/%{pdir}-%{pnam}-%{version}.tar.gz
17 # Source0-md5: fed7ed691b0945d8ec27e7c7440e6f97
18 BuildRequires: perl-devel >= 1:5.8.0
19 BuildRequires: rpm-perlprov >= 4.1-13
21 BuildRequires: perl(Test::More) >= 0.47
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 Polymorphic return values are really useful. Often, we just want to
28 know if something worked or not. Other times, we'd like to know what
29 the error text was. Still others, we may want to know what the error
30 code was, and what the error properties were. We don't want to handle
31 objects or data structures for every single return value, but we do
32 want to check error conditions in our code because that's what good
35 When functions are successful they may return true, or perhaps some
36 useful data. In the quest to provide consistent return values, this
37 gets confusing between complex, informational errors and successful
40 This module provides these features with a simple API that should get
41 you what you're looking for in each context a return value is used in.
43 %description -l pl.UTF-8
44 Polimorficzne wartości zwracane bywają naprawdę przydatne. Często
45 chcemy tylko wiedzieć, czy coś zadziałało, czy nie. Innym razem
46 chcielibyśmy poznać tekstową postać błędu. W jeszcze innym przypadku
47 możemy chcieć poznać kod błędu i jego właściwości. Nie chcemy
48 obsługiwać obiektów czy struktur danych dla każdej zwracanej wartości,
49 ale chcemy sprawdzić w naszym kodzie wystąpienie błędu, ponieważ tak
50 robią dobrzy programiści.
52 W przypadku sukcesu funkcje mogą zwrócić wartość true albo jakieś
53 przydatne dane. Przy poszukiwaniu sposobu dostarczenia spójnych
54 wartości błędów, staje się to coraz bardziej zagmatwane pomiędzy
55 złożonymi, informacyjnymi błędami a poprawnymi zwracanymi wartościami.
57 Ten moduł dostarcza te możliwości z prostym API, które powinno
58 zapewnić to, czego szukamy w każdym kontekście wykorzystania zwracanej
62 %setup -q -n %{pdir}-%{pnam}-%{version}
65 %{__perl} Makefile.PL \
69 %{?with_tests:%{__make} test}
72 rm -rf $RPM_BUILD_ROOT
75 DESTDIR=$RPM_BUILD_ROOT
78 rm -rf $RPM_BUILD_ROOT
81 %defattr(644,root,root,755)
83 %dir %{perl_vendorlib}/Return
84 %{perl_vendorlib}/Return/Value.pm