{
    "mode": "perldoc",
    "parameter": "TAP::Parser::SourceHandler::Executable",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/TAP%3A%3AParser%3A%3ASourceHandler%3A%3AExecutable/json",
    "generated": "2026-06-12T12:23:49Z",
    "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 executable 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 command (\"canhandle\").\n\n2. Creates an iterator for executable commands (\"makeiterator\").\n\nUnless you're writing a plugin or subclassing TAP::Parser, you probably won't need to use this\nmodule directly.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Class Methods",
                    "content": "\"canhandle\"\nmy $vote = $class->canhandle( $source );\n\nOnly votes if $source looks like an executable file. Casts the following 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\"\nmy $iterator = $class->makeiterator( $source );\n\nReturns a new TAP::Parser::Iterator::Process for the source. \"$source->raw\" must be in one of\nthe following forms:\n\n{ exec => [ @exec ] }\n\n[ @exec ]\n\n$file\n\n\"croak\"s on error.\n\n\"iteratorclass\"\nThe class of iterator to use, override if you're sub-classing. Defaults to\nTAP::Parser::Iterator::Process.\n"
                }
            ]
        },
        "SUBCLASSING": {
            "content": "Please see \"SUBCLASSING\" in TAP::Parser for a subclassing overview.\n",
            "subsections": [
                {
                    "name": "Example",
                    "content": "package 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"
                }
            ]
        },
        "SEE ALSO": {
            "content": "TAP::Object, TAP::Parser, TAP::Parser::IteratorFactory, TAP::Parser::SourceHandler,\nTAP::Parser::SourceHandler::Perl, TAP::Parser::SourceHandler::File,\nTAP::Parser::SourceHandler::Handle, TAP::Parser::SourceHandler::RawTAP\n",
            "subsections": []
        }
    },
    "summary": "TAP::Parser::SourceHandler::Executable - Stream output from an executable TAP source",
    "flags": [],
    "examples": [],
    "see_also": []
}