TAP::Parser::SourceHandler::File - 從文字檔串流 TAP。
版本 3.44
use TAP::Parser::Source;
use TAP::Parser::SourceHandler::File;
my $source = TAP::Parser::Source->new->raw( \'file.tap' );
$source->assemble_meta;
my $class = 'TAP::Parser::SourceHandler::File';
my $vote = $class->can_handle( $source );
my $iter = $class->make_iterator( $source );
這是一個儲存在檔案中的原始 TAP TAP::Parser::SourceHandler - 它有 2 個工作
1. 找出給定的原始來源是否包含原始 TAP 輸出的檔案。有關更多詳細資訊,請參閱 TAP::Parser::IteratorFactory。
2. 從給定的文字檔取得原始 TAP,並轉換為反覆運算器。
除非您正在撰寫外掛程式或子類化 TAP::Parser,否則您可能不需要直接使用這個模組。
can_handle
my $vote = $class->can_handle( $source );
只有在 $source 看起來像常規檔案時才會投票。投下以下票數
0.9 if it's a .tap file
0.9 if it has an extension matching any given in user config.
make_iterator
my $iterator = $class->make_iterator( $source );
傳回來源的新 TAP::Parser::Iterator::Stream。發生錯誤時會 croak
。
iterator_class
要使用的反覆運算器類別,如果您是子類別,請覆寫。預設為 TAP::Parser::Iterator::Stream。
{
extensions => [ @case_insensitive_exts_to_match ]
}
請參閱 TAP::Parser 中的「SUBCLASSING」 以取得子類別化概觀。
TAP::Object、TAP::Parser、TAP::Parser::SourceHandler、TAP::Parser::SourceHandler::Executable、TAP::Parser::SourceHandler::Perl、TAP::Parser::SourceHandler::Handle、TAP::Parser::SourceHandler::RawTAP