use Text::Unaccent::PurePerl because other one segfaults
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 23 Dec 2016 13:02:50 +0000 (14:02 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 23 Dec 2016 13:02:50 +0000 (14:02 +0100)
Makefile.PL
lib/MojoFacets.pm
lib/MojoFacets/Data.pm

index ba55798..207ca0c 100755 (executable)
@@ -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';
 
index c2ef3d4..cf52bec 100644 (file)
@@ -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), $/;
                        }
                }
        }
index 513adbe..0f47450 100644 (file)
@@ -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;