3 %bcond_without tests # do not perform "make test"
7 Summary: Eval::Closure - safely and cleanly create closures via string eval
8 Summary(pl.UTF-8): Eval::Closure - bezpieczne i czyste tworzenie dopełnień poprzez eval łańcucha
9 Name: perl-Eval-Closure
13 License: GPL v1+ or Artistic
14 Group: Development/Languages/Perl
15 Source0: http://www.cpan.org/modules/by-authors/id/D/DO/DOY/Eval-Closure-%{version}.tar.gz
16 # Source0-md5: ceeb1fc579ac9af981fa6b600538c285
17 URL: https://metacpan.org/release/Eval-Closure
18 BuildRequires: perl-ExtUtils-MakeMaker >= 6.30
19 BuildRequires: perl-devel >= 1:5.8.0
20 BuildRequires: rpm-perlprov >= 4.1-13
21 BuildRequires: rpmbuild(macros) >= 1.745
23 BuildRequires: perl-Test-Fatal
24 BuildRequires: perl-Test-Requires
25 BuildRequires: perl-Test-Simple >= 0.88
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 String eval is often used for dynamic code generation. For instance,
32 Moose uses it heavily, to generate inlined versions of accessors and
33 constructors, which speeds code up at runtime by a significant amount.
34 String eval is not without its issues however - it's difficult to
35 control the scope it's used in (which determines which variables are
36 in scope inside the eval), and it's easy to miss compilation errors,
37 since eval catches them and sticks them in $@ instead.
39 This module attempts to solve these problems. It provides an
40 eval_closure function, which evals a string in a clean environment,
41 other than a fixed list of specified variables. Compilation errors are
42 rethrown automatically.
44 %description -l pl.UTF-8
45 Instrukcja eval na łańcuchu często służy do dynamicznego generowania
46 kodu. Np. Moose wykorzystuje ją intensywnie do generowania
47 wewnętrznych wersji akcesorów i konstruktorów, co znacząco przyspiesza
48 kod w trakcie działania. Użycie eval na łańcuchu nie jest jednak
49 pozbawione wad - jest trudno kontrolować zakres, w jakim jest użyte
50 (co określa, które zmienne są w tym zakresie) i łatwo przeoczyć błędy
51 kompilacji, jako że eval przechwytuje je i umieszcza w $@.
53 Niniejszy moduł próbuje rozwiązać te problemy. Dostarcza funkcję
54 eval_closure, która wylicza łańcuch w czystym środowisku, innym niż
55 stała lista określonych zmiennych. Błędy kompilacji są automatyczne
59 %setup -q -n %{pdir}-%{pnam}-%{version}
62 %{__perl} Makefile.PL \
66 %{?with_tests:%{__make} test}
69 rm -rf $RPM_BUILD_ROOT
71 %{__make} pure_install \
72 DESTDIR=$RPM_BUILD_ROOT
75 rm -rf $RPM_BUILD_ROOT
78 %defattr(644,root,root,755)
80 %{perl_vendorlib}/Eval/Closure.pm
81 %{_mandir}/man3/Eval::Closure.3pm*