Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    OpenInteract2::Config::Initializer 1.99_06

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Chris Winters | More programs
    Perl Artistic License / FREE
    December 1st, 2006, 05:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    OpenInteract2::Config::Initializer description

    OpenInteract2::Config::Initializer is a Perl module for observable configuration initialization events.

    OpenInteract2::Config::Initializer is a Perl module for observable configuration initialization events.

    SYNOPSIS

    # Add an initializer in your package.conf

    name mypackage
    version 1.10
    ...
    config_watcher OpenInteract2::MyInitializerSpops
    config_watcher OpenInteract2::MyInitializerAction

    # And the code in our package -- we'll dynamically add a rule from
    # 'My::Googlable' to a class where 'is_googlable' is set to 'yes'

    package OpenInteract2::MyInitializerSpops;

    use strict;

    sub update {
    my ( $class, $type, $config ) = @_;
    return unless ( $type eq 'spops' );

    if ( $config->{is_googlable} eq 'yes' ) {
    push @{ $config->{rules_from} }, 'My::Googable';
    }
    }

    # Add a configuration observer in the server configuration

    [config_watcher]
    class = OpenInteract2::MyInitializerAction

    # and in the class we'll dynamically add a filter to an action where
    # 'is_googlable' is 'yes'

    package OpenInteract2::MyInitializerAction;

    use strict;
    use OpenInteract2::Context qw( CTX );

    sub update {
    my ( $class, $type, $config ) = @_;
    return unless ( $type eq 'action' );
    if ( 'yes' eq lc $config->{is_googlable} ) {
    CTX->map_observer( google => $config->{class} );
    }
    }

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    observable configuration | initialization events | Perl module | OpenInteract2::Confi | observable | configuration

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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