{
    "content": [
        {
            "type": "text",
            "text": "# TAP::Parser::Source (perldoc)\n\n## NAME\n\nTAP::Parser::Source - a TAP source & meta data about it\n\n## SYNOPSIS\n\nuse TAP::Parser::Source;\nmy $source = TAP::Parser::Source->new;\n$source->raw( \\'reference to raw TAP source' )\n->config( \\%config )\n->merge( $boolean )\n->switches( \\@switches )\n->testargs( \\@args )\n->assemblemeta;\ndo { ... } if $source->meta->{isfile};\n# see assemblemeta for a full list of data available\n\n## DESCRIPTION\n\nA TAP *source* is something that produces a stream of TAP for the parser to consume, such as an\nexecutable file, a text file, an archive, an IO handle, a database, etc. \"TAP::Parser::Source\"s\nencapsulate these *raw* sources, and provide some useful meta data about them. They are used by\nTAP::Parser::SourceHandlers, which do whatever is required to produce & capture a stream of TAP\nfrom the *raw* source, and package it up in a TAP::Parser::Iterator for the parser to consume.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (2 subsections)\n- **AUTHORS**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "TAP::Parser::Source",
        "section": "",
        "mode": "perldoc",
        "summary": "TAP::Parser::Source - a TAP source & meta data about it",
        "synopsis": "use TAP::Parser::Source;\nmy $source = TAP::Parser::Source->new;\n$source->raw( \\'reference to raw TAP source' )\n->config( \\%config )\n->merge( $boolean )\n->switches( \\@switches )\n->testargs( \\@args )\n->assemblemeta;\ndo { ... } if $source->meta->{isfile};\n# see assemblemeta for a full list of data available",
        "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": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Class Methods",
                        "lines": 5
                    },
                    {
                        "name": "Instance Methods",
                        "lines": 113
                    }
                ]
            },
            {
                "name": "AUTHORS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "TAP::Parser::Source - a TAP source & meta data about it\n",
                "subsections": []
            },
            "VERSION": {
                "content": "Version 3.43\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use TAP::Parser::Source;\nmy $source = TAP::Parser::Source->new;\n$source->raw( \\'reference to raw TAP source' )\n->config( \\%config )\n->merge( $boolean )\n->switches( \\@switches )\n->testargs( \\@args )\n->assemblemeta;\n\ndo { ... } if $source->meta->{isfile};\n# see assemblemeta for a full list of data available\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "A TAP *source* is something that produces a stream of TAP for the parser to consume, such as an\nexecutable file, a text file, an archive, an IO handle, a database, etc. \"TAP::Parser::Source\"s\nencapsulate these *raw* sources, and provide some useful meta data about them. They are used by\nTAP::Parser::SourceHandlers, which do whatever is required to produce & capture a stream of TAP\nfrom the *raw* source, and package it up in a TAP::Parser::Iterator for the parser to consume.\n\nUnless you're writing a new TAP::Parser::SourceHandler, a plugin or subclassing TAP::Parser, you\nprobably won't need to use this module directly.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Class Methods",
                        "content": "\"new\"\nmy $source = TAP::Parser::Source->new;\n\nReturns a new \"TAP::Parser::Source\" object.\n"
                    },
                    {
                        "name": "Instance Methods",
                        "content": "\"raw\"\nmy $raw = $source->raw;\n$source->raw( $somevalue );\n\nChaining getter/setter for the raw TAP source. This is a reference, as it may contain large\namounts of data (eg: raw TAP).\n\n\"meta\"\nmy $meta = $source->meta;\n$source->meta({ %somevalue });\n\nChaining getter/setter for meta data about the source. This defaults to an empty hashref. See\n\"assemblemeta\" for more info.\n\n\"hasmeta\"\nTrue if the source has meta data.\n\n\"config\"\nmy $config = $source->config;\n$source->config({ %somevalue });\n\nChaining getter/setter for the source's configuration, if any has been provided by the user. How\nit's used is up to you. This defaults to an empty hashref. See \"configfor\" for more info.\n\n\"merge\"\nmy $merge = $source->merge;\n$source->config( $bool );\n\nChaining getter/setter for the flag that dictates whether STDOUT and STDERR should be merged\n(where appropriate). Defaults to undef.\n\n\"switches\"\nmy $switches = $source->switches;\n$source->config([ @switches ]);\n\nChaining getter/setter for the list of command-line switches that should be passed to the source\n(where appropriate). Defaults to undef.\n\n\"testargs\"\nmy $testargs = $source->testargs;\n$source->config([ @testargs ]);\n\nChaining getter/setter for the list of command-line arguments that should be passed to the\nsource (where appropriate). Defaults to undef.\n\n\"assemblemeta\"\nmy $meta = $source->assemblemeta;\n\nGathers meta data about the \"raw\" source, stashes it in \"meta\" and returns it as a hashref. This\nis done so that the TAP::Parser::SourceHandlers don't have to repeat common checks. Currently\nthis includes:\n\nisscalar => $bool,\nishash   => $bool,\nisarray  => $bool,\n\n# for scalars:\nlength => $n\nhasnewlines => $bool\n\n# only done if the scalar looks like a filename\nisfile => $bool,\nisdir  => $bool,\nissymlink => $bool,\nfile => {\n# only done if the scalar looks like a filename\nbasename => $string, # including ext\ndir      => $string,\next      => $string,\nlcext   => $string,\n# system checks\nexists  => $bool,\nstat    => [ ... ], # perldoc -f stat\nempty   => $bool,\nsize    => $n,\ntext    => $bool,\nbinary  => $bool,\nread    => $bool,\nwrite   => $bool,\nexecute => $bool,\nsetuid  => $bool,\nsetgid  => $bool,\nsticky  => $bool,\nisfile => $bool,\nisdir  => $bool,\nissymlink => $bool,\n# only done if the file's a symlink\nlstat      => [ ... ], # perldoc -f lstat\n# only done if the file's a readable text file\nshebang => $firstline,\n}\n\n# for arrays:\nsize => $n,\n\n\"shebang\"\nGet the shebang line for a script file.\n\nmy $shebang = TAP::Parser::Source->shebang( $somescript );\n\nMay be called as a class method\n\n\"configfor\"\nmy $config = $source->configfor( $class );\n\nReturns \"config\" for the $class given. Class names may be fully qualified or abbreviated, eg:\n\n# these are equivalent\n$source->configfor( 'Perl' );\n$source->configfor( 'TAP::Parser::SourceHandler::Perl' );\n\nIf a fully qualified $class is given, its abbreviated version is checked first.\n"
                    }
                ]
            },
            "AUTHORS": {
                "content": "Steve Purkis.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "TAP::Object, TAP::Parser, TAP::Parser::IteratorFactory, TAP::Parser::SourceHandler\n",
                "subsections": []
            }
        }
    }
}