Sponsored Content
Full Discussion: Don't Worry!
The Lounge What is on Your Mind? Cartoons for Geeks Don't Worry! Post 302720321 by Linux Bot on Tuesday 23rd of October 2012 06:35:01 PM
Old 10-23-2012
Don't Worry!

2012-10-24T00:26:11+02:00




Image





Tweet
Image Image Image Image
Image

Source...
 

4 More Discussions You Might Find Interesting

1. Programming

Why I don't get any output?

Hello, I am very new in writing low level programming in C. I am trying to get an output in Linux 2.6.17.6 gentoo platform, but I don't get any output. I am trying to do the following: I am trying to scan a word and print its content at the standard output by using sscanf and printf. I... (6 Replies)
Discussion started by: Sharmin
6 Replies

2. Shell Programming and Scripting

Don't Quote Me On This...

Korn Shell Scripting on Solaris 9 Hello, this is my first post, I figure I share a problem and how I fixed it as well as ask a question that I'm currently stuck on. A version of "Give a Penny" "Take a Penny" First Problem - I'm currently writing an automated version of one of the two types... (3 Replies)
Discussion started by: Janus
3 Replies

3. UNIX for Dummies Questions & Answers

I don't where to start.

I am someone who has lived on windows till I knew it inside and out but was very ignorant to other operating systems. Last week, after hearing of a much better operating system with more control and structure, I switched to Unix. I have no idea what I am doing but I am happy to learn. Could... (4 Replies)
Discussion started by: newbie sarah
4 Replies

4. Solaris

VxVM..anything to worry about in here..

DEVICE TYPE DISK GROUP STATUS c0t0d0s2 sliced rootdisk rootdg online c1t1d0s2 sliced disk01 rootdg online c2t0d0s2 sliced actsvr101 actsvr1dg online c2t2d0s2 sliced actsvr102 actsvr1dg online c2t3d0s2 ... (13 Replies)
Discussion started by: incredible
13 Replies
TAP::Parser::SourceHandler(3pm) 			 Perl Programmers Reference Guide			   TAP::Parser::SourceHandler(3pm)

NAME
TAP::Parser::SourceHandler - Base class for different TAP source handlers VERSION
Version 3.23 SYNOPSIS
# abstract class - don't use directly! # see TAP::Parser::IteratorFactory for general usage # must be sub-classed for use package MySourceHandler; use base qw( TAP::Parser::SourceHandler ); sub can_handle { return $confidence_level } sub make_iterator { return $iterator } # see example below for more details DESCRIPTION
This is an abstract base class for TAP::Parser::Source handlers / handlers. A "TAP::Parser::SourceHandler" does whatever is necessary to produce & capture a stream of TAP from the raw source, and package it up in a TAP::Parser::Iterator for the parser to consume. "SourceHandlers" must implement the source detection & handling interface used by TAP::Parser::IteratorFactory. At 2 methods, the interface is pretty simple: "can_handle" and "make_source". Unless you're writing a new TAP::Parser::SourceHandler, a plugin, or subclassing TAP::Parser, you probably won't need to use this module directly. METHODS
Class Methods "can_handle" Abstract method. my $vote = $class->can_handle( $source ); $source is a TAP::Parser::Source. Returns a number between 0 & 1 reflecting how confidently the raw source can be handled. For example, 0 means the source cannot handle it, 0.5 means it may be able to, and 1 means it definitely can. See "detect_source" in TAP::Parser::IteratorFactory for details on how this is used. "make_iterator" Abstract method. my $iterator = $class->make_iterator( $source ); $source is a TAP::Parser::Source. Returns a new TAP::Parser::Iterator object for use by the TAP::Parser. "croak"s on error. SUBCLASSING
Please see "SUBCLASSING" in TAP::Parser for a subclassing overview, and any of the subclasses that ship with this module as an example. What follows is a quick overview. Start by familiarizing yourself with TAP::Parser::Source and TAP::Parser::IteratorFactory. TAP::Parser::SourceHandler::RawTAP is the easiest sub-class to use an an example. It's important to point out that if you want your subclass to be automatically used by TAP::Parser you'll have to and make sure it gets loaded somehow. If you're using prove you can write an App::Prove plugin. If you're using TAP::Parser or TAP::Harness directly (e.g. through a custom script, ExtUtils::MakeMaker, or Module::Build) you can use the "config" option which will cause "load_sources" in TAP::Parser::IteratorFactory to load your subclass). Don't forget to register your class with "register_handler" in TAP::Parser::IteratorFactory. Example package MySourceHandler; use strict; use vars '@ISA'; # compat with older perls use MySourceHandler; # see TAP::Parser::SourceHandler use TAP::Parser::IteratorFactory; @ISA = qw( TAP::Parser::SourceHandler ); TAP::Parser::IteratorFactory->register_handler( __PACKAGE__ ); sub can_handle { my ( $class, $src ) = @_; my $meta = $src->meta; my $config = $src->config_for( $class ); if ($config->{accept_all}) { return 1.0; } elsif (my $file = $meta->{file}) { return 0.0 unless $file->{exists}; return 1.0 if $file->{lc_ext} eq '.tap'; return 0.9 if $file->{shebang} && $file->{shebang} =~ /^#!.+tap/; return 0.5 if $file->{text}; return 0.1 if $file->{binary}; } elsif ($meta->{scalar}) { return 0.8 if $$raw_source_ref =~ /d..d/; return 0.6 if $meta->{has_newlines}; } elsif ($meta->{array}) { return 0.8 if $meta->{size} < 5; return 0.6 if $raw_source_ref->[0] =~ /foo/; return 0.5; } elsif ($meta->{hash}) { return 0.6 if $raw_source_ref->{foo}; return 0.2; } return 0; } sub make_iterator { my ($class, $source) = @_; # this is where you manipulate the source and # capture the stream of TAP in an iterator # either pick a TAP::Parser::Iterator::* or write your own... my $iterator = TAP::Parser::Iterator::Array->new([ 'foo', 'bar' ]); return $iterator; } 1; AUTHORS
TAPx Developers. Source detection stuff added by Steve Purkis SEE ALSO
TAP::Object, TAP::Parser, TAP::Parser::Source, TAP::Parser::Iterator, TAP::Parser::IteratorFactory, TAP::Parser::SourceHandler::Executable, TAP::Parser::SourceHandler::Perl, TAP::Parser::SourceHandler::File, TAP::Parser::SourceHandler::Handle, TAP::Parser::SourceHandler::RawTAP perl v5.16.2 2012-10-25 TAP::Parser::SourceHandler(3pm)
All times are GMT -4. The time now is 08:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy