Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
removed deprecated Mojo::DOM features
  • Loading branch information
kraih committed Jan 11, 2015
1 parent 2b3b0f1 commit 759215c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 71 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,7 +1,10 @@

5.73 2015-01-12
- Removed deprecated object-oriented Mojo::JSON API.
- Removed deprecated stringification support from Mojo::Collection.
- Removed deprecated support for data arguments from Mojo::JSON::Pointer.
- Removed deprecated AUTOLOAD and pluck methods from Mojo::Collection.
- Removed deprecated AUTOLOAD and val methods from Mojo::DOM.

5.72 2015-01-11
- Added EXPERIMENTAL support for case-insensitive attribute selectors like
Expand Down
31 changes: 0 additions & 31 deletions lib/Mojo/Collection.pm
Expand Up @@ -5,33 +5,10 @@ use Carp 'croak';
use Exporter 'import';
use List::Util;
use Mojo::ByteStream;
use Mojo::Util 'deprecated';
use Scalar::Util 'blessed';

# DEPRECATED in Tiger Face!
use overload '""' => sub {
deprecated 'Stringification support in Mojo::Collection is DEPRECATED'
. ' in favor of Mojo::Collection::join';
shift->join("\n");
};
use overload bool => sub {1}, fallback => 1;

our @EXPORT_OK = ('c');

# DEPRECATED in Tiger Face!
sub AUTOLOAD {
my $self = shift;
my ($package, $method) = our $AUTOLOAD =~ /^(.+)::(.+)$/;
deprecated "Mojo::Collection::AUTOLOAD ($method) is DEPRECATED"
. ' in favor of Mojo::Collection::map';
croak "Undefined subroutine &${package}::$method called"
unless blessed $self && $self->isa(__PACKAGE__);
return $self->map($method, @_);
}

# DEPRECATED in Tiger Face!
sub DESTROY { }

sub c { __PACKAGE__->new(@_) }

sub compact {
Expand Down Expand Up @@ -77,14 +54,6 @@ sub new {
return bless [@_], ref $class || $class;
}

# DEPRECATED in Tiger Face!
sub pluck {
deprecated
'Mojo::Collection::pluck is DEPRECATED in favor of Mojo::Collection::map';
my ($self, $key) = (shift, shift);
return $self->new(map { ref eq 'HASH' ? $_->{$key} : $_->$key(@_) } @$self);
}

sub reduce {
my $self = shift;
@_ = (@_, @$self);
Expand Down
39 changes: 0 additions & 39 deletions lib/Mojo/DOM.pm
Expand Up @@ -16,24 +16,6 @@ use Mojo::DOM::HTML;
use Mojo::Util qw(deprecated squish);
use Scalar::Util qw(blessed weaken);

# DEPRECATED in Tiger Face!
sub AUTOLOAD {
my $self = shift;

my ($package, $method) = our $AUTOLOAD =~ /^(.+)::(.+)$/;
deprecated "Mojo::DOM::AUTOLOAD ($method) is DEPRECATED"
. ' in favor of Mojo::DOM::children';
croak "Undefined subroutine &${package}::$method called"
unless blessed $self && $self->isa(__PACKAGE__);

my $children = $self->children($method);
return @$children > 1 ? $children : $children->[0] if @$children;
croak qq{Can't locate object method "$method" via package "$package"};
}

# DEPRECATED in Tiger Face!
sub DESTROY { }

sub all_contents { $_[0]->_collect(_all(_nodes($_[0]->tree))) }

sub all_text { shift->_all_text(1, @_) }
Expand Down Expand Up @@ -184,27 +166,6 @@ sub type {
return $self;
}

# DEPRECATED in Tiger Face!
sub val {
deprecated 'Mojo::DOM::val is DEPRECATED';
my $self = shift;

# "option"
my $type = $self->type;
return Mojo::Collection->new($self->{value} // $self->text)
if $type eq 'option';

# "select"
return $self->find('option[selected]')->map('val')->flatten
if $type eq 'select';

# "textarea"
return Mojo::Collection->new($self->text) if $type eq 'textarea';

# "input" or "button"
return Mojo::Collection->new($self->{value} // ());
}

sub wrap { shift->_wrap(0, @_) }
sub wrap_content { shift->_wrap(1, @_) }

Expand Down
2 changes: 1 addition & 1 deletion t/pod_coverage.t
Expand Up @@ -8,6 +8,6 @@ plan skip_all => 'Test::Pod::Coverage 1.04 required for this test!'
unless eval 'use Test::Pod::Coverage 1.04; 1';

# DEPRECATED in Tiger Face!
my @tiger = qw(pluck siblings val);
my @tiger = qw(siblings);

all_pod_coverage_ok({also_private => [@tiger]});

0 comments on commit 759215c

Please sign in to comment.