From: Tara L Andrews Date: Mon, 24 Sep 2012 08:48:23 +0000 (+0200) Subject: enable language role plugin; require sigil for plaintext init X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bf7d52b5339dfc04b03e3dd93453561efc43d087;p=scpubgit%2Fstemmatology.git enable language role plugin; require sigil for plaintext init --- diff --git a/base/lib/Text/Tradition/Witness.pm b/base/lib/Text/Tradition/Witness.pm index 5c32b36..d0c4fb6 100644 --- a/base/lib/Text/Tradition/Witness.pm +++ b/base/lib/Text/Tradition/Witness.pm @@ -180,6 +180,9 @@ if( $xpwit ) { =cut +# Enable plugin(s) if available +eval { with 'Text::Tradition::WitLanguage'; }; + subtype 'SourceType', as 'Str', where { $_ =~ /^(xmldesc|plaintext|json|collation)$/ }, @@ -659,6 +662,9 @@ sub _init_from_json { sub _init_from_plaintext { my( $self ) = @_; + unless( $self->has_sigil ) { + throw( "No sigil defined for the plaintext witness" ); + } my $str; if( $self->has_file ) { my $ok = open( INPUT, $self->file );