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


Catalyst-Controller-Mobile-JP

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Controller-RequestToken

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

		- made more flexible configuration (thx to masaki)
0.03	Wed Nov  6 18:00:32 JST 2008
		- modified Changes
0.02	Fri Jun  6 11:37:31 JST 2008
		- fully refactored
		- weaken context (thx to typester)
0.01	Thu Jun  5  0:32:10 JST 2008
		- first release

 view all matches for this distribution


Catalyst-Controller-WrapCGI

 view release on metacpan or  search on metacpan

lib/CatalystX/GlobalContext.pm  view on Meta::CPAN

$CatalystX::GlobalContext::VERSION = '0.039';
use strict;
use warnings;
use parent 'Exporter';

use Scalar::Util 'weaken';

use vars '$c';
our @EXPORT_OK = '$c';

=head1 NAME

lib/CatalystX/GlobalContext.pm  view on Meta::CPAN


=head1 CLASS METHODS

=head2 CatalystX::GlobalContext->set_context($c)

Saves a weakened reference to the Catalyst context,
which is accessible from other modules as an export.

=cut

sub set_context {
    $c = $_[1];
    weaken $c;
}

=head1 SEE ALSO

L<Catalyst::Controller::CGIBin>, L<Catalyst::Controller::WrapCGI>,

 view all matches for this distribution


Catalyst-DispatchType-Regex

 view release on metacpan or  search on metacpan

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN


use strict;
use base 'Catalyst::View';

use Data::Dumper ();
use Scalar::Util qw(blessed weaken);

sub dump {
    my ( $self, $reference, $purity ) = @_;

    return unless $reference;

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN

        $c->res->output($output);

        if ($context) {
            # Repair context
            $reference->{_context} = $context;
            weaken( $reference->{_context} );
        }

        if ($body) {
            # Repair body
            delete $reference->{__body_type};

 view all matches for this distribution


Catalyst-Engine-Apache

 view release on metacpan or  search on metacpan

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN


use strict;
use base 'Catalyst::View';

use Data::Dumper ();
use Scalar::Util qw(blessed weaken);

sub dump {
    my ( $self, $reference ) = @_;

    return unless $reference;

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN

        $c->res->output($output);

        if ($context) {
            # Repair context
            $reference->{_context} = $context;
            weaken( $reference->{_context} );
        }

        if ($body) {
            # Repair body
            delete $reference->{__body_type};

 view all matches for this distribution


Catalyst-Engine-HTTP-POE

 view release on metacpan or  search on metacpan

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN


use strict;
use base 'Catalyst::Base';

use Data::Dumper ();
use Scalar::Util qw(weaken);

sub dump {
    my ( $self, $reference ) = @_;

    return unless $reference;

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN

        $c->res->headers->content_type('text/plain');
        $c->res->output($output);

        # Repair context
        $reference->{_context} = $context;
        weaken( $reference->{_context} );

        # Repair body
        $reference->{_body} = $body;

        return 1;

 view all matches for this distribution


Catalyst-Engine-HTTP-Prefork

 view release on metacpan or  search on metacpan

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN


use strict;
use base 'Catalyst::Base';

use Data::Dumper ();
use Scalar::Util qw(weaken);

sub dump {
    my ( $self, $reference ) = @_;

    return unless $reference;

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN

        $c->res->headers->content_type('text/plain');
        $c->res->output($output);

        # Repair context
        $reference->{_context} = $context;
        weaken( $reference->{_context} );

        # Repair body
        $reference->{_body} = $body;

        return 1;

 view all matches for this distribution


Catalyst-Helper-FastCGI-ExternalServer

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Manual

 view release on metacpan or  search on metacpan

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


      if ( my $per_request = $c->my_model_instance ) {
        return $per_request;
      } else {
        my $new_instance = bless { %$self, c => $c }, ref($self);
        Scalar::Util::weaken($new_instance->{c}); # or we have a circular reference
        $c->my_model_instance( $new_instance );
        return $new_instance;
      }
    }

 view all matches for this distribution


Catalyst-Model-FormFu

 view release on metacpan or  search on metacpan

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


use strict;
use warnings;
use HTML::FormFu;
use HTML::FormFu::Library;
use Scalar::Util qw(weaken);
use Moose;
use namespace::clean -except => 'meta';

extends 'Catalyst::Model';
with 'Catalyst::Component::InstancePerContext';

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

    $args{cache} = $self->cache;
    $args{query} = $c->request;

    ### stash
    $args{stash}{$self->context_stash} = $c;
    weaken $args{stash}{$self->context_stash};
    $args{stash}{schema} = $c->model($self->model_stash->{schema}) if $self->model_stash;

    ### config_callback
    $args{config_callback}{plain_value} = sub
    {

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

    $form->action = /foo/bar/1

=item context_stash

To allow your form validation packages, etc, access to the catalyst context,
a weakened reference of the context is copied into the form's stash.

    $form->stash->{context};

This setting allows you to change the key name used in the form stash.

 view all matches for this distribution


Catalyst-Model-KiokuDB

 view release on metacpan or  search on metacpan

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

package Catalyst::Model::KiokuDB;
use Moose;

use KiokuX::Model;
use Scope::Guard;
use Scalar::Util qw(weaken);
use overload ();
use Hash::Util::FieldHash::Compat qw(fieldhash);
use Carp;

sub format_table;

 view all matches for this distribution


Catalyst-Model-MenuGrinder

 view release on metacpan or  search on metacpan

lib/Catalyst/Model/MenuGrinder/Menu.pm  view on Meta::CPAN


use Moose;

extends 'WWW::MenuGrinder';

use Scalar::Util qw(weaken);

has '_c' => (
  is => 'rw',
);

lib/Catalyst/Model/MenuGrinder/Menu.pm  view on Meta::CPAN


sub _accept_context {
  my ($self, $c) = @_;

  $self->_c($c);
  weaken($self->_c);

  $self->menu_vars( $self->_get_all_vars );
}

no Moose;

 view all matches for this distribution


Catalyst-Model-MogileFS-Client

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Model-MultiAdaptor

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Plugin-Authentication-Basic-Remote

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Plugin-Authentication-Credential-AOL

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Plugin-Authentication-Credential-OpenID

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Plugin-AutoCRUD

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/AutoCRUD/Controller/Root.pm  view on Meta::CPAN


use base 'Catalyst::Controller';
use Catalyst::Utils;
use SQL::Translator::AutoCRUD::Quick;
use File::Basename;
use Scalar::Util 'weaken';
use List::Util 'first';

__PACKAGE__->mk_classdata(_site_conf_cache => {});

# the templates are squirreled away in ../templates

lib/Catalyst/Plugin/AutoCRUD/Controller/Root.pm  view on Meta::CPAN

    # set up helper variables for templates
    $c->stash->{cpac_db} = $db;
    $c->stash->{cpac_table} = $table;
    $c->stash->{cpac}->{tm} = $c->stash->{cpac}->{m}->t->{$table};
    $c->stash->{cpac}->{tc} = $c->stash->{cpac}->{c}->{$db}->{t}->{$table};
    weaken $c->stash->{cpac}->{tm};
    weaken $c->stash->{cpac}->{tc};
}

sub helloworld : Chained('base') Args(0) {
    my ($self, $c) = @_;
    $c->forward('build_site_config');

 view all matches for this distribution


Catalyst-Plugin-Cache

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/Cache/Curried.pm  view on Meta::CPAN

    my $self = $class->SUPER::new({
        c    => $c,
        meta => \@meta,
    });

    Scalar::Util::weaken( $self->{c} )
        if ref( $self->{c} );

    return $self;
}

 view all matches for this distribution


Catalyst-Plugin-DoCoMoUID

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Plugin-Form-Processor

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/Form/Processor.pm  view on Meta::CPAN

    }

    $args{user_data}{context} = $c;

    # Since $c holds a reference to the form and the form holds
    # a reference to the context must weaken.
    Scalar::Util::weaken( $args{user_data}{context} );


    return $c->stash->{form} = $package->new( %args );

} ## end sub form

 view all matches for this distribution


Catalyst-Plugin-FormValidator-Simple-Auto

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Plugin-FormValidator-Simple-Messages

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Plugin-HashedCookies

 view release on metacpan or  search on metacpan

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

package PluginTestApp::Controller::Root;

use base 'Catalyst::Controller';
use Data::Dumper ();
use Scalar::Util qw(weaken);

sub auto : Private {
    my ( $self, $c ) = @_;

    $c->stash->{'cookies'} = {

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

    $c->response->header( 'X-Catalyst-Plugins' => [$c->registered_plugins] );
    $c->res->headers->content_type('text/plain');
    $c->res->output($output);

    $reference->{_context} = $context;
    weaken( $reference->{_context} );
    $reference->{_body} = $body;
}

1;

 view all matches for this distribution


Catalyst-Plugin-I18N-Request

 view release on metacpan or  search on metacpan

lib/Catalyst/Plugin/I18N/Request.pm  view on Meta::CPAN

sub prepare {
    my $c = shift;
    $c = $c->next::method( @_ );

    unless( $c->request->{ _context } ) {
        Scalar::Util::weaken( $c->request->{ _context } = $c );
    }

    return $c;
}

 view all matches for this distribution


Catalyst-Plugin-LeakTracker

 view release on metacpan or  search on metacpan

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

use strict;
use warnings;

__PACKAGE__->config(namespace => q{});

use Scalar::Util qw/weaken/;

use base 'Catalyst::Controller';

# your actions replace this one
sub main :Path {

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

    $object->{foo}{self} = $object;


    my $object2 = bless {}, "class::b";
    $object2->{foo}{self} = $object2;
    weaken($object2->{foo}{self});

    my $object3 = bless [], "class::c";
    push @$object3,  $object3;

    $c->res->body("it leaks");

 view all matches for this distribution


Catalyst-Plugin-MobileUserID

 view release on metacpan or  search on metacpan

inc/Spiffy.pm  view on Meta::CPAN

      "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .
      "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    weak_init =>
      "  return do {\n" .
      "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .
      "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .
      "    \$_[0]->{%s};\n" .
      "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",
    return_if_get => 
      "  return \$_[0]->{%s} unless \$#_ > 0;\n",
    set => 
      "  \$_[0]->{%s} = \$_[1];\n",
    weaken => 
      "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",
    sub_end => 
      "  return \$_[0]->{%s};\n}\n",
);

sub field {

inc/Spiffy.pm  view on Meta::CPAN

        local *paired_arguments = sub { (qw(-package -init)) };
        Spiffy->parse_arguments(@_);
    };
    my ($field, $default) = @values;
    $package = $args->{-package} if defined $args->{-package};
    die "Cannot have a default for a weakened field ($field)"
        if defined $default && $args->{-weak};
    return if defined &{"${package}::$field"};
    require Scalar::Util if $args->{-weak};
    my $default_string =
        ( ref($default) eq 'ARRAY' and not @$default )

inc/Spiffy.pm  view on Meta::CPAN

    }
    $code .= sprintf $code{set_default}, $field, $default_string, $field
      if defined $default;
    $code .= sprintf $code{return_if_get}, $field;
    $code .= sprintf $code{set}, $field;
    $code .= sprintf $code{weaken}, $field, $field 
      if $args->{-weak};
    $code .= sprintf $code{sub_end}, $field;

    my $sub = eval $code;
    die $@ if $@;

 view all matches for this distribution


Catalyst-Plugin-Singleton

 view release on metacpan or  search on metacpan

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

    my $class   = shift;
    my $context = $class->next::method(@_);

    {
        no strict 'refs';
        Scalar::Util::weaken( ${"$class\::_instance"} = $context );
    }

    return $context;
}

 view all matches for this distribution


Catalyst-Plugin-SmartURI

 view release on metacpan or  search on metacpan

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

use Moose;
use mro 'c3';

use 5.008001;
use Class::C3::Componentised;
use Scalar::Util 'weaken';
use Catalyst::Exception ();
use Class::Load ();

use namespace::clean -except => 'meta';

has uri_disposition => (is => 'rw', isa => 'Str');
has uri_class       => (is => 'rw', isa => 'Str');

my $context; # keep a weakend copy for the Request class to use

my ($conf_disposition, $conf_uri_class); # configured values

=head1 NAME

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

sub prepare {
    my $app = shift;

# Also save a copy of the context for the Request class to use.
    my $c = $context = $app->next::method(@_);
    weaken $context;

    $c->uri_class($conf_uri_class);
    $c->uri_disposition($conf_disposition);

    $c

 view all matches for this distribution


Catalyst-Plugin-URLMap

 view release on metacpan or  search on metacpan

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


use Moose::Role;
use namespace::autoclean;
use Plack::Util;
use Plack::App::URLMap;
use Scalar::Util 'blessed', 'weaken';
use Catalyst::Utils;
use Text::SimpleTable;

our $VERSION = '0.002';

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

  } else {
    die ref($app). " is not a plack compatible application";
  }
};

my ($do_mapping, $weakened_do_mapping);
$do_mapping = $weakened_do_mapping = sub {
  my ($psgi_app, $t, $root, %maps) = @_;

  foreach my $url_part (keys %maps) {
    my $target = $maps{$url_part};
    my $map_url = join ('', $root, $url_part);

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

      $psgi_app->map($url_part, $from_plack_app->($target));
      $t->row($map_url, ref $target);
    } elsif(ref $target eq 'HASH') {
      if( (%$target)[0] =~m/^\//) {
        my $localmap = Plack::App::URLMap->new;
        weaken $weakened_do_mapping;
        $localmap = $weakened_do_mapping->($localmap, $t, $map_url, %$target);
        $psgi_app->map($url_part, $localmap->to_app);
      } else {
        my ($module, $args) = %{$target};
        my $normalized_module = Plack::Util::load_class($module, 'Plack::App');
        $psgi_app->map($url_part, $from_plack_app->($normalized_module->new(%$args)));

 view all matches for this distribution


( run in 0.615 second using v1.01-cache-2.11-cpan-65fba6d93b7 )