Christian Wittmer
2011-08-24 21:43:57 +00:00
committed by Git OBS Bridge
parent f7220d052d
commit 2ca9211e69
2 changed files with 19 additions and 67 deletions

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Aug 24 21:43:02 UTC 2011 - chris@computersalat.de
- fix deps
* suse > 1140: perl(Class::ISA)
- remove Recommends
- cleanup desc
-------------------------------------------------------------------
Thu Apr 21 04:58:20 UTC 2011 - coolo@opensuse.org

View File

@@ -1,7 +1,7 @@
#
# spec file for package perl-CGI-Application-Plugin-Forward (Version 1.06)
# spec file for package perl-CGI-Application-Plugin-Forward
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -27,14 +27,19 @@ Source: http://www.cpan.org/authors/id/M/MG/MGRAHAM/%{cpan_name}-%{versi
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl(Module::Build)
BuildRequires: perl-macros
BuildRequires: perl(CGI::Application)
BuildRequires: perl(Module::Build)
BuildRequires: perl(Test::More)
# perl 5.12.3: Class::ISA will be removed from the Perl core
# distribution in the next major release.
%if 0%{?suse_version} > 1140
BuildRequires: perl(Class::ISA)
%endif
BuildRequires: perl(CGI::Application)
Requires: perl(CGI::Application)
Requires: perl(Test::More)
Recommends: perl(CGI::Application::Plugin::AutoRunmode)
%if 0%{?suse_version} > 1010
Recommends: perl(CGI::Application::Plugin::AutoRunmode) >= 0.09
%endif
%{perl_requires}
%description
@@ -48,67 +53,6 @@ This means that calling '$self->get_current_runmode' after calling
modules that depend on the name of the current run mode such as the
CGI::Application::Plugin::AnyTemplate manpage.
For example, here's how to pass control to a run mode named 'other_action'
from 'start' while updating the value of 'current_run_mode':
sub setup {
my $self = shift;
$self->run_modes({
start => 'start',
other_action => 'other_method',
});
}
sub start {
my $self = shift;
return $self->forward('other_action');
}
sub other_method {
my $self = shift;
my $rm = $self->get_current_runmode; # 'other_action'
}
Note that forward accepts the _name_ of the run mode (in this case
_'other_action'_), which might not be the same as the name of the method
that handles the run mode (in this case _'other_method'_)
You can still call '$self->other_method' directly, but 'current_run_mode'
will not be updated:
sub setup {
my $self = shift;
$self->run_modes({
start => 'start',
other_action => 'other_method',
});
}
sub start {
my $self = shift;
return $self->other_method;
}
sub other_method {
my $self = shift;
my $rm = $self->get_current_runmode; # 'start'
}
Forward will work with coderef-based runmodes as well:
sub setup {
my $self = shift;
$self->run_modes({
start => 'start',
anon_action => sub {
my $self = shift;
my $rm = $self->get_current_runmode; # 'anon_action'
},
});
}
sub start {
my $self = shift;
return $self->forward('anon_action');
}
%prep
%setup -q -n %{cpan_name}-%{version}