Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
slurp more consistently
  • Loading branch information
kraih committed Jan 19, 2013
1 parent f9d40de commit eb3014f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -2,18 +2,12 @@ package Mojolicious::Plugin::Config;
use Mojo::Base 'Mojolicious::Plugin';

use File::Spec::Functions 'file_name_is_absolute';
use Mojo::Util qw(decode slurp);

sub load {
my ($self, $file, $conf, $app) = @_;
$app->log->debug(qq{Reading config file "$file".});

# Slurp UTF-8 file
open my $handle, "<:encoding(UTF-8)", $file
or die qq{Couldn't open config file "$file": $!};
my $content = do { local $/; <$handle> };

# Process
return $self->parse($content, $file, $conf, $app);
return $self->parse(decode('UTF-8', slurp $file), $file, $conf, $app);
}

sub parse {
Expand Down

0 comments on commit eb3014f

Please sign in to comment.