{
    "mode": "info",
    "parameter": "TAP::Parser::SourceHandler::Executable",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/TAP%3A%3AParser%3A%3ASourceHandler%3A%3AExecutable/json",
    "generated": "2026-07-05T16:07:51Z",
    "synopsis": "use TAP::Parser::Source;\nuse TAP::Parser::SourceHandler::Executable;\nmy $source = TAP::Parser::Source->new->raw(['/usr/bin/ruby', 'mytest.rb']);\n$source->assemblemeta;\nmy $class = 'TAP::Parser::SourceHandler::Executable';\nmy $vote  = $class->canhandle( $source );\nmy $iter  = $class->makeiterator( $source );",
    "sections": {
        "NAME": {
            "content": "TAP::Parser::SourceHandler::Executable - Stream output from an\nexecutable TAP source\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.43\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use TAP::Parser::Source;\nuse TAP::Parser::SourceHandler::Executable;\n\nmy $source = TAP::Parser::Source->new->raw(['/usr/bin/ruby', 'mytest.rb']);\n$source->assemblemeta;\n\nmy $class = 'TAP::Parser::SourceHandler::Executable';\nmy $vote  = $class->canhandle( $source );\nmy $iter  = $class->makeiterator( $source );\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is an executable TAP::Parser::SourceHandler - it has 2 jobs:\n\n1. Figure out if the TAP::Parser::Source it's given is an executable\ncommand (\"canhandle\").\n\n2. Creates an iterator for executable commands (\"makeiterator\").\n\nUnless you're writing a plugin or subclassing TAP::Parser, you probably\nwon't need to use this module directly.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Class Methods\n\"canhandle\"\n\nmy $vote = $class->canhandle( $source );\n\nOnly votes if $source looks like an executable file. Casts the\nfollowing votes:\n\n0.9  if it's a hash with an 'exec' key\n0.8  if it's a .bat file\n0.75 if it's got an execute bit set\n\n\"makeiterator\"\n\nmy $iterator = $class->makeiterator( $source );\n\nReturns a new TAP::Parser::Iterator::Process for the source.\n\"$source->raw\" must be in one of the following forms:\n\n{ exec => [ @exec ] }\n\n[ @exec ]\n\n$file\n\n\"croak\"s on error.\n\n\"iteratorclass\"\n\nThe class of iterator to use, override if you're sub-classing.\nDefaults to TAP::Parser::Iterator::Process.\n",
            "subsections": []
        },
        "SUBCLASSING": {
            "content": "Please see \"SUBCLASSING\" in TAP::Parser for a subclassing overview.\n\nExample\npackage MyRubySourceHandler;\n\nuse strict;\n\nuse Carp qw( croak );\nuse TAP::Parser::SourceHandler::Executable;\n\nuse base 'TAP::Parser::SourceHandler::Executable';\n\n# expect $handler->(['mytest.rb', 'cmdline', 'args']);\nsub makeiterator {\nmy ($self, $source) = @;\nmy @testargs = @{ $source->testargs };\nmy $rbfile   = $testargs[0];\ncroak(\"error: Ruby file '$rbfile' not found!\") unless (-f $rbfile);\nreturn $self->SUPER::rawsource(['/usr/bin/ruby', @testargs]);\n}\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "TAP::Object, TAP::Parser, TAP::Parser::IteratorFactory,\nTAP::Parser::SourceHandler, TAP::Parser::SourceHandler::Perl,\nTAP::Parser::SourceHandler::File, TAP::Parser::SourceHandler::Handle,\nTAP::Parser::SourceHandler::RawTAP\n\nperl v5.34.0                     TAP::Parser::SourceHandler::Executable(3perl)",
            "subsections": []
        }
    },
    "summary": "TAP::Parser::SourceHandler::Executable - Stream output from an executable TAP source",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "Executable",
            "section": "3perl",
            "url": "https://www.chedong.com/phpMan.php/man/Executable/3perl/json"
        }
    ]
}