summaryrefslogtreecommitdiffstats
path: root/lib/smartmatch.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-07-08 03:01:49 -0500
committerJesse Luehrs <doy@tozt.net>2011-07-08 03:01:49 -0500
commit1a0c3c3a02da09abc11bbad291d09a41c1850d1d (patch)
treec19787eda8fa4dd155e028752cc38bc19dad0aca /lib/smartmatch.pm
parent046119999e010e4a38b67f5f194baaf60e7c8707 (diff)
downloadsmartmatch-engine-core-1a0c3c3a02da09abc11bbad291d09a41c1850d1d.tar.gz
smartmatch-engine-core-1a0c3c3a02da09abc11bbad291d09a41c1850d1d.zip
split this out into its own dist, and implement the custom opcode
Diffstat (limited to 'lib/smartmatch.pm')
-rw-r--r--lib/smartmatch.pm39
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/smartmatch.pm b/lib/smartmatch.pm
deleted file mode 100644
index 071e4ea..0000000
--- a/lib/smartmatch.pm
+++ /dev/null
@@ -1,39 +0,0 @@
-package smartmatch;
-use strict;
-use warnings;
-use 5.010;
-# ABSTRACT: pluggable smart matching backends
-
-use parent 'DynaLoader';
-use B::Hooks::OP::Check;
-
-sub dl_load_flags { 0x01 }
-
-__PACKAGE__->bootstrap(
- # we need to be careful not to touch $VERSION at compile time, otherwise
- # DynaLoader will assume it's set and check against it, which will cause
- # fail when being run in the checkout without dzil having set the actual
- # $VERSION
- exists $smartmatch::{VERSION}
- ? ${ $smartmatch::{VERSION} } : (),
-);
-
-sub import {
- my $package = shift;
- my ($cb) = @_;
-
- if (!ref($cb)) {
- my $engine = "smartmatch::engine::$cb";
- eval "require $engine; 1"
- or die "Couldn't load smartmatch engine $engine: $@";
- $cb = $engine->can('match') unless ref($cb);
- }
-
- smartmatch::register($cb);
-}
-
-sub unimport {
- smartmatch::unregister();
-}
-
-1;