Skip to content

Commit

Permalink
Merge branch 'review/jahmed' into devel
Browse files Browse the repository at this point in the history
* review/jahmed:
  perltidy
  Session::YAML bug fix
  • Loading branch information
fcuny committed Feb 5, 2011
2 parents 5c508cb + 76d3943 commit 692aa24
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Dancer/Session/YAML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use Dancer::ModuleLoader;
use Dancer::Config 'setting';
use Dancer::FileUtils qw(path open_file);
use File::Copy;
use File::Temp qw(tempfile);

# static

Expand Down Expand Up @@ -72,10 +73,11 @@ sub destroy {

sub flush {
my $self = shift;
my $sessionfh = open_file('>', tmp_yaml_file($self->id));
print {$sessionfh} YAML::Dump($self);
close $sessionfh;
move(tmp_yaml_file($self->id), yaml_file($self->id));
my ( $fh, $tmpname ) =
tempfile( $self->id . '.XXXXXXXX', DIR => setting('session_dir') );
print {$fh} YAML::Dump($self);
close $fh;
move($tmpname, yaml_file($self->id));
return $self;
}

Expand Down

0 comments on commit 692aa24

Please sign in to comment.