Skip to content

Commit

Permalink
Code name "Rainbow", this will be a major release
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 10, 2012
1 parent f3d4fd0 commit 80930fe
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 98 deletions.
4 changes: 3 additions & 1 deletion Changes
@@ -1,5 +1,7 @@

2.99 2012-06-10
3.0 2012-06-10
- Code name "Rainbow", this is a major release.
- Renamed Mojo::CookieJar to Mojo::UserAgent::CookieJar.
- Improved message parser performance slightly.
- Improved documentation. (ichesnokov, sri)
- Improved tests.
Expand Down
6 changes: 0 additions & 6 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -82,12 +82,6 @@ sub delay {
return $delay;
}

# DEPRECATED in Leaf Fluttering In Wind!
sub drop {
warn "Mojo::IOLoop->drop is DEPRECATED in favor of Mojo::IOLoop->remove!\n";
shift->remove(@_);
}

sub generate_port { Mojo::IOLoop::Server->generate_port }

sub is_running {
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -3,11 +3,11 @@ use Mojo::Base 'Mojo::EventEmitter';

use Carp 'croak';
use List::Util 'first';
use Mojo::CookieJar;
use Mojo::IOLoop;
use Mojo::Server::Daemon;
use Mojo::Transaction::WebSocket;
use Mojo::URL;
use Mojo::UserAgent::CookieJar;
use Mojo::UserAgent::Transactor;
use Scalar::Util 'weaken';

Expand All @@ -17,7 +17,7 @@ use constant DEBUG => $ENV{MOJO_USERAGENT_DEBUG} || 0;
has ca => sub { $ENV{MOJO_CA_FILE} };
has cert => sub { $ENV{MOJO_CERT_FILE} };
has connect_timeout => sub { $ENV{MOJO_CONNECT_TIMEOUT} || 10 };
has cookie_jar => sub { Mojo::CookieJar->new };
has cookie_jar => sub { Mojo::UserAgent::CookieJar->new };
has [qw(http_proxy https_proxy local_address no_proxy)];
has inactivity_timeout => sub { $ENV{MOJO_INACTIVITY_TIMEOUT} // 20 };
has ioloop => sub { Mojo::IOLoop->new };
Expand Down Expand Up @@ -682,10 +682,10 @@ environment variable or C<10>.
=head2 C<cookie_jar>
my $cookie_jar = $ua->cookie_jar;
$ua = $ua->cookie_jar(Mojo::CookieJar->new);
$ua = $ua->cookie_jar(Mojo::UserAgent::CookieJar->new);
Cookie jar to use for this user agents requests, defaults to a
L<Mojo::CookieJar> object.
L<Mojo::UserAgent::CookieJar> object.
# Disable cookie jar
$ua->cookie_jar(0);
Expand Down
18 changes: 9 additions & 9 deletions lib/Mojo/CookieJar.pm → lib/Mojo/UserAgent/CookieJar.pm
@@ -1,4 +1,4 @@
package Mojo::CookieJar;
package Mojo::UserAgent::CookieJar;
use Mojo::Base -base;

use Mojo::Cookie::Request;
Expand Down Expand Up @@ -97,22 +97,22 @@ sub inject {

=head1 NAME
Mojo::CookieJar - Cookie jar for HTTP 1.1 user agents
Mojo::UserAgent::CookieJar - Cookie jar for HTTP 1.1 user agents
=head1 SYNOPSIS
use Mojo::CookieJar;
use Mojo::UserAgent::CookieJar;
my $jar = Mojo::CookieJar->new;
my $jar = Mojo::UserAgent::CookieJar->new;
=head1 DESCRIPTION
L<Mojo::CookieJar> is a minimalistic and relaxed cookie jar for HTTP 1.1 user
agents.
L<Mojo::UserAgent::CookieJar> is a minimalistic and relaxed cookie jar for
HTTP 1.1 user agents.
=head1 ATTRIBUTES
L<Mojo::CookieJar> implements the following attributes.
L<Mojo::UserAgent::CookieJar> implements the following attributes.
=head2 C<max_cookie_size>
Expand All @@ -123,8 +123,8 @@ Maximum cookie size in bytes, defaults to C<4096>.
=head1 METHODS
L<Mojo::CookieJar> inherits all methods from L<Mojo::Base> and implements the
following new ones.
L<Mojo::UserAgent::CookieJar> inherits all methods from L<Mojo::Base> and
implements the following new ones.
=head2 C<add>
Expand Down
6 changes: 4 additions & 2 deletions lib/Mojolicious.pm
Expand Up @@ -33,8 +33,8 @@ has sessions => sub { Mojolicious::Sessions->new };
has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Leaf Fluttering In Wind';
our $VERSION = '2.99';
our $CODENAME = 'Rainbow';
our $VERSION = '3.0';

# "These old doomsday devices are dangerously unstable.
# I'll rest easier not knowing where they are."
Expand Down Expand Up @@ -684,6 +684,8 @@ L<http://www.apache.org/licenses/LICENSE-2.0>.
Every major release of L<Mojolicious> has a code name, these are the ones that
have been used in the past.
3.0, C<Rainbow> (u1F308)
2.0, C<Leaf Fluttering In Wind> (u1F343)
1.4, C<Smiling Face With Sunglasses> (u1F60E)
Expand Down
12 changes: 0 additions & 12 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -58,18 +58,6 @@ sub add_helper {
return $self;
}

# DEPRECATED in Leaf Fluttering In Wind!
sub default_template_class {
warn <<EOF;
Mojolicious::Renderer->default_template_class is DEPRECATED in favor of
Mojolicious::Renderer->classes!
EOF
my $self = shift;
return $self->classes->[0] unless @_;
$self->classes->[0] = shift;
return $self;
}

sub get_data_template {
my ($self, $options, $template) = @_;

Expand Down
12 changes: 0 additions & 12 deletions lib/Mojolicious/Routes.pm
Expand Up @@ -34,18 +34,6 @@ sub auto_render {
$c->render or ($stash->{'mojo.routed'} or $c->render_not_found);
}

# DEPRECATED in Leaf Fluttering In Wind!
sub controller_base_class {
warn <<EOF;
Mojolicious::Routes->controller_base_class is DEPRECATED in favor of
Mojolicious::Routes->base_classes!
EOF
my $self = shift;
return $self->base_classes->[0] unless @_;
$self->base_classes->[0] = shift;
return $self;
}

sub dispatch {
my ($self, $c) = @_;

Expand Down
3 changes: 0 additions & 3 deletions lib/Mojolicious/Routes/Match.pm
Expand Up @@ -71,9 +71,6 @@ sub match {
delete $captures->{app};
}

# DEPRECATED in Leaf Fluttering In Wind!
return $self->endpoint($r) if $r->block && $empty;

# Endpoint
return $self->endpoint($r) if $endpoint && $empty;

Expand Down
6 changes: 0 additions & 6 deletions lib/Mojolicious/Routes/Pattern.pm
Expand Up @@ -203,12 +203,6 @@ sub _tokenize {
# Inside a placeholder
my $placeholder = $state ~~ [qw(relaxed symbol wildcard)];

# DEPRECATED in Leaf Fluttering In Wind!
if ($quoted && $char eq '.' && $state eq 'symbol') {
warn "Relaxed placeholders /(.foo) are DEPRECATED in favor of /#foo!\n";
$char = $relaxed;
}

# Quote start
if ($char eq $quote_start) {
$quoted = 1;
Expand Down
11 changes: 1 addition & 10 deletions lib/Mojolicious/Routes/Route.pm
Expand Up @@ -5,7 +5,7 @@ use Carp 'croak';
use Mojolicious::Routes::Pattern;
use Scalar::Util qw(blessed weaken);

has [qw(block inline parent partial)];
has [qw(inline parent partial)];
has 'children' => sub { [] };
has pattern => sub { Mojolicious::Routes::Pattern->new };

Expand Down Expand Up @@ -87,9 +87,6 @@ sub is_endpoint {
# Bridge
return if $self->inline;

# DEPRECATED in Leaf Fluttering In Wind!
return 1 if $self->block;

# Check number of children
return !@{$self->children};
}
Expand Down Expand Up @@ -236,12 +233,6 @@ sub via {
return $self;
}

# DEPRECATED in Leaf Fluttering In Wind!
sub waypoint {
warn "Mojolicious::Routes::Route->waypoint is DEPRECATED!\n";
shift->route(@_)->block(1);
}

sub websocket {
my $self = shift;
my $route = $self->get(@_);
Expand Down
12 changes: 0 additions & 12 deletions lib/Mojolicious/Static.pm
Expand Up @@ -12,18 +12,6 @@ use Mojo::Path;
has classes => sub { ['main'] };
has paths => sub { [] };

# DEPRECATED in Leaf Fluttering In Wind!
sub default_static_class {
warn <<EOF;
Mojolicious::Static->default_static_class is DEPRECATED in favor of
Mojolicious::Static->classes!
EOF
my $self = shift;
return $self->classes->[0] unless @_;
$self->classes->[0] = shift;
return $self;
}

# "Valentine's Day's coming? Aw crap! I forgot to get a girlfriend again!"
sub dispatch {
my ($self, $c) = @_;
Expand Down
24 changes: 12 additions & 12 deletions t/mojo/cookiejar.t
Expand Up @@ -6,11 +6,11 @@ use Test::More tests => 85;
# Okay Mr. Burns, what's your first name.
# I don't know."
use Mojo::Cookie::Response;
use Mojo::CookieJar;
use Mojo::UserAgent::CookieJar;
use Mojo::URL;

# Session cookie
my $jar = Mojo::CookieJar->new;
my $jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => 'kraih.com',
Expand Down Expand Up @@ -57,7 +57,7 @@ is $cookies[1]->value, 'works', 'right value';
is $cookies[2], undef, 'no third cookie';

# Leading dot
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => '.kraih.com',
Expand All @@ -76,7 +76,7 @@ is $cookies[0]->value, 'bar', 'right value';
is $cookies[1], undef, 'no second cookie';

# "localhost"
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => 'localhost',
Expand Down Expand Up @@ -113,7 +113,7 @@ is $cookies[1]->value, 'bar', 'right value';
is $cookies[2], undef, 'no third cookie';

# Random top-level domain
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => 'com',
Expand All @@ -138,7 +138,7 @@ is $cookies[0]->value, 'baz', 'right value';
is $cookies[1], undef, 'no second cookie';

# Huge cookie
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => 'kraih.com',
Expand All @@ -165,7 +165,7 @@ is $cookies[0]->value, 'bar', 'right value';
is $cookies[1], undef, 'no second cookie';

# Expired cookies
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => 'kraih.com',
Expand Down Expand Up @@ -194,7 +194,7 @@ is $cookies[0]->value, 'bar', 'right value';
is $cookies[1], undef, 'no second cookie';

# Multiple cookies
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => 'kraih.com',
Expand All @@ -218,7 +218,7 @@ is $cookies[1]->value, 'bar', 'right value';
is $cookies[2], undef, 'no third cookie';

# Multiple cookies with leading dot
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => '.kraih.com',
Expand Down Expand Up @@ -249,7 +249,7 @@ is $cookies[2]->value, 'that', 'right value';
is $cookies[3], undef, 'no fourth cookie';

# Replace cookie
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => 'kraih.com',
Expand All @@ -270,7 +270,7 @@ is $cookies[0]->value, 'bar2', 'right value';
is $cookies[1], undef, 'no second cookie';

# Switch between secure and normal cookies
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => 'kraih.com',
Expand Down Expand Up @@ -302,7 +302,7 @@ is $cookies[0]->value, 'bar', 'right value';
is $cookies[1], undef, 'no second cookie';

# "(" in path
$jar = Mojo::CookieJar->new;
$jar = Mojo::UserAgent::CookieJar->new;
$jar->add(
Mojo::Cookie::Response->new(
domain => '.kraih.com',
Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/group_lite_app.t
Expand Up @@ -12,7 +12,7 @@ use Test::More tests => 201;

# "Let's see how crazy I am now, Nixon. The correct answer is very."
use Mojo::ByteStream 'b';
use Mojo::CookieJar;
use Mojo::UserAgent::CookieJar;
use Mojolicious::Lite;
use Test::Mojo;

Expand Down Expand Up @@ -265,7 +265,7 @@ $t->get_ok('/bridge2stash' => {'X-Flash' => 1})->status_is(200)
# GET /bridge2stash (again without cookie jar)
$t->get_ok('/bridge2stash' => {'X-Flash' => 1})->status_is(200)
->content_is("stash too!!!!!!!\n");
$t->ua->cookie_jar(Mojo::CookieJar->new);
$t->ua->cookie_jar(Mojo::UserAgent::CookieJar->new);

# GET /bridge2stash (fresh start)
$t->reset_session;
Expand Down
8 changes: 1 addition & 7 deletions t/pod_coverage.t
Expand Up @@ -6,12 +6,6 @@ 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 Leaf Fluttering In Wind!
my @leaf = (
qw(block controller_base_class default_static_class default_template_class),
qw(drop waypoint)
);

# "Marge, I'm going to miss you so much. And it's not just the sex.
# It's also the food preparation."
all_pod_coverage_ok({also_private => [@leaf]});
all_pod_coverage_ok();

0 comments on commit 80930fe

Please sign in to comment.