Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Perl Modules

    Verby::Action 0.05

    Download button

    No screenshots available
    Downloads: 324  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Yuval Kogman | More programs
    Perl Artistic License / FREE
    July 14th, 2008, 15:06 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Verby::Action description

    Verby::Action is the base role for an action in Verby.

    Verby::Action is the base role for an action in Verby.

    SYNOPSIS

    package MyAction;
    use Moose;

    with qw/Verby::Action/;

    sub do { ... }

    sub verify { ... }

    A Verby::Action is an object encapsulating reusable code. Steps usually delegate to actions, for the actual grunt work.

    METHODS

    new

    Instantiate an action. Actions should be able to live indefinitely, and should not carry internal state with them. All the parameters for do or verify are provided within the context.

    The action instance data should only be used to configure action "flavours", controlling behavior that should not be parameter sensitive (configuration data).
    do $cxt

    The thing that the action really does. For example

    package Verby::Action::Download;

    sub do {
    my ($self, $c) = @_;
    system("wget", "-O", $c->file, $c->url);
    }


    Will use wget to download $c->url to $c->file.

    This is a bad example though, you ought to subclass Verby::Action::Run if you want to run a command.
    verify $cxt

    Perform a boolean check - whether or not the action is completed, for a given set of arguments.

    For example, if do downloads $c->file from $c->url, then the verify method would look like:

    sub verify {
    my ($self, $c) = @_;
    -f $c->file;
    }


    or it could even make a HEAD request and make sure that $c->file is up to date.
    confirm $cxt

    Typically called at the end of an action's do:

    sub do {
    my ($self, $c) = @_;
    ...
    $self->confirm($c);
    }


    It will call $c->logger->log_and_die unless verify returns a true value.

    If $c->error contains a string then it'll be printed as well.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Verby action | Verby role | Perl module | Verby | action | role



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM