Rename "new" to "build"
Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
This commit is contained in:
1 parent
68783f08e2
commit
62146bb307
3 files changed
+7
-5
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
Revision history for MojoX-Renderer-TT
|
Revision history for MojoX-Renderer-TT
|
||||||
|
|
||||||
0.03
|
0.03
|
||||||
|
- Rename "new" to "build"
|
||||||
- Add real tests (Viacheslav Tikhanovskii)
|
- Add real tests (Viacheslav Tikhanovskii)
|
||||||
- Update to work with new error handling in Mojo
|
- Update to work with new error handling in Mojo
|
||||||
(Viacheslav Tikhanovskii)
|
(Viacheslav Tikhanovskii)
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ use Carp ();
|
|||||||
|
|
||||||
__PACKAGE__->attr('tt', chained => 1,);
|
__PACKAGE__->attr('tt', chained => 1,);
|
||||||
|
|
||||||
sub new {
|
sub new { Carp::croak "MojoX::Renderer::TT->new() is now ->build()" }
|
||||||
|
|
||||||
|
sub build {
|
||||||
my $self = shift->SUPER::new(@_);
|
my $self = shift->SUPER::new(@_);
|
||||||
$self->_init(@_);
|
$self->_init(@_);
|
||||||
return sub { $self->_render(@_) }
|
return sub { $self->_render(@_) }
|
||||||
@@ -103,9 +105,9 @@ MojoX::Renderer::TT renderer.
|
|||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
=head2 new
|
=head2 build
|
||||||
|
|
||||||
This method returns not a TT object, but a handler for the Mojo renderer.
|
This method returns a handler for the Mojo renderer.
|
||||||
|
|
||||||
Supported parameters are
|
Supported parameters are
|
||||||
|
|
||||||
@@ -128,7 +130,6 @@ Ask Bjørn Hansen, C<< <ask at develooper.com> >>
|
|||||||
|
|
||||||
=head1 TODO
|
=head1 TODO
|
||||||
|
|
||||||
* Rename C<new> to something more sensical?
|
|
||||||
* Better support non-Mojolicious frameworks
|
* Better support non-Mojolicious frameworks
|
||||||
* Don't require the mojo parameter
|
* Don't require the mojo parameter
|
||||||
* Move the default template cache directory?
|
* Move the default template cache directory?
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ use Mojo::Transaction;
|
|||||||
|
|
||||||
use_ok('MojoX::Renderer::TT');
|
use_ok('MojoX::Renderer::TT');
|
||||||
|
|
||||||
my $mt = MojoX::Renderer::TT->new;
|
my $mt = MojoX::Renderer::TT->build;
|
||||||
|
|
||||||
my $output;
|
my $output;
|
||||||
my $rv;
|
my $rv;
|
||||||
|
|||||||
Reference in new issue
Block a user