Skip to content

Commit

Permalink
remove deprecated build_body and build_headers methods from Mojo::Con…
Browse files Browse the repository at this point in the history
…tent
  • Loading branch information
kraih committed Aug 12, 2015
1 parent fe2d4f5 commit c0c7a93
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@

6.15 2015-08-12
- Removed deprecated build_body and build_headers methods from Mojo::Content.
- Improved Mojo::Message and Mojo::Transaction::HTTP to generate slightly
smaller HTTP messages.
- Fixed warnings in Mojo::DOM.
Expand Down
22 changes: 0 additions & 22 deletions lib/Mojo/Content.pm
Expand Up @@ -4,7 +4,6 @@ use Mojo::Base 'Mojo::EventEmitter';
use Carp 'croak';
use Compress::Raw::Zlib qw(WANT_GZIP Z_STREAM_END);
use Mojo::Headers;
use Mojo::Util 'deprecated';
use Scalar::Util 'looks_like_number';

has [qw(auto_decompress auto_relax expect_close relaxed skip_body)];
Expand All @@ -25,10 +24,6 @@ sub boundary {
(shift->headers->content_type // '') =~ $BOUNDARY_RE ? $1 // $2 : undef;
}

# DEPRECATED in Clinking Beer Mugs!
sub build_body { shift->_build('get_body_chunk') }
sub build_headers { shift->_build('get_header_chunk') }

sub charset {
my $type = shift->headers->content_type // '';
return $type =~ /charset\s*=\s*"?([^"\s;]+)"?/i ? $1 : undef;
Expand Down Expand Up @@ -169,23 +164,6 @@ sub write_chunk {
return $self;
}

# DEPRECATED in Clinking Beer Mugs!
sub _build {
deprecated 'Mojo::Content::build_body and Mojo::Content::build_headers'
. ' are DEPRECATED';
my ($self, $method) = @_;

my ($buffer, $offset) = ('', 0);
while (1) {
next unless defined(my $chunk = $self->$method($offset));
last unless my $len = length $chunk;
$offset += $len;
$buffer .= $chunk;
}

return $buffer;
}

sub _build_chunk {
my ($self, $chunk) = @_;

Expand Down
5 changes: 1 addition & 4 deletions t/pod_coverage.t
Expand Up @@ -7,7 +7,4 @@ plan skip_all => 'set TEST_POD to enable this test (developer only!)'
plan skip_all => 'Test::Pod::Coverage 1.04+ required for this test!'
unless eval 'use Test::Pod::Coverage 1.04; 1';

# DEPRECATED in Clinking Beer Mugs!
my @mugs = qw(build_body build_headers);

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

0 comments on commit c0c7a93

Please sign in to comment.