From 435913283b2941a6e1c20d6b2ac20c7f6895bddd Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 23 Dec 2016 14:02:50 +0100 Subject: [PATCH] use Text::Unaccent::PurePerl because other one segfaults --- Makefile.PL | 2 +- lib/MojoFacets.pm | 8 ++++---- lib/MojoFacets/Data.pm | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index ba55798..207ca0c 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,7 +11,7 @@ requires 'File::Slurp'; requires 'JSON'; requires 'HTML::TableExtract'; requires 'File::Path'; -requires 'Text::Unaccent'; +requires 'Text::Unaccent::PurePerl'; requires 'Statistics::Descriptive'; requires 'Text::CSV'; diff --git a/lib/MojoFacets.pm b/lib/MojoFacets.pm index c2ef3d4..cf52bec 100644 --- a/lib/MojoFacets.pm +++ b/lib/MojoFacets.pm @@ -30,10 +30,10 @@ sub save_action { $path =~ s{/}{.}g; $actions_path .= sprintf '%.4f%s', $time, $path; - my $array = $params->params; - if ( @$array ) { - store $array, $actions_path; - warn "SAVE $actions_path ", -s $actions_path, " bytes params = ", dump($array), $/; + my $hash = $params->to_hash; + if ( $hash ) { + store $hash, $actions_path; + warn "SAVE $actions_path ", -s $actions_path, " bytes params = ", dump($hash), $/; } } } diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index 513adbe..0f47450 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -17,7 +17,7 @@ use File::Find; use Storable; use Time::HiRes qw(time); use File::Path qw(mkpath); -use Text::Unaccent; +use Text::Unaccent::PurePerl; use Digest::MD5; use Statistics::Descriptive; @@ -815,7 +815,7 @@ sub items { $code =~ s{\n+$}{\n}s; # XXX convert @row->{foo} into @{$row->{foo}} - $code =~ s|\@(row->{[^}]+})|\@{\$$1}|gs; + $code =~ s|\@(row->\{[^}]+\})|\@{\$$1}|gs; my $commit = $self->param('commit'); my $test = $self->param('test'); @@ -826,7 +826,7 @@ sub items { if ( $code && ( $test || $commit ) ) { # XXX find columns used in code snippet and show them to user my $order = 0; - foreach my $column ( $code =~ m/\$row->{([^}]+)}/g ) { + foreach my $column ( $code =~ m/\$row->\{([^}]+)\}/g ) { if ( $column =~ s/^(['"])// ) { $column =~ s/$1$//; } @@ -992,7 +992,7 @@ sub items { warn "# sorted_items ", $#$sorted_items + 1, " offset $offset limit $limit order $sort"; my $depends_on; - my $tmp = $code; $tmp =~ s/\$row->{(['"]?)([\w\s]+)\1/$depends_on->{$2}++/gse; + my $tmp = $code; $tmp =~ s/\$row->\{(['"]?)([\w\s]+)\1/$depends_on->{$2}++/gse; warn "# depends_on ",dump $depends_on; my $test_added = Storable::dclone $test_changed; -- 2.20.1