++ed by:

3 PAUSE users
2 non-PAUSE users.

Arthur Axel "fREW" Schmidt
and 1 contributors


App::Adenosine - Handy CLI HTTP tool


version 2.001007


The usage docs for Adenosine are in the attached README file. This documentation is for plugins.


To use plugins you need to create a file called adenosine and put it in your path. It should look like this:

 #!/usr/bin/env perl

 use lib 'path/to/adenosine/lib';
 use App::Adenosine;

    argv => \@ARGV,
    plugins => [qw(::Stopwatch ::Rainbow)],

If a plugin begins with double colons, as above, it is automatically prefixed with App::Adenosine::Plugin and then instantiated with no arguments (->new). For plugins that can take options you may also pass objects. So for example the following is also valid:

 use App::Adenosine::Plugin::Rainbow;
    argv => \@ARGV,
    plugins => [
          response_header_name_color => 'orange4',

An "autouse" version of adenosine which uses all the plugins in a certain part of the filesystem is planned.


Adenosine has two types of plugins. The plugin system will grow as users find more things that need extending, so as with much of OSS, this is a scratch-the-itch situation. If you have a use case for a new plugin hook let me know and I'll set it up.

Plugins are just objects that the Adenosine object has. There are a number of interface style roles that the plugin consumes to signal that the plugin uses a certain hook. Note that plugins can consume multiple roles to use more than one hook. The next sections document the roles and their respective hooks.


Only a filter_stderr method needs to be implemented. It takes a string (stderr output from curl) and should return a string. An existing example of a plugin that consumes this role is App::Adenosine::Plugin::Rainbow.


Only a wrap method needs to be implemented. It takes a coderef and should return a coderef. The returned coderef should pass the args it gets to the coderef the method got and return out values returned by the coderef. To be more clear, this is the pattern:

 sub wrap {
    my ($self, $cmd) = @_;

    return sub {
       # ...
       my @ret = $cmd->(@_);
       # ...
       return @ret;

An existing plugin that consumes this role is App::Adenosine::Plugin::Stopwatch.


Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>


This software is copyright (c) 2014 by Arthur Axel "fREW" Schmidt.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.