Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
improved DATA templates by removing a whitespace requirement
  • Loading branch information
kraih committed Sep 14, 2011
1 parent 5ed131f commit fe74c1a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -11,6 +11,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Improved test command to run tests in alphabetical order.
(viliampucik)
- Improved non-blocking resolver by allowing it to be disabled.
- Improved DATA templates by removing a whitespace requirement.
- Improved tests.
- Fixed small name generation bug in Mojolicious::Plugin::Config.
- Fixed small bug in cookie jar.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Command.pm
Expand Up @@ -116,7 +116,7 @@ sub get_all_data {
$content =~ s/\n__END__\r?\n.*$/\n/s;

# Split
my @data = split /^@@\s+(.+?)\s*\r?\n/m, $content;
my @data = split /^@@\s*(.+?)\s*\r?\n/m, $content;
shift @data;
# Find data
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/command.t
Expand Up @@ -16,7 +16,7 @@ my $command = Mojo::Command->new;
isa_ok $command->app, 'Mojo', 'right application';

# UNIX DATA templates
my $unix = "@@ template1\nFirst Template\n@@ template2\r\nSecond Template\n";
my $unix = "@@ template1\nFirst Template\n@\@template2\r\nSecond Template\n";
open my $data, '<', \$unix;
no strict 'refs';
*{"Example::Package::UNIX::DATA"} = $data;
Expand All @@ -30,7 +30,7 @@ close $data;

# Windows DATA templates
my $windows =
"@@ template3\r\nThird Template\r\n@@ template4\r\nFourth Template\r\n";
"@@ template3\r\nThird Template\r\n@\@template4\r\nFourth Template\r\n";
open $data, '<', \$windows;
no strict 'refs';
*{"Example::Package::Windows::DATA"} = $data;
Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/lite_app.t
Expand Up @@ -1957,7 +1957,7 @@ Not Bender!
@@ localized_partial.html.ep
<%= $test %>
@@ layouts/localized1.html.ep
@@layouts/localized1.html.ep
localized1 <%= content %>
@@ layouts/localized2.html.ep
Expand Down

0 comments on commit fe74c1a

Please sign in to comment.