You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/07/10 07:20:04 UTC

[1/2] git commit: Make Storable failures graceful.

Repository: lucy-clownfish
Updated Branches:
  refs/heads/prep_cpan_dist_for_0.4.0 7a69398d8 -> 02c105c68


Make Storable failures graceful.

Throw exceptions rather than segfault when Clownfish objects are
serialized using Storable.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/0b806ea7
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/0b806ea7
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/0b806ea7

Branch: refs/heads/prep_cpan_dist_for_0.4.0
Commit: 0b806ea7af97754beabc27db0921f55bf310ccb3
Parents: 7a69398
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Jul 9 19:55:14 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Jul 9 19:55:14 2014 -0700

----------------------------------------------------------------------
 runtime/perl/lib/Clownfish.pm    |  9 +++++++++
 runtime/perl/t/binding/019-obj.t | 17 ++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0b806ea7/runtime/perl/lib/Clownfish.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm
index 5b02103..ac625a8 100644
--- a/runtime/perl/lib/Clownfish.pm
+++ b/runtime/perl/lib/Clownfish.pm
@@ -86,6 +86,15 @@ sub error {$Clownfish::Err::error}
     our $VERSION = '0.003000';
     $VERSION = eval $VERSION;
     use Clownfish qw( to_clownfish to_perl );
+    use Carp qw( confess );
+    sub STORABLE_freeze {
+        my $class_name = ref(shift);
+        confess("Storable serialization not implemented for $class_name");
+    }
+    sub STORABLE_thaw {
+        my $class_name = ref(shift);
+        confess("Storable serialization not implemented for $class_name");
+    }
 }
 
 {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/0b806ea7/runtime/perl/t/binding/019-obj.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/binding/019-obj.t b/runtime/perl/t/binding/019-obj.t
index 5560f48..ce9e9d9 100644
--- a/runtime/perl/t/binding/019-obj.t
+++ b/runtime/perl/t/binding/019-obj.t
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 15;
+use Test::More tests => 17;
 
 package TestObj;
 use base qw( Clownfish::Obj );
@@ -43,6 +43,7 @@ use base qw( Clownfish::Obj );
 }
 
 package main;
+use Storable qw( freeze thaw );
 
 ok( defined $TestObj::version,
     "Using base class should grant access to "
@@ -53,6 +54,20 @@ my $object = TestObj->new;
 isa_ok( $object, "Clownfish::Obj",
     "Clownfish objects can be subclassed" );
 
+{
+    no warnings 'once';
+    eval { freeze($object) };
+    like( $@, qr/implement/i,
+        "freezing an Obj throws an exception rather than segfaults" );
+    *TestObj::STORABLE_freeze = sub {"meep"};
+    local *TestObj::DESTROY = sub {};
+    my $fake = bless {}, 'TestObj';
+    my $frozen = freeze($fake);
+    eval { thaw($frozen) };
+    like( $@, qr/implement/,
+        "thawing an Obj throws an exception rather than segfaults" );
+}
+
 ok( $object->is_a("Clownfish::Obj"),     "custom is_a correct" );
 ok( !$object->is_a("Clownfish::Object"), "custom is_a too long" );
 ok( !$object->is_a("Clownfish"),         "custom is_a substring" );


[2/2] git commit: Use "Apache Clownfish" in CPAN dist abstracts.

Posted by ma...@apache.org.
Use "Apache Clownfish" in CPAN dist abstracts.

This commit will be rolled into others before merging to master.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/02c105c6
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/02c105c6
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/02c105c6

Branch: refs/heads/prep_cpan_dist_for_0.4.0
Commit: 02c105c68769f556c214bff8080e67e4d67accc7
Parents: 0b806ea
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Jul 9 22:13:11 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Jul 9 22:14:04 2014 -0700

----------------------------------------------------------------------
 compiler/perl/Build.PL | 2 +-
 runtime/perl/Build.PL  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/02c105c6/compiler/perl/Build.PL
----------------------------------------------------------------------
diff --git a/compiler/perl/Build.PL b/compiler/perl/Build.PL
index e032b1c..af7256b 100644
--- a/compiler/perl/Build.PL
+++ b/compiler/perl/Build.PL
@@ -25,7 +25,7 @@ my $builder = Clownfish::CFC::Build->new(
     dist_author =>
         'The Apache Lucy Project <dev at lucy dot apache dot org>',
     dist_version_from => 'lib/Clownfish/CFC.pm',
-    dist_abstract      => 'CFC Clownfish compiler',
+    dist_abstract      => 'CFC Apache Clownfish compiler',
     requires           => { 'perl' => '5.8.3', },
     configure_requires => { 'Module::Build' => 0.280801 },
     build_requires    => {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/02c105c6/runtime/perl/Build.PL
----------------------------------------------------------------------
diff --git a/runtime/perl/Build.PL b/runtime/perl/Build.PL
index 527f772..887f320 100644
--- a/runtime/perl/Build.PL
+++ b/runtime/perl/Build.PL
@@ -25,7 +25,7 @@ my $builder = Clownfish::Build->new(
     dist_author =>
         'The Apache Lucy Project <dev at lucy dot apache dot org>',
     dist_version       => '0.3.0',
-    dist_abstract      => 'Clownfish Runtime',
+    dist_abstract      => 'Apache Clownfish Runtime',
     requires           => { 'perl' => '5.8.3', },
     configure_requires => { 'Module::Build' => 0.280801 },
     build_requires     => {