Permalink
Browse files

removed perl method again

  • Loading branch information...
1 parent d26a9d8 commit b01071c95ddb2455389f53438c8d7d193e235ff1 @kraih committed Aug 17, 2012
Showing with 19 additions and 35 deletions.
  1. +2 −2 Changes
  2. +3 −12 lib/Mojo/Base.pm
  3. +2 −4 lib/Mojo/ByteStream.pm
  4. +2 −4 lib/Mojo/Collection.pm
  5. +2 −4 lib/Mojo/DOM.pm
  6. +5 −1 lib/Mojolicious/Plugin/DefaultHelpers.pm
  7. +2 −2 lib/Mojolicious/Routes.pm
  8. +1 −6 t/mojo/base.t
View
@@ -1,8 +1,8 @@
-3.32 2012-08-17
+3.32 2012-08-18
- Added event sequentialization support to Mojo::IOLoop::Delay.
(judofyr, marcus, sri)
- - Added perl and tap methods to Mojo::Base.
+ - Added tap method to Mojo::Base.
- Added squish method to Mojo::ByteStream.
- Added squish function to Mojo::Util.
- Improved documentation.
View
@@ -7,8 +7,7 @@ use warnings;
use feature ();
# No imports because we get subclassed, a lot!
-use Carp ();
-use Data::Dumper ();
+use Carp ();
# Only Perl 5.14+ requires it on demand
use IO::Handle ();
@@ -101,8 +100,6 @@ sub attr {
}
}
-sub perl { Data::Dumper->new([@_])->Indent(1)->Terse(1)->Dump }
-
sub tap {
my ($self, $cb) = @_;
$_->$cb for $self;
@@ -134,10 +131,10 @@ Mojo::Base - Minimal base class for Mojo projects
my $mew = Cat->new(name => 'Longcat');
say $mew->paws;
- say $mew->paws(5)->ears(4)->perl;
+ say $mew->paws(5)->ears(4)->paws;
my $rawr = Tiger->new(stripes => 23);
- say $rawr->tap(sub { $_->friend->name('Tacgnol') })->perl;
+ say $rawr->tap(sub { $_->friend->name('Tacgnol') })->paws;
=head1 DESCRIPTION
@@ -219,12 +216,6 @@ attribute. Pass an optional second argument to set a default value, it should
be a constant or a sub reference. The sub reference will be excuted at
accessor read time if there's no set value.
-=head2 C<perl>
-
- my $string = $object->perl;
-
-Dump object with L<Data::Dumper>.
-
=head2 C<tap>
$object = $object->tap(sub {...});
View
@@ -1,8 +1,7 @@
package Mojo::ByteStream;
-use Mojo::Base -base;
+use Mojo::Base 'Exporter';
use overload '""' => sub { shift->to_string }, fallback => 1;
-use Exporter 'import';
use Mojo::Collection;
use Mojo::Util;
@@ -118,8 +117,7 @@ Construct a new L<Mojo::ByteStream> object.
=head1 METHODS
-L<Mojo::ByteStream> inherits all methods from L<Mojo::Base> and implements the
-following new ones.
+L<Mojo::ByteStream> implements the following methods.
=head2 C<new>
View
@@ -1,11 +1,10 @@
package Mojo::Collection;
-use Mojo::Base -base;
+use Mojo::Base 'Exporter';
use overload
'bool' => sub {1},
'""' => sub { shift->join("\n") },
fallback => 1;
-use Exporter 'import';
use List::Util;
use Mojo::ByteStream;
@@ -121,8 +120,7 @@ Construct a new L<Mojo::Collection> object.
=head1 METHODS
-L<Mojo::Collection> inherits all methods from L<Mojo::Base> and implements the
-following new ones.
+L<Mojo::Collection> implements the following methods.
=head2 C<new>
View
@@ -1,13 +1,12 @@
package Mojo::DOM;
-use Mojo::Base -base;
+use Mojo::Base -strict;
use overload
'%{}' => sub { shift->attrs },
'bool' => sub {1},
'""' => sub { shift->to_xml },
fallback => 1;
use Carp 'croak';
-use Exporter 'import';
use Mojo::Collection;
use Mojo::DOM::CSS;
use Mojo::DOM::HTML;
@@ -460,8 +459,7 @@ XML detection can also be disabled with the C<xml> method.
=head1 METHODS
-L<Mojo::DOM> inherits all methods from L<Mojo::Base> and implements the
-following new ones.
+L<Mojo::DOM> implements the following methods.
=head2 C<new>
@@ -1,6 +1,8 @@
package Mojolicious::Plugin::DefaultHelpers;
use Mojo::Base 'Mojolicious::Plugin';
+use Data::Dumper ();
+
# "You're watching Futurama,
# the show that doesn't condone the cool crime of robbery."
sub register {
@@ -37,7 +39,7 @@ sub register {
$app->helper(current_route => \&_current_route);
# Add "dumper" helper
- $app->helper(dumper => sub { shift; Mojo::Base::perl(@_) });
+ $app->helper(dumper => \&_dumper);
# Add "include" helper
$app->helper(include => \&_include);
@@ -83,6 +85,8 @@ sub _current_route {
return $endpoint->name eq shift;
}
+sub _dumper { shift; Data::Dumper->new([@_])->Indent(1)->Terse(1)->Dump }
+
sub _include {
my $self = shift;
my $template = @_ % 2 ? shift : undef;
@@ -11,7 +11,7 @@ use Scalar::Util 'weaken';
has base_classes => sub { [qw(Mojolicious::Controller Mojo)] };
has cache => sub { Mojo::Cache->new };
has [qw(conditions shortcuts)] => sub { {} };
-has hidden => sub { [qw(attr has new perl tap)] };
+has hidden => sub { [qw(attr has new tap)] };
has 'namespace';
sub add_condition {
@@ -300,7 +300,7 @@ Contains all available conditions.
$r = $r->hidden([qw(attr has new)]);
Controller methods and attributes that are hidden from routes, defaults to
-C<attr>, C<has>, C<new>, C<perl> and C<tap>.
+C<attr>, C<has>, C<new> and C<tap>.
=head2 C<namespace>
View
@@ -1,6 +1,6 @@
use Mojo::Base -strict;
-use Test::More tests => 416;
+use Test::More tests => 415;
use FindBin;
use lib "$FindBin::Bin/lib";
@@ -87,11 +87,6 @@ is $monkey->tap(sub { $_->name('foo') })->name, 'foo', 'right attribute value';
is $monkey->tap(sub { shift->name('bar')->name })->name, 'bar',
'right attribute value';
-# Dump object
-$monkey = BaseTest->new(name => 'foo');
-is $monkey->perl, "bless( {\n 'name' => 'foo'\n}, 'BaseTest' )\n",
- 'right result';
-
# Inherit -base flag
$monkey = BaseTest::Base3->new(evil => 1);
is $monkey->evil, 1, 'monkey is evil';

0 comments on commit b01071c

Please sign in to comment.