Skip to content

Commit

Permalink
fixed GLOB loading
Browse files Browse the repository at this point in the history
  • Loading branch information
barbie committed Jan 27, 2013
1 parent bf284e2 commit f184b99
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -7,6 +7,8 @@ Revision history for the CPAN-Testers-WWW-Reports-Parser distribution
- added LICENSE file.
- added META.json.
- reworked test suite.
- added reload method.
- fixed repeated GLOB loading.

0.03 2010-04-12
- added support for guid field.
Expand Down
4 changes: 1 addition & 3 deletions lib/CPAN/Testers/WWW/Reports/Parser/JSON.pm
Expand Up @@ -11,9 +11,6 @@ $VERSION = '0.03';

use JSON::XS;

#----------------------------------------------------------------------------
# Variables

#----------------------------------------------------------------------------
# The Application Programming Interface

Expand Down Expand Up @@ -49,6 +46,7 @@ sub _load_file {

if (ref $file eq 'GLOB') {
$fh = $file;
seek($fh,0,0);
} else {
open $fh, '<', $file or die "Cannot open file [$file]: $!\n";
}
Expand Down
7 changes: 5 additions & 2 deletions lib/CPAN/Testers/WWW/Reports/Parser/YAML.pm
Expand Up @@ -39,8 +39,11 @@ sub register {

sub raw_data {
my $self = shift;
return Load($self->{data}) if($self->{data});
return LoadFile($self->{file});
if($self->{file}) {
seek($self->{file},0,0) if(ref $self->{file} eq 'GLOB');
return LoadFile($self->{file});
}
return Load($self->{data});
}

q{ Kein Zurück für dich };
Expand Down

0 comments on commit f184b99

Please sign in to comment.