3 %bcond_without tests # do not perform "make test"
6 %define pnam Dispatcher
7 Summary: Path::Dispatcher - Flexible and extensible dispatch
8 Name: perl-Path-Dispatcher
11 License: GPL v1+ or Artistic
12 Group: Development/Languages/Perl
13 Source0: http://www.cpan.org/modules/by-authors/id/E/ET/ETHER/Path-Dispatcher-%{version}.tar.gz
14 # Source0-md5: 936f5c08da60f2555d7ed304281e724b
15 URL: https://metacpan.org/release/Path-Dispatcher
16 BuildRequires: perl-Module-Build
17 BuildRequires: perl-devel >= 1:5.8.0
18 BuildRequires: rpm-perlprov >= 4.1-13
19 BuildRequires: rpmbuild(macros) >= 1.745
21 BuildRequires: perl-Moo
22 BuildRequires: perl-MooX-TypeTiny
23 BuildRequires: perl-Test-Fatal
24 BuildRequires: perl-Try-Tiny
25 BuildRequires: perl-Type-Tiny
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 We really like Jifty::Dispatcher and wanted to use it for Prophet's
34 The basic operation is that of dispatch. Dispatch takes a path and a
35 list of rules, and it returns a list of matches. From there you can
36 "run" the rules that matched. These phases are distinct so that, if
37 you need to, you can inspect which rules were matched without ever
38 running their codeblocks.
40 Tab completion support is also available (see in particular
41 Path::Dispatcher::Cookbook/How can I configure tab completion for
42 shells?) for the dispatchers you write.
44 Each rule may take a variety of different forms (which I think
45 justifies the "flexible" adjective in the module's description). Some
46 of the rule types are:
48 Since Path::Dispatcher is designed with good object-oriented
49 programming practices, you can also write your own domain-specific
50 rule classes (which earns it the "extensible" adjective). For example,
51 in Prophet, we have a custom rule for matching, and tab completing,
55 %setup -q -n %{pdir}-%{pnam}-%{version}
58 %{__perl} Makefile.PL \
63 %{?with_tests:%{__make} test}
66 rm -rf $RPM_BUILD_ROOT
69 DESTDIR=$RPM_BUILD_ROOT
72 rm -rf $RPM_BUILD_ROOT
75 %defattr(644,root,root,755)
76 %doc Changes INSTALL README
77 %{perl_vendorlib}/Path/*.pm
78 %{perl_vendorlib}/Path/Dispatcher