Result:
found more than 665 distributions - search limited to the first 2001 files matching your query ( run in 1.905 )


CPU-Z80-Disassembler

 view release on metacpan or  search on metacpan

t/data/zx48.asm  view on Meta::CPAN

; continue if a match of all eight bytes was found

        POP     BC              ; discard the
        POP     BC              ; saved
        POP     BC              ; pointers
        LD      A,$80           ; the endpoint of character set
        SUB     B               ; subtract the counter
                                ; to give the code 32-127
        LD      BC,$0001        ; make one space in workspace.

        RST     30H             ; BC-SPACES creates the space sliding

 view all matches for this distribution


CSS-Inliner

 view release on metacpan or  search on metacpan

t/embedded_style_block.t  view on Meta::CPAN


eval {
  $inliner->fetch_file({ url => $test_url });
};

## conditional test plan based on whether or not the endpoint can be reached - frequently can't by cpan testers
plan $@ ? (skip_all => 'Connectivity for endpoint required for test cannot be established') : (tests => 2);

my $inlined = $inliner->inlinify();

ok($inlined eq $correct_result, 'result was correct');

 view all matches for this distribution


CWB

 view release on metacpan or  search on metacpan

t/33_cqp_errors.t  view on Meta::CPAN

for my $R (-1, -2, -42) { # T6–T8
  syntax_error("A = 'the' []{$R} 'elephant'", "negative repetition count {$R}", qr/non-negative/i);
}

for my $R (-1, -2) { # T9–T10
  syntax_error("A = 'the' []{0,$R} 'elephant'", "invalid endpoint of repetition range {0,$R}", qr/non-negative/i);
}

for my $R (1, 2, 3) { # T11–T13
  my $R1 = $R - 1;
  syntax_error("A = 'the' []{$R,$R1} 'elephant'", "invalid repetition range {$R,$R1}", qr/invalid.*range/i);

t/33_cqp_errors.t  view on Meta::CPAN

for my $R (-1, -2, -42) { # T14–T16
  syntax_error("A = TAB 'the' []{$R} 'elephant'", "negative distance {$R} in TAB query", qr/non-negative/i);
}

for my $R (-1, -2) { # T17–T18
  syntax_error("A = TAB 'the' []{0,$R} 'elephant'", "invalid endpoint of distance range {0,$R} in TAB query", qr/non-negative/i);
}

for my $R (-1, -2) { # T19–T20
  syntax_error("A = TAB 'the' []{,$R} 'elephant'", "invalid endpoint of distance range {,$R} in TAB query", qr/non-negative|invalid.*range/i);
}

for my $R (1, 2, 3) { # T21–T23
  my $R1 = $R - 1;
  syntax_error("A = TAB 'the' []{$R,$R1} 'elephant'", "invalid distance range ($R,$R1) in TAB query", qr/invalid.*range/i);

 view all matches for this distribution


CXC-Form-Tiny-Plugin-OptArgs2

 view release on metacpan or  search on metacpan

t/OptArgs.t  view on Meta::CPAN

        type    => Str,
        default => sub { 'https://cda.cfa.harvard.edu/csc2tap' },
    );

    option(
        comment      => 'CSC TAP endpoint',
        isa_name     => 'URL',
        show_default => 1,
    );

    form_field 'output.file' => ( type => Path, coerce => 1 );

 view all matches for this distribution


CaCORE

 view release on metacpan or  search on metacpan

examples/EVStest.pl  view on Meta::CPAN


#
# ApplicationService is a utility classs that encapsulates webservice invocation to caCORE server.
# ApplicationService object follows the Singleton pattern, in that each program will ONLY contain one instance
# of such class.
# The URL being passed to the intance method is the service endpoint of the caCORE webservice.
# If no such URL is provided in the program, it will default to the caCORE production server, "http://cabio.nci.nih.gov/cacore30/ws/caCOREService"
#
my $appsvc = CaCORE::ApplicationService->instance("http://cabio.nci.nih.gov/cacore32/ws/caCOREService");

my $num2 = 0;

 view all matches for this distribution


Cache-Elasticache-Memcache

 view release on metacpan or  search on metacpan

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN

=head1 SYNOPSIS

    use Cache::Elasticache::Memcache;

    my $memd = new Cache::Elasticache::Memcache->new({
        config_endpoint => 'foo.bar',
        update_period => 180,
        # All other options are passed on to Cache::Memcached::Fast
        ...
    });

    # Will update the server list from the configuration endpoint
    $memd->updateServers();

    # Will update the serverlist from the configuration endpoint if the time since
    # the last time the server list was checked is greater than the update period
    # specified when the $memd object was created.
    $memd->checkServers();

    # Class method to retrieve a server list from a configuration endpoint.
    Cache::Elasticache::Memcache->getServersFromEndpoint('foo.bar');

    # All other supported methods are handled by Cache::Memcached::Fast

    # N.B. This library is currently under development

=head1 DESCRIPTION

A wrapper for L<Cache::Memacached::Fast> with support for AWS's auto reconfiguration mechanism. It makes use of an AWS elasticache memcached cluster's configuration endpoint to discover the memcache servers in the cluster and periodically check the c...

=head1 UNDER DEVELOPMENT DISCALIMER

N.B. This module is still under development. It should work, but things may change under the hood. I plan to imporove the resiliance with better timeout handling of communication when updating the server list. I'm toying with the idea of making the s...

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN

=pod

=head1 CONSTRUCTOR

    Cache::Elasticache::Memcache->new({
        config_endpoint => 'foo.bar',
        update_period => 180,
        ...
    })

=head2 Constructor parameters

=over

=item config_endpoint

AWS elasticache memcached cluster config endpoint location

=item update_period

The minimum period (in seconds) to wait between updating the server list. Defaults to 180 seconds

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN

    my ($conf) = @_;
    my $self = bless {}, $class;

    my $args = (@_ == 1) ? shift : { @_ };  # hashref-ify args

    croak "config_endpoint must be speccified" if (!defined $args->{'config_endpoint'});
    croak "servers is not a valid constructors parameter" if (defined $args->{'servers'});

    $self->{'config_endpoint'} = delete @{$args}{'config_endpoint'};

    $args->{servers} = $self->getServersFromEndpoint($self->{'config_endpoint'}) if(defined $self->{'config_endpoint'});
    $self->{_last_update} = time;

    $self->{update_period} = exists $args->{update_period} ? $args->{update_period} : 180;

    $self->{'_args'} = $args;

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN

=pod

=item checkServers

    my $memd = Cache::Elasticache::Memcache->new({
        config_endpoint => 'foo.bar'
    })

    ...

    $memd->checkServers();

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN

=cut

sub checkServers {
    my $self = shift;
    $self->{_current_update_period} = (defined $self->{_current_update_period}) ? $self->{_current_update_period}: $self->{update_period} - rand(10);
    if ( defined $self->{'config_endpoint'} && (time - $self->{_last_update}) > $self->{_current_update_period} ) {
        $self->updateServers();
        $self->{_current_update_period} = undef;
    }
}

=pod

=item updateServers

    my $memd = Cache::Elasticache::Memcache->new({
        config_endpoint => 'foo.bar'
    })

    ...

    $memd->updateServers();

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN

=cut

sub updateServers {
    my $self = shift;

    my $servers = $self->getServersFromEndpoint($self->{'config_endpoint'});

    ## Cache::Memcached::Fast does not support updating the server list after creation
    ## Therefore we must create a new object.

    if ( $self->_hasServerListChanged($servers) ) {

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN


=item getServersFromEndpoint

    Cache::Elasticache::Memcache->getServersFromEndpoint('foo.bar');

This class method will retrieve the server list for a given configuration endpoint.

=cut

sub getServersFromEndpoint {
    my $invoker = shift;
    my $config_endpoint = shift;
    my $data = "";
    # TODO: make use of "connect_timeout" (default 0.5s) and "io_timeout" (default 0.2s) constructor parameters
    # my $args = shift;
    # $connect_timeout = exists $args->{connect_timeout} ? $args->{connect_timeout} : $class::default_connect_timeout;
    # $io_timeout = exists $args->{io_timeout} ? $args->{io_timeout} : $class::default_io_timeout;
    my $socket = (blessed($invoker)) ? $invoker->{_sockets}->{$config_endpoint} : undef;

    for my $i (0..2) {
        unless (defined $socket && $socket->connected()) {
            $socket = IO::Socket::IP->new(PeerAddr => $config_endpoint, Timeout => 10, Proto => 'tcp');
            croak "Unable to connect to server: ".$config_endpoint." - $!" unless $socket;
            $socket->sockopt(SO_KEEPALIVE,1);
            $socket->autoflush(1);
            IO::Socket::Timeout->enable_timeouts_on($socket);
            $socket->read_timeout(0.5);
# This is currently commented out as it was breaking under perl 5.24 for me. Need to investigate!

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN

        } else {
            $socket = undef;
        }
    }
    if (blessed $invoker) {
        $invoker->{_sockets}->{$config_endpoint} = $socket;
    } else {
        $socket->close() if (blessed $socket);
    }
    return $invoker->_parseConfigResponse($data);
}

lib/Cache/Elasticache/Memcache.pm  view on Meta::CPAN

    return \@servers;
}

sub DESTROY {
    my $self = shift;
    foreach my $config_endpoint (keys %{$self->{_sockets}}) {
        my $socket = $self->{_sockets}->{$config_endpoint};
        if (defined $self->{_socket} && $socket->connected()) {
            $self->{_socket}->close();
        }
    }
};

 view all matches for this distribution


Cache-RamDisk

 view release on metacpan or  search on metacpan

lib/Cache/RamDisk.pm  view on Meta::CPAN

1. Message queues are extremely fast, but extremely limited too.

2. Shared memory is perhaps even faster, but it came out for me to be an at least hairy problem
trying to store several references all in one segment.

3. Sockets are reliable, but require a second communication endpoint and yet another server process.

But a file is a file is a file.

The package collects as much ramdisks to a bundle as possible and necessary to hold the required user space,
depending on the respective parameters under which the system's individual kernel had been compiled.

 view all matches for this distribution


Calendar-Japanese-Acme-Syukujitsu

 view release on metacpan or  search on metacpan

lib/Calendar/Japanese/Acme/Syukujitsu.pm  view on Meta::CPAN


sub new {
    args
        my $class,
        my $cachefile => {optional => 1},
        my $endpoint => {optional => 1};

    my $data;
    if ($cachefile) {
        $data = read_file($cachefile);
    } else {
        $endpoint = $endpoint || $DEFAULT_ENDPOINT;
        $data = Furl->new()->get($endpoint)->content;
    }
    Encode::from_to($data, 'sjis', 'utf-8');

    my $syukujitsus = {};
    for my $line (split /\n/, $data) {

lib/Calendar/Japanese/Acme/Syukujitsu.pm  view on Meta::CPAN

F<syukujitsu.csv> that published by Japanese government.
With interface that referenced to C<Calendar::Japanese::Holiday>.

=head1 METHODS

=head2 new([cachefile => $cachefile][endpoint => $endpoint])
Constructor.

=head2 get_syukujitsus(year => $year [, month => $month [, day => $day]])

=head2 is_syukujitsu(year => $year, month => $month, day => $day)

 view all matches for this distribution


Cassandra-Lite

 view release on metacpan or  search on metacpan

lib/Cassandra/Types.pm  view on Meta::CPAN

package Cassandra::TokenRange;
BEGIN {
  $Cassandra::TokenRange::VERSION = '0.4.0';
}
use base qw(Class::Accessor);
Cassandra::TokenRange->mk_accessors( qw( start_token end_token endpoints ) );

sub new {
  my $classname = shift;
  my $self      = {};
  my $vals      = shift || {};
  $self->{start_token} = undef;
  $self->{end_token} = undef;
  $self->{endpoints} = undef;
  if (UNIVERSAL::isa($vals,'HASH')) {
    if (defined $vals->{start_token}) {
      $self->{start_token} = $vals->{start_token};
    }
    if (defined $vals->{end_token}) {
      $self->{end_token} = $vals->{end_token};
    }
    if (defined $vals->{endpoints}) {
      $self->{endpoints} = $vals->{endpoints};
    }
  }
  return bless ($self, $classname);
}

lib/Cassandra/Types.pm  view on Meta::CPAN

      }
      last; };
      /^3$/ && do{      if ($ftype == TType::LIST) {
        {
          my $_size35 = 0;
          $self->{endpoints} = [];
          my $_etype38 = 0;
          $xfer += $input->readListBegin(\$_etype38, \$_size35);
          for (my $_i39 = 0; $_i39 < $_size35; ++$_i39)
          {
            my $elem40 = undef;
            $xfer += $input->readString(\$elem40);
            push(@{$self->{endpoints}},$elem40);
          }
          $xfer += $input->readListEnd();
        }
      } else {
        $xfer += $input->skip($ftype);

lib/Cassandra/Types.pm  view on Meta::CPAN

  if (defined $self->{end_token}) {
    $xfer += $output->writeFieldBegin('end_token', TType::STRING, 2);
    $xfer += $output->writeString($self->{end_token});
    $xfer += $output->writeFieldEnd();
  }
  if (defined $self->{endpoints}) {
    $xfer += $output->writeFieldBegin('endpoints', TType::LIST, 3);
    {
      $xfer += $output->writeListBegin(TType::STRING, scalar(@{$self->{endpoints}}));
      {
        foreach my $iter41 (@{$self->{endpoints}}) 
        {
          $xfer += $output->writeString($iter41);
        }
      }
      $xfer += $output->writeListEnd();

 view all matches for this distribution


Catalyst-Action-REST

 view release on metacpan or  search on metacpan

t/catalyst-action-rest-action-dispatch.t  view on Meta::CPAN

# Should use the default serializer, YAML
my $t = Test::Rest->new( 'content_type' => 'text/plain' );

use_ok 'Catalyst::Test', 'Test::Catalyst::Action::REST';

foreach my $endpoint (qw/ test other_test /) {
    foreach my $method (qw(GET DELETE POST PUT OPTIONS)) {
        my $run_method = lc($method);
        my $res;
        if ( grep /$method/, qw(GET DELETE OPTIONS) ) {
            $res = request( $t->$run_method( url => '/actions/' . $endpoint ) );
        }
        else {
            $res = request(
                $t->$run_method(
                    url  => '/actions/' . $endpoint,
                    data => '',
                )
            );
        }
        ok( $res->is_success, "$method request succeeded" ) or warn Dumper($res);

 view all matches for this distribution


Catalyst-ActionRole-DetachOnDie

 view release on metacpan or  search on metacpan

t/lib/Foo/Controller/Root.pm  view on Meta::CPAN

  push @{$c->stash->{body}}, 'explicit_detach';
  $c->res->redirect('/success');
  $c->detach;
}

sub explicit_detach_endpoint : Chained('explicit_detach') PathPart('endpoint') Args(0) {
  my($self, $c) = @_;
  push @{$c->stash->{body}}, 'endpoint';
  return;
}

sub pitch_go : Chained('base') Args(0) ActionClass('DetachOnDie') {
    my ( $self, $c ) = @_;

 view all matches for this distribution


Catalyst-ActionRole-Tabs

 view release on metacpan or  search on metacpan

lib/Catalyst/ActionRole/Tabs.pm  view on Meta::CPAN

  [% END %]
  </ul>

=head1 DESCRIPTION

This module allows to add 'Tab' attributes to action endpoints, and it
will automatically build a data structure suitable for rendering 'tabs'
to switch between the methods that share the same tab structure.

Although this was originally built to help with making tabbed interfaces,
it isn't limited to creating tabs, as it simply collects the information

 view all matches for this distribution


Catalyst-Authentication-Credential-OAuth

 view release on metacpan or  search on metacpan

lib/Catalyst/Authentication/Credential/OAuth.pm  view on Meta::CPAN

    Catalyst::Exception->throw( "Provider is not defined." )
        unless defined $auth_info->{provider} || defined $self->providers->{ $auth_info->{provider} };

    my $provider = $self->providers->{ $auth_info->{provider} };

    for ( qw/ consumer_key consumer_secret request_token_endpoint access_token_endpoint user_auth_endpoint / ) {
        Catalyst::Exception->throw( $_ . " is not defined for provider ". $auth_info->{provider} )
            unless $provider->{$_};
    }

    my %defaults = (

lib/Catalyst/Authentication/Credential/OAuth.pm  view on Meta::CPAN


		my $request = Net::OAuth->request( 'access token' )->new(
			%defaults,
			token => $response->token,
			token_secret => '',
			request_url => $provider->{access_token_endpoint},
			verifier => $c->req->params->{oauth_verifier},
		);
		$request->sign;

		my $ua_response = $self->ua->request( GET $request->to_url );

lib/Catalyst/Authentication/Credential/OAuth.pm  view on Meta::CPAN

		return;
	}
	else {
		my $request = Net::OAuth->request( 'request token' )->new(
			%defaults,
			request_url => $provider->{request_token_endpoint}
		);
		$request->sign;

		my $ua_response = $self->ua->request( GET $request->to_url );

lib/Catalyst/Authentication/Credential/OAuth.pm  view on Meta::CPAN

		$request = Net::OAuth->request( 'user auth' )->new(
			%defaults,
			token => $response->token,
		);

		$c->res->redirect( $request->to_url( $provider->{user_auth_endpoint} ) );
	}

}


lib/Catalyst/Authentication/Credential/OAuth.pm  view on Meta::CPAN

                    class	OAuth
                    <providers>
                        <example.com>
                            consumer_key             my_app_key
                            consumer_secret          my_app_secret
                            request_token_endpoint   http://example.com/oauth/request_token
                            access_token_endpoint    http://example.com/oauth/access_token
                            user_auth_endpoint       http://example.com/oauth/authorize
                        </example.com>
                    </providers>
                </credential>
            </oauth>
        </realms>

 view all matches for this distribution


Catalyst-Authentication-Credential-OpenID

 view release on metacpan or  search on metacpan

t/Consumer/lib/TestApp/Controller/Root.pm  view on Meta::CPAN

              },
              setup_url => $c->uri_for($c->req->path, {moo => "setup"}),
              server_secret => $c->config->{startup_time},
              );

  # From your OpenID server endpoint:

    my ( $type, $data ) = $nos->handle_page;

    if ($type eq "redirect")
    {

 view all matches for this distribution


Catalyst-Controller-DBIC-API

 view release on metacpan or  search on metacpan

lib/Catalyst/Controller/DBIC/API.pm  view on Meta::CPAN

      item_root        => 'data',
      use_json_boolean => 1,
      return_object    => 1,
      );

  # Provides the following functional endpoints:
  # /api/rpc/artist/create
  # /api/rpc/artist/list
  # /api/rpc/artist/id/[id]/delete
  # /api/rpc/artist/id/[id]/update

=head1 DESCRIPTION

Easily provide common API endpoints based on your L<DBIx::Class> schema classes.
Module provides both RPC and REST interfaces to base functionality.
Uses L<Catalyst::Action::Serialize> and L<Catalyst::Action::Deserialize> to
serialize response and/or deserialise request.

=head1 OVERVIEW

This document describes base functionlity such as list, create, delete, update
and the setting of config attributes. L<Catalyst::Controller::DBIC::API::RPC>
and L<Catalyst::Controller::DBIC::API::REST> describe details of provided
endpoints to those base methods.

You will need to create a controller for each schema class you require API
endpoints for. For example if your schema has Artist and Track, and you want to
provide a RESTful interface to these, you should create
MyApp::Controller::API::REST::Artist and MyApp::Controller::API::REST::Track
which both subclass L<Catalyst::Controller::DBIC::API::REST>.
Similarly if you wanted to provide an RPC style interface then subclass
L<Catalyst::Controller::DBIC::API::RPC>. You then configure these individually

lib/Catalyst/Controller/DBIC/API.pm  view on Meta::CPAN


Generally it's better to have one controller for each DBIC source with the
config hardcoded, but in some cases this isn't possible.

Note that the Chained, CaptureArgs and PathPart are just standard Catalyst
configuration parameters and that then endpoint specified in Chained - in this
case '/api/rpc/rpc_base' - must actually exist elsewhere in your application.
See L<Catalyst::DispatchType::Chained> for more details.

Below are explanations for various configuration parameters. Please see
L<Catalyst::Controller::DBIC::API::StaticArguments> for more details.

 view all matches for this distribution


Catalyst-Controller-ElasticSearch

 view release on metacpan or  search on metacpan

lib/Catalyst/Controller/ElasticSearch.pm  view on Meta::CPAN

This controller base class provides some basic protection for your ElasticSearch
server. This will allow you to publish individual indices and types through
your Catalyst application. The controller will prevent malicious requests
such as huge size parameters or scripts.

ElasticSearch's C<_search> endpoint is very powerful. And with power comes great
responsibility. Instead of providing the vanilla search endpoint, it is recommeded
that you predefine searches that process only certain parameters. See L</DISABLING FEATURES>.

B<< Exposing ElasticSearch to the Internet is dangerous. MetaCPAN is doing it, 
and this module is the result of what we've learned so far. >>

lib/Catalyst/Controller/ElasticSearch.pm  view on Meta::CPAN

    } or do { $c->detach("error", [500, $@]) };
 }

=head1 ENDPOINTS

By default, this controller will create the following endpoints for a controller
named C<MyApp::Controller::Tweet>.

=head2 mapping

  /twitter/tweet/_mapping

lib/Catalyst/Controller/ElasticSearch.pm  view on Meta::CPAN


=head2 all

 /twitter/tweet

This endpoint is equivalent to C</tweet/_search?q=*>.

=head2 search

 /twitter/tweet/_search

This endpoint proxies to the search endpoint of ElasticSearch. However, it will
sanitize the query first.

=head1 ACCESS CONTROL

As with other controllers, you would do the access control in the C<auto>

 view all matches for this distribution


Catalyst-Controller-FlashRemoting

 view release on metacpan or  search on metacpan

lib/Catalyst/Controller/FlashRemoting.pm  view on Meta::CPAN


Flash Remoting is RPC subsystem and that use AMF (Action Message Format) as message body format.

=head1 USAGE

At first, you need api gateway (endpoint) controller. Add AMFGateway attribute to catalyst action for that.

    sub gateway :Local :AMFGateway { }

If you write above code in Root controller, then 'http://localhost:3000/gateway' is AMF Gateway url.

 view all matches for this distribution


Catalyst-Controller-SOAP

 view release on metacpan or  search on metacpan

lib/Catalyst/Action/SOAP/DocumentLiteralWrapped.pm  view on Meta::CPAN


 __PACKAGE__->{config}{soap_action_prefix} = 'http://foo/bar/';

 use base 'Catalyst::Controller::SOAP::DocumentLiteralWrapped';
 # or
 sub endpoint : Local ActionClass(SOAP::DocumentLiteralWrapped) { }

=head1 DESCRIPTION

Microsoft has defined a pseudo-standard for SOAP usage called
Document/Literal Wrapped. This standard is a deviation of both the

 view all matches for this distribution


Catalyst-ControllerPerContext

 view release on metacpan or  search on metacpan

lib/Catalyst/ControllerRole/URI.pm  view on Meta::CPAN


after 'register_action_methods', sub {
  my ( $self, $app, @methods ) = @_;
  my $class = ref $self;

  my @endpoints = ();
  my @types = @{ $app->dispatcher->dispatch_types ||+[] };
  foreach my $type (@types) {  
    if(ref($type) eq 'Catalyst::DispatchType::Chained') {
      foreach my $endpoint(@{ $type->{_endpoints} || [] }) {
        if ($endpoint->class eq $class) {
          push @endpoints, [$endpoint, $self->_generate_uri_pattern($type, $endpoint)];
        }
      }
    }
  }

lib/Catalyst/ControllerRole/URI.pm  view on Meta::CPAN

  my $col2_width = $avail_width - $col1_width;
  my $paths = Text::SimpleTable->new(
    [ $col1_width, 'uri' ], [ $col2_width, 'helper' ],
  );

  foreach my $endpoint_proto (@endpoints) {
    my $endpoint = $endpoint_proto->[0];
    my $uri = $endpoint_proto->[1];
    my $path_args = '';
    my $path_arg_count = 0;
    if(my @path_args = @{$endpoint_proto->[2]||[]}) {
      $path_arg_count = scalar(@path_args);
      $path_args = join ',', @path_args if scalar(@path_args) > 0;
      $path_args = "([$path_args])";
    }
    my $name = $endpoint->name;
    my $private_path = $endpoint->private_path; $private_path =~s/^\///; $private_path =~s/\//_/g;
    my $sub = sub {
      my $self = shift;
      my ($parts, @args) = $self->_normalize_uri_args(@_);  
      return $self->ctx->uri_for($self->action_for($name), $parts, @args);
    };

lib/Catalyst/ControllerRole/URI.pm  view on Meta::CPAN

    {
      no strict 'refs';
      my $controller_helper = "${class}::${name}_uri";
      *{$controller_helper} = Sub::Util::set_subname $controller_helper => $sub;
      my $app_helper = "${app}::${private_path}_uri";
      my $helper = $endpoint->private_path;
      *{$app_helper} = Sub::Util::set_subname $app_helper => sub {
        my $c = shift;
        return $c->uri_for($c->dispatcher->get_action_by_path($helper), @_);
      };
    }

lib/Catalyst/ControllerRole/URI.pm  view on Meta::CPAN


  $app->log->debug("URI Helpers for: $class\n" . $paths->draw . "\n");
};

sub _generate_uri_pattern {
  my ($self, $dispatcher, $endpoint) = @_;
  my $args = $endpoint->list_extra_info->{Args};

  my @parts;
  if($endpoint->has_args_constraints) {
      @parts = map { "{$_}" } $endpoint->all_args_constraints;
  } elsif(defined $endpoint->attributes->{Args}) {
      @parts = (defined($endpoint->attributes->{Args}[0]) ? (("*") x $args) : '...');
  }

  my @parents = ();
  my $parent = "DUMMY";
  my $extra  = $dispatcher->_list_extra_http_methods($endpoint);
  my $consumes = $dispatcher->_list_extra_consumes($endpoint);
  my $scheme = $dispatcher->_list_extra_scheme($endpoint);
  my $curr = $endpoint;
  while ($curr) {
      if (my $cap = $curr->list_extra_info->{CaptureArgs}) {
          if($curr->has_captures_constraints) {
              my $names = join '/', map { "{$_}" } $curr->all_captures_constraints;
              unshift(@parts, $names);

 view all matches for this distribution


Catalyst-ControllerRole-At

 view release on metacpan or  search on metacpan

t/at.t  view on Meta::CPAN


extends 'Catalyst::Controller';

sub root :At($controller/...) { }

  sub endpoint :Via(root) At({id}) {
    my ($self, $c, $id) = @_;
  }

  sub endpoin2 :Under(root) At({id}/{@}) {
    my ($self, $c, @args) = @_;

t/at.t  view on Meta::CPAN


extends 'Catalyst::Controller';

sub root Chained(/) PathPrefix CaptureArgs(0) { }

  sub endpoint :Chained(root) PathPrefix('') Args(1) {
    my ($self, $c, $id) = @_;
  }

  sub endpoin2 :Chained(root) PathPrefix('') Args {
    my ($self, $c, @args) = @_;

 view all matches for this distribution


Catalyst-Engine-Apache

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') {
    my ( $self, $c, @args ) = @_;
    die "missing argument" unless @args;
    die "more than 1 argument" if @args > 1;
}
sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }

#
#   Parent/child test with two args each
#
sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }

#
#   Relative specification of parent action
#
sub bar :PathPart('chained/bar') :Chained('/') :CaptureArgs(0) { }
sub finale :PathPart('') :Chained('bar') :Args { }

#
#   three chain with concurrent endpoints
#
sub one   :PathPart('chained/one') :Chained('/')                   :CaptureArgs(1) { }
sub two   :PathPart('two')         :Chained('/action/chained/one') :CaptureArgs(2) { }
sub three_end :PathPart('three')       :Chained('two') :Args(3) { }
sub one_end   :PathPart('chained/one') :Chained('/')   :Args(1) { }

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

sub priority_c2 :PathPart('') :Chained('priority_c1') { }
sub priority_c2_xyz :PathPart('xyz') :Chained('priority_c1')  { }


#
#   Optional specification of :Args in endpoint
#
sub opt_args :PathPart('chained/opt_args') :Chained('/') { }

#
#   Optional PathPart test -> /chained/optpp/*/opt_pathpart/*

 view all matches for this distribution


Catalyst-Engine-HTTP-POE

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN


#
#   Simple parent/child action test
#
sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') { }
sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }

#
#   Parent/child test with two args each
#
sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }

#
#   Relative specification of parent action
#
sub bar :PathPart('chained/bar') :Chained('/') :CaptureArgs(0) { }
sub finale :PathPart('') :Chained('bar') :Args { }

#
#   three chain with concurrent endpoints
#
sub one   :PathPart('chained/one') :Chained('/')                   :CaptureArgs(1) { }
sub two   :PathPart('two')         :Chained('/action/chained/one') :CaptureArgs(2) { }
sub three_end :PathPart('three')       :Chained('two') :Args(3) { }
sub one_end   :PathPart('chained/one') :Chained('/')   :Args(1) { }

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

sub priority_c2 :PathPart('') :Chained('priority_c1') { }
sub priority_c2_xyz :PathPart('xyz') :Chained('priority_c1')  { }


#
#   Optional specification of :Args in endpoint
#
sub opt_args :PathPart('chained/opt_args') :Chained('/') { }

#
#   Optional PathPart test -> /chained/optpp/*/opt_pathpart/*

 view all matches for this distribution


Catalyst-Engine-HTTP-Prefork

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN


#
#   Simple parent/child action test
#
sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') { }
sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }

#
#   Parent/child test with two args each
#
sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }

#
#   Relative specification of parent action
#
sub bar :PathPart('chained/bar') :Chained('/') :CaptureArgs(0) { }
sub finale :PathPart('') :Chained('bar') :Args { }

#
#   three chain with concurrent endpoints
#
sub one   :PathPart('chained/one') :Chained('/')                   :CaptureArgs(1) { }
sub two   :PathPart('two')         :Chained('/action/chained/one') :CaptureArgs(2) { }
sub three_end :PathPart('three')       :Chained('two') :Args(3) { }
sub one_end   :PathPart('chained/one') :Chained('/')   :Args(1) { }

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

sub priority_c2 :PathPart('') :Chained('priority_c1') { }
sub priority_c2_xyz :PathPart('xyz') :Chained('priority_c1')  { }


#
#   Optional specification of :Args in endpoint
#
sub opt_args :PathPart('chained/opt_args') :Chained('/') { }

#
#   Optional PathPart test -> /chained/optpp/*/opt_pathpart/*

 view all matches for this distribution


Catalyst-Manual

 view release on metacpan or  search on metacpan

lib/Catalyst/Manual/Cookbook.pod  view on Meta::CPAN

        $c->stash->{track} = $self->stash->{cd}->find_track_by_vol_and_track_no(
            $c->stash->{volume}, $track_no
        );
    }

Note that adding other actions (i.e. chain endpoints) which operate on a track
is simply a matter of adding a new sub to CD::Controller - no code is duplicated,
even though there are two different methods of looking up a track.

This technique can be expanded as needed to fulfil your requirements - for example,
if you inherit the first action of a chain from a base class, then mixing in a

 view all matches for this distribution


Catalyst-Model-Bitcoin

 view release on metacpan or  search on metacpan

lib/Catalyst/Model/Bitcoin.pm  view on Meta::CPAN

  my ($c, $arg_ref) = @_;

  croak "->config->{uri} must be set for $class\n"
    unless $self->{uri};

  $self->api( Finance::Bitcoin::API->new( endpoint => $self->{uri} ) );
  $self->wallet( Finance::Bitcoin::Wallet->new( $self->api ) );

  return $self;
}

 view all matches for this distribution


Catalyst-Model-JabberRPC

 view release on metacpan or  search on metacpan

lib/Catalyst/Helper/Model/JabberRPC.pm  view on Meta::CPAN


The same as the B<identauth> arg. passed to L<Jabber::RPC::Client>.

=item * C<jrpc.myserver.org/rpc-server>

The same as the B<endpoint> arg. passed to L<Jabber::RPC::Client>.

=back

=head1 METHODS

lib/Catalyst/Helper/Model/JabberRPC.pm  view on Meta::CPAN

Makes the JabberRPC model class.

=cut

sub mk_compclass {
    my ($self, $helper, $server, $identauth, $endpoint) = @_;

    $helper->{server} = $server || '';
    $helper->{identauth} = $identauth || '';
    $helper->{endpoint} = $endpoint || '';

    $helper->render_file('modelclass', $helper->{file});

    return 1;
}

lib/Catalyst/Helper/Model/JabberRPC.pm  view on Meta::CPAN

use base 'Catalyst::Model::JabberRPC';

__PACKAGE__->config(
    server => '[% server %]',
    identauth => '[% identauth %]',
    endpoint => '[% endpoint %]',
    # For more options take a look at L<Jabber::RPC::Client>.
);

=head1 NAME

 view all matches for this distribution


Catalyst-Plugin-ActionPaths

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/ActionPaths.pm  view on Meta::CPAN

      }
    }
    elsif (ref $dt eq 'Catalyst::DispatchType::Chained')
    {
      # taken from Catalyst::DispatchType::Chained
      ENDPOINT: foreach my $endpoint (
                    sort { $a->reverse cmp $b->reverse }
                             @{ $dt->_endpoints }
                    ) {
          my $args = $endpoint->list_extra_info->{Args};
          my @parts = (defined($endpoint->attributes->{Args}[0]) ? (("*") x $args) : '...');
          my @parents = ();
          my $parent = "DUMMY";
          my $extra  = $dt->_list_extra_http_methods($endpoint);
          my $consumes = $dt->_list_extra_consumes($endpoint);
          my $scheme = $dt->_list_extra_scheme($endpoint);
          my $curr = $endpoint;
          my $action = $endpoint;
          while ($curr) {
              if (my $cap = $curr->list_extra_info->{CaptureArgs}) {
                  unshift(@parts, (("*") x $cap));
              }
              if (my $pp = $curr->attributes->{PathPart}) {

lib/Catalyst/Plugin/ActionPaths.pm  view on Meta::CPAN

                  $name = "-> ${name}";
              }
              push(@rows, [ '', $name ]);
          }

          if($endpoint->has_args_constraints) {
            my $tc = join ',', @{$endpoint->args_constraints};
            $endpoint .= " ($tc)";
          } else {
            $endpoint .= defined($endpoint->attributes->{Args}[0]) ? " ($args)" : " (...)";
          }
          push(@rows, [ '', (@rows ? "=> " : '').($extra ? "$extra " : ''). ($scheme ? "$scheme: ":'')."/${endpoint}". ($consumes ? " :$consumes":"" ) ]);
          my @display_parts = map { $_ =~s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; decode_utf8 $_ } @parts;
          $rows[0][0] = join('/', '', @display_parts) || '/';
          $action->{path} = $rows[0][0];
          push @actions, $action;
      }

 view all matches for this distribution


Catalyst-Plugin-AutoCRUD

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


libcatalyst-plugin-autocrud-perl (0.71_02) UNRELEASED; urgency=low

  * Rename all uses of lf to cpac (legacy ListFramework references)
  * Make stash use much more polite - use cpac_* namespacing
  * Add dumpmeta_html endpoint which dumps metadata to HTML
  * Support for dispatched storage backends via site_conf backend
  * Add http_charset param to override the (new) default of utf-8
  * Filter output for HTML entities in skinny frontnend
  * DBIC ResultSource::View results in a CUD operations being disabled
  * [temporary] fix for rt.cpan #56250 Views have no primary key(s)

 view all matches for this distribution


Catalyst-Plugin-CSRFToken

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/CSRFToken.pm  view on Meta::CPAN

    integrity="sha384-..."
    crossorigin="anonymous"
  ></script>
  <script>
    $.ajax({
      url: '/some/endpoint',
      type: 'POST',
      headers: {
        'X-CSRF-Token': '[% c.csrf_token(form_id=>"your_form_id") %]'
      },
      data: {

 view all matches for this distribution


Catalyst-Plugin-CachedUriForAction

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Action/Chained.pm  view on Meta::CPAN

#
#   Simple parent/child action test
#
sub foo  :PathPart('chained/foo')  :CaptureArgs(1) :Chained('/') {
}
sub endpoint  :PathPart('end')  :Chained('/action/chained/foo')  :Args(1) { }

#
#   Parent/child test with two args each
#
sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }

#
#   three chain with concurrent endpoints
#
sub one   :PathPart('chained/one') :Chained('/')                   :CaptureArgs(1) { }
sub two   :PathPart('two')         :Chained('/action/chained/one') :CaptureArgs(2) { }
sub three_end :PathPart('three')       :Chained('two') :Args(3) { }

 view all matches for this distribution


( run in 1.905 second using v1.01-cache-2.11-cpan-524268b4103 )