{
    "content": [
        {
            "type": "text",
            "text": "# TAP::Parser::SourceHandler::Executable (perldoc)\n\n## NAME\n\nTAP::Parser::SourceHandler::Executable - Stream output from an executable TAP source\n\n## SYNOPSIS\n\nuse 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 );\n\n## DESCRIPTION\n\nThis is an *executable* TAP::Parser::SourceHandler - it has 2 jobs:\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (1 subsections)\n- **SUBCLASSING** (1 subsections)\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "TAP::Parser::SourceHandler::Executable",
        "section": "",
        "mode": "perldoc",
        "summary": "TAP::Parser::SourceHandler::Executable - Stream output from an executable TAP source",
        "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 );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Class Methods",
                        "lines": 27
                    }
                ]
            },
            {
                "name": "SUBCLASSING",
                "lines": 2,
                "subsections": [
                    {
                        "name": "Example",
                        "lines": 18
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            }
        ],
        "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": []
            }
        }
    }
}