diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-10-16 17:02:52 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-10-16 17:02:52 +0100 |
commit | df06903e0c0f3e7f66af787b0acb6fd0a3d3e523 (patch) | |
tree | bf841e459d1b68d85aecfebc0aa1bb06752ef041 /perllib/FixMyStreet/Script/UpdateAllReports.pm | |
parent | 6e7a34d79217f71076f65b3017eba313b78854cb (diff) |
Allow testing override of /reports data.
Diffstat (limited to 'perllib/FixMyStreet/Script/UpdateAllReports.pm')
-rwxr-xr-x | perllib/FixMyStreet/Script/UpdateAllReports.pm | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/Script/UpdateAllReports.pm b/perllib/FixMyStreet/Script/UpdateAllReports.pm index 1bd069ee8..f459b7b12 100755 --- a/perllib/FixMyStreet/Script/UpdateAllReports.pm +++ b/perllib/FixMyStreet/Script/UpdateAllReports.pm @@ -6,9 +6,6 @@ use warnings; use FixMyStreet; use FixMyStreet::DB; -use File::Path (); -use File::Slurp; -use JSON::MaybeXS; use List::MoreUtils qw(zip); use List::Util qw(sum); @@ -81,13 +78,10 @@ sub generate { } } - my $body = encode_json( { + return { fixed => \%fixed, open => \%open, - } ); - - File::Path::mkpath( FixMyStreet->path_to( '../data/' )->stringify ); - File::Slurp::write_file( FixMyStreet->path_to( '../data/all-reports.json' )->stringify, \$body ); + }; } sub end_period { @@ -247,9 +241,7 @@ sub generate_dashboard { } $data{other_categories} = $last_seven_days; - my $body = encode_json( \%data ); - File::Path::mkpath( FixMyStreet->path_to( '../data/' )->stringify ); - File::Slurp::write_file( FixMyStreet->path_to( '../data/all-reports-dashboard.json' )->stringify, \$body ); + return \%data; } sub stuff_by_day_or_year { |