Group
Extension

Matches 35358

AnyEvent-JSONRPC ( P/PM/PMAKHOLM/AnyEvent-JSONRPC-0.15.tar.gz, PMAKHOLM, 2010; MetaCPAN )
AnyEvent-JSONRPC/lib/AnyEvent/JSONRPC/Utils.pm ( view source; MetaCPAN )
package Anyevent::JSONRPC::Utils;

use base qw(Exporter);
our @EXPORT_OK = qw(
    delegate
    do_moose
    do_exporter
);

sub delegate {
    my $object = shift;
    
    croak("delegate needs a ble
ssed object as parameter") unless blessed $object;

    if ( $object->isa("AnyEvent::JSONRPC::Client") ) {
        # Any call is proxied to the client

        return sub {
            my $cv   = shif
_

=head1 NAME

AnyEvent::JSONRPC::Utils - Helper functions for use with AnyEvent::JSONRPC

=head1 SYNOPSIS

    # XXX being either TCP or HTTP
    my $server = AnyEvent::JSONRPC::XXX::Server->new();
AnyEvent-JSONRPC ( P/PM/PMAKHOLM/AnyEvent-JSONRPC-0.15.tar.gz, PMAKHOLM, 2010; MetaCPAN )
AnyEvent-JSONRPC/lib/AnyEvent/JSONRPC/Client.pm ( view source; MetaCPAN )
e AnyEvent::JSONRPC::Client;

use Any::Moose;

no Any::Moose;

__PACKAGE__->meta->make_immutable;

1;
__END__

=encoding utf-8

=head1 NAME

AnyEvent::JSONRPC::Client - Base class for JSON-RPC clients


=head1 SYNOPSIS

    use AnyEvent::JSONRPC::XXX::Client;
    
    my $client = AnyEvent::JSONRPC::XXX::Client->new(
        ...
    );
    
    # blocking interface
    my $res = $client->call( echo
s for clients in the L<AnyEvent::JSONRPC> suite of
modules. Current implementations includes a
L<TCP|AnyEvent::JSONRPC::TCP::Client> client and a
L<HTTP|AnyEvent::JSONRPC::HTTP::Client> client. See th
AnyEvent-JSONRPC ( P/PM/PMAKHOLM/AnyEvent-JSONRPC-0.15.tar.gz, PMAKHOLM, 2010; MetaCPAN )
AnyEvent-JSONRPC/lib/AnyEvent/JSONRPC/Server.pm ( view source; MetaCPAN )
package AnyEvent::JSONRPC::Server;

use Moose;
use JSON::XS;

has json => (
    is      => "ro",
    default => sub {
        JSON::XS->new->allow_blessed(1)->convert_blessed(1);
    },
);

no Moose;
D__

=head1 NAME

AnyEvent::JSONRPC::Server - Base class for JSON-RPC Servers

=head1 SYNOPSIS

    use AnyEvent::JSONRPC::XXX::Server;
    
    my $server = AnyEvent::JSONRPC::TCP::Server->new( ... )
s for servers in the L<AnyEvent::JSONRPC> suite of
modules. Current implementations includes a
L<TCP|AnyEvent::JSONRPC::TCP::Server> client and a
L<HTTP|AnyEvent::JSONRPC::HTTP::Server> client. See th
AnyEvent-JSONRPC ( P/PM/PMAKHOLM/AnyEvent-JSONRPC-0.15.tar.gz, PMAKHOLM, 2010; MetaCPAN )
AnyEvent-JSONRPC/lib/AnyEvent/JSONRPC/TCP/Client.pm ( view source; MetaCPAN )
package AnyEvent::JSONRPC::TCP::Client;
use Any::Moose;
use Any::Moose '::Util::TypeConstraints';

extends 'AnyEvent::JSONRPC::Client';

use Carp;
use Scalar::Util 'weaken';

use AnyEvent;
use AnyEven
t::Socket;
use AnyEvent::Handle;

use JSON::RPC::Common::Procedure::Call;
use JSON::RPC::Common::Procedure::Return;

has host => (
    is       => 'ro',
    isa      => 'Str',
    required => 1,
);

h
ead(json => sub {
                $self->_handle_response( $_[1] );
            });
        });

        while (my $pooled = shift @{ $self->_request_pool }) {
            $handle->push_write( json =>
AnyEvent-JSONRPC ( P/PM/PMAKHOLM/AnyEvent-JSONRPC-0.15.tar.gz, PMAKHOLM, 2010; MetaCPAN )
AnyEvent-JSONRPC/lib/AnyEvent/JSONRPC/CondVar.pm ( view source; MetaCPAN )
package AnyEvent::JSONRPC::CondVar;
use Any::Moose;

use AnyEvent;

has cv => (
    is      => 'ro',
    isa     => 'AnyEvent::CondVar',
    default => sub {
        AnyEvent->condvar;
    },
    hand
les => [qw( send recv cb )],
);

has call => (
    is       => 'ro',
    isa      => 'JSON::RPC::Common::Procedure::Call',
    required => 1,
    handles  => [qw( is_notification )], 
);

no Any::Moos
AnyEvent::JSONRPC::CondVar - Condvar object used in
AnyEvent::JSONRPC::TCP::Server and AnyEvent::JSONRPC::HTTP::Server

=head1 SEE ALSO

L<AnyEvent::JSONRPC::TCP::Server> and L<AnyEvent::JSONRPC::HTTP
CGI-Application-Plugin-DetectAjax ( J/JI/JIRA/CGI-Application-Plugin-DetectAjax-0.06.tar.gz, JIRA, 2010; MetaCPAN )
CGI-Application-Plugin-DetectAjax/lib/CGI/Application/Plugin/DetectAjax.pm ( view source; MetaCPAN )
ect = MyClass->new;

   my $result = $object->do_work();

   if ($self->is_ajax) {

    return to_json($result);

   }
   else {

     my $t = $self->load_tmpl('myrunmode.tmpl');

     $t->param(RESUL
CGI-Application-Plugin-AJAXUpload ( S/SI/SILASMONK/CGI-Application-Plugin-AJAXUpload-v0.0.3.tar.gz, SILASMONK, 2010; MetaCPAN )
CGI-Application-Plugin-AJAXUpload/lib/Data/FormValidator/Filters/ImgData.pm ( view source; MetaCPAN )
:ImgData version 0.0.3

=head1 SYNOPSIS

    use MyWebApp;
    use CGI::Application::Plugin::JSON qw(to_json);
    use CGI::Application::Plugin::AJAXUpload;
    use Data::FormValidator::Filters::ImgDa
Net-Lujoyglamour ( J/JM/JMERELO/Net-Lujoyglamour-0.0.6.1.9.tar.gz, JMERELO, 2010; MetaCPAN )
Net-Lujoyglamour/lib/Net/Lujoyglamour/WebApp.pm ( view source; MetaCPAN )
Ix::Class ':all';
use CGI::Application::Plugin::Redirect;
use Net::Lujoyglamour qw(is_valid);
use JSON;

sub cgiapp_init  {
    my $self = shift;
    my (%args ) = @_;
    croak "No DSN" if !$args{'PA
 eq 'JSON' ) {
	my $json;
	if ($new_short_url ne '') {
	    $json = to_json( { shortu =>  $self->param('domain')."/".$new_short_url,
			       longu => $long_url} );
	} else {
	    $json = to_json( {m
sg => $@} );
	}
	$self->header_props(-type=>'application/json');
	return $json;
    }
    
}

sub redirect_url {
    my $self   = shift;
    my $url = $self->param('url');
    my $long_url =  $self->s
CGI-Application-Plugin-AJAXUpload ( S/SI/SILASMONK/CGI-Application-Plugin-AJAXUpload-v0.0.3.tar.gz, SILASMONK, 2010; MetaCPAN )
CGI-Application-Plugin-AJAXUpload/lib/CGI/Application/Plugin/AJAXUpload.pm ( view source; MetaCPAN )
ile);
            };
            if ($@) {
                carp $@;
                return $c->to_json({status=> 'Internal Error'});
            }
            return $r;
        }
    );

    return;
$dfv_profile = shift;
    my $httpdocs_dir = $self->ajax_upload_httpdocs;  

    return $self->to_json({status => 'No document root specified'})
        if not defined $httpdocs_dir;

    my $full_upl
');
    return $self->to_json({status=>'No file handle obtained'})
        if !defined $lightweight_fh;
        
    my $fh = $lightweight_fh->handle;
    return $self->to_json({status => 'No file han
Task-Template-Benchmark ( S/SG/SGRAHAM/Task-Template-Benchmark-1.00_05.tar.gz, SGRAHAM, 2010; MetaCPAN )
Task-Template-Benchmark/lib/Task/Template/Benchmark.pm ( view source; MetaCPAN )
Optional bits for extra L<benchmark_template_engines> behaviour:

L<Term::ProgressBar::Simple>

L<JSON::Any>

=item Modules required by multiple plugins:

L<File::Spec>

L<File::Spec> needed by plugin
Net-StackExchange ( H/HA/HAGGAI/Net-StackExchange-0.102740.tar.gz, HAGGAI, 2010; MetaCPAN )
Net-StackExchange/lib/Net/StackExchange/Role/Request.pm ( view source; MetaCPAN )
e ) = @_;

        if ( $type ne 'jsontext' ) {
            confess q{the only valid value is 'jsontext'};
        }
    },
);

has [
    qw{
        key
        jsonp
      }
    ] => (
    is  => 'r
 is C<jsontext>. Responds with mime-type text/json, if set.

=head2 C<key>

Accepts a key and validates this request to a specific application.

=head2 C<jsonp>

If set, the response returns JSON with
 Padding instead of standard JSON.

=head1 AUTHOR

Alan Haggai Alavi <alanhaggai@alanhaggai.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Alan Haggai Alavi.

This is free 
Net-StackExchange ( H/HA/HAGGAI/Net-StackExchange-0.102740.tar.gz, HAGGAI, 2010; MetaCPAN )
Net-StackExchange/lib/Net/StackExchange/Answers/Response.pm ( view source; MetaCPAN )
s

use Moose;
use Moose::Util::TypeConstraints;

with 'Net::StackExchange::Role::Response';

has 'json' => (
    is       => 'ro',
    isa      => 'Str',
    required => 1,
);

has 'answers' => (
    
et::StackExchange::Answers]',
    writer => 'set_answers',
    reader => 'get_answers',
);

has '_json_decoded' => (
    is       => 'ro',
    isa      => 'HashRef',
    required => 1,
    trigger  =>
_object {
    my $self = shift;
    my $json = $self->json();

    my $json_decoded = $self->_json_decoded();

    my @answers;
    for my $answer_ref ( @{ $json_decoded->{'answers'} } ) {
        my 
Net-isoHunt ( H/HA/HAGGAI/Net-isoHunt-0.102770.tar.gz, HAGGAI, 2010; MetaCPAN )
Net-isoHunt/lib/Net/isoHunt/Request.pm ( view source; MetaCPAN )
s request

use Moose;
use Moose::Util::TypeConstraints;

use URI;
use LWP::UserAgent;
use JSON qw{ decode_json };

has 'ihq' => (
    is       => 'rw',
    isa      => 'Str',
    required => 1,
);

ha
t => 'desc',
);

sub execute {
    my $self = shift;

    my $api_url    = 'http://isohunt.com/js/json.php';
    my %parametres = (
        'ihq'   => $self->ihq  (),
        'start' => $self->start()
t' );
    my $json         = $ua->get($uri)->decoded_content();
    my $json_decoded = decode_json($json);

    my $image = Net::isoHunt::Response::Image->new( {
        'title'  => $json_decoded->{'i
Net-StackExchange ( H/HA/HAGGAI/Net-StackExchange-0.102740.tar.gz, HAGGAI, 2010; MetaCPAN )
Net-StackExchange/lib/Net/StackExchange/Core.pm ( view source; MetaCPAN )
VERSION = '0.102740';
}

# ABSTRACT: Subroutines for internal use

use strict;
use warnings;

use JSON;
use LWP::UserAgent;
use Scalar::Util qw{ blessed };
use URI::Escape;

# transform hash keys and 
Task-BeLike-FLORA ( F/FL/FLORA/Task-BeLike-FLORA-0.06.tar.gz, FLORA, 2010; MetaCPAN )
Task-BeLike-FLORA/lib/Task/BeLike/FLORA.pm ( view source; MetaCPAN )
mail::MIME::Kit::Renderer::TT>

=head3 L<Email::Sender>

=head3 L<Function::Parameters>

=head3 L<JSON>

=head3 L<List::AllUtils>

=head3 L<Method::Signatures::Simple>

=head3 L<Moose>

=head3 L<Moose
Net-StackExchange ( H/HA/HAGGAI/Net-StackExchange-0.102740.tar.gz, HAGGAI, 2010; MetaCPAN )
Net-StackExchange/lib/Net/StackExchange/Answers/Request.pm ( view source; MetaCPAN )
 ABSTRACT: Request methods for answers

use Moose;
use Moose::Util::TypeConstraints;

use JSON qw{ decode_json };

with 'Net::StackExchange::Role::Request';

has 'id' => (
    is       => 'ro',
    is
 $self         = shift;
    my $json         = Net::StackExchange::Core::_execute($self);
    my $se           = $self->_NSE();
    my $json_decoded = decode_json($json);

    my $response = Net::Stac
     => $se,
        '_json_decoded' => $json_decoded,
        'json'          => $json,
        'total'         => $json_decoded->{'total'   },
        'page'          => $json_decoded->{'page'    },
Net-StackExchange ( H/HA/HAGGAI/Net-StackExchange-0.102740.tar.gz, HAGGAI, 2010; MetaCPAN )
Net-StackExchange/lib/Net/StackExchange/Types.pm ( view source; MetaCPAN )
ts;
use JSON;

subtype 'List::id'
    => as 'Str'
    => where { $_ =~ /^(?:\d;?)+$/ };

subtype 'JSON::XS::Boolean'
    => as 'JSON::XS::Boolean';

subtype 'JSON::PP::Boolean'
    => as 'JSON::PP::Bo
'
    => from 'JSON::XS::Boolean'
    => via {
        if ( JSON::is_bool($_) && $_ == JSON::true ) {
            return 'true';
        }
        return 'false';
    }
    => from 'JSON::PP::Boolean'

    => via {
        if ( JSON::is_bool($_) && $_ == JSON::true ) {
            return 'true';
        }
        return 'false';
    }
    => from 'Int'
    => via {
        if ($_) {
            ret
Module-Build-DB ( D/DW/DWHEELER/Module-Build-DB-0.10.tar.gz, DWHEELER, 2010; MetaCPAN )
Module-Build-DB/lib/Module/Build/DB.pm ( view source; MetaCPAN )
ur project. For example, to build in the "dev" context,
there must be a F<dev.yml> file (or F<dev.json> or some other format supported
by L<Config::Any>) in the F<conf/> or F<etc/> directory of your p
ill be used.

=head3 test_env

  ./Build db --test_env CATALYST_DEBUG=0 CATALYST_CONFIG=conf/test.json

Optional hash reference of environment variables to set for the lifetime of
C<./Build test>. Thi
      module_name    => 'MyApp',
      db_config_key  => 'dbi',
      replace_config => 'conf/dev.json',
  )->create_build_script;

Set to a string or regular expression (using C<qr//>) and, the C<mod
WebService-Uptrack ( S/SH/SHUFF/WebService-Uptrack-v0.0.2.tar.gz, SHUFF, 2010; MetaCPAN )
WebService-Uptrack/lib/WebService/Uptrack.pm ( view source; MetaCPAN )
nstraints;
use MooseX::StrictConstructor;

require HTTP::Request;
require HTTP::Response;
require JSON::XS;
require LWP::UserAgent;

use version; our $VERSION = qv('0.0.2');

# DEFAULT VALUES
Readonly
 ) }

# JSON
has '_json' => (
    is      => 'ro',
    isa     => duck_type( 'JSON', [ qw( new decode_json ) ] ),
    lazy_build  => 1,
    required    => 1,
);

sub _build__json { return( JSON::XS->n
Accept => 'application/json' );

    # send it
    my( $response ) = $self->_ua->request( $request );

    # what did we get?
    if ( $response->is_success ) {
        my( $json ) = $response->decode
Business-AU-Ledger ( R/RS/RSAVAGE/Business-AU-Ledger-0.88.tgz, RSAVAGE, 2010; MetaCPAN )
Business-AU-Ledger/lib/Business/AU/Ledger/View/Reconciliation.pm ( view source; MetaCPAN )
package Business::AU::Ledger::View::Reconciliation;

use JSON::XS;

use Moose;

extends 'Business::AU::Ledger::View::Base';

use namespace::autoclean;

our $VERSION = '0.88';

# ----------------------
'},
			receipts   => 0.00,
		};
	}

	$self -> log(__PACKAGE__ . '. Leaving initialize');

	return JSON::XS -> new -> encode({results => [@output]});

} # End of initialize.

# ------------------------

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.