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
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
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
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
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
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
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
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
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
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
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
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
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
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
view release on metacpan or search on metacpan
lib/Catalyst.pm view on Meta::CPAN
}
};
$c->log_request;
$c->{stash} = $c->stash;
Scalar::Util::weaken($c->{stash});
return $c;
}
=head2 $c->prepare_action
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/ActionRole/ProvidesMedia.pm view on Meta::CPAN
}
sub forwards {
my ($self, $ctx) = @_;
Scalar::Util::weaken($ctx);
my %media_actions = %{$self->media_actions};
unless(exists $media_actions{no_match}) {
$media_actions{no_match} = sub {
my ($req, %callbacks) = @_;
$ctx->res->status(406);
view all matches for this distribution
view release on metacpan or search on metacpan
- Plugins which are used now generate an instance for each plugin
which is subsequently cached.
- Fix useage of namespace::clean
- Proper test application bundled with the distribution.
- Proper tests for all engines in the distribution.
- Use Catalyst::Component::ContextClosure instead of weakening
the context manually.
- Make pod tests only run in author mode.
- General code cleanup.
0.07 Mon Jul 27 20:45:42 2009
view all matches for this distribution
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
view release on metacpan or search on metacpan
lib/Catalyst/View/Markdown.pm view on Meta::CPAN
use base qw/Catalyst::View/;
use Text::Markdown;
use File::Find;
use MRO::Compat;
use Scalar::Util qw/blessed weaken/;
our $VERSION = '0.01';
$VERSION = eval $VERSION;
__PACKAGE__->mk_accessors('markdown_filename');
lib/Catalyst/View/Markdown.pm view on Meta::CPAN
# Creation of template outside of call to new so that we can pass [ $self ]
# as INCLUDE_PATH config item, which then gets ->paths() called to get list
# of include paths to search for templates.
# Use a weakend copy of self so we dont have loops preventing GC from working
my $copy = $self;
Scalar::Util::weaken($copy);
$config->{INCLUDE_PATH} = [ sub { $copy->paths } ];
$self->{markdown} =
$config->{CLASS}->new($config) || do {
my $error = $config->{CLASS}->error();
view all matches for this distribution
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
view release on metacpan or search on metacpan
t/08cycle.t view on Meta::CPAN
# as a cycle, but the above does prevent it getting garbage collected.
#
# memory_cycle_ok($view, 'No cycles in View');
$copy = $view;
Scalar::Util::weaken($copy);
}
ok(!defined $copy, 'Copy went out of scope');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/View/TT/Alloy.pm view on Meta::CPAN
use parent qw( Catalyst::View );
use Carp qw( croak );
use Data::Dump qw( dump );
use Path::Class;
use Scalar::Util qw( weaken blessed );
use Template::Alloy qw( Compile Parse TT );
__PACKAGE__->mk_accessors('template');
__PACKAGE__->mk_accessors('include_path');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/View/TT/FunctionGenerator.pm view on Meta::CPAN
use strict;
use warnings;
use Catalyst::Utils ();
use Class::Inspector ();
use Scalar::Util qw/weaken/;
use Carp ();
our $VERSION = "0.02";
__PACKAGE__->mk_accessors(qw/context/);
lib/Catalyst/View/TT/FunctionGenerator.pm view on Meta::CPAN
} else {
$meths = [ $meths, @{ Class::Inspector->methods( ( ref $meths || $meths ), 'public' ) || Carp::croak("$meths has no methods") } ];
}
# if there is a closure with $c in it, and it's saved inside $c we have a circular referrence
weaken($meths->[0]) if ( $meths->[0] == $c );
$meths;
} @objects;
}
lib/Catalyst/View/TT/FunctionGenerator.pm view on Meta::CPAN
return (
$self->NEXT::template_vars( $c ),
map {
my ( $obj, @methods ) = @$_;
weaken( $obj ) if ( $obj == $c );
#see above
map { my $method = $_; $method => sub { $obj->$method(@_) } } @methods;
}
@{ $c->{_evil_function_generator_data}{ref $self} || [] }
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/View/TT.pm view on Meta::CPAN
use base qw/Catalyst::View/;
use Data::Dump 'dump';
use Template;
use Template::Timer;
use MRO::Compat;
use Scalar::Util qw/blessed weaken/;
our $VERSION = '0.46';
$VERSION =~ tr/_//d;
__PACKAGE__->mk_accessors('template');
lib/Catalyst/View/TT.pm view on Meta::CPAN
# Creation of template outside of call to new so that we can pass [ $self ]
# as INCLUDE_PATH config item, which then gets ->paths() called to get list
# of include paths to search for templates.
# Use a weakened copy of self so we don't have loops preventing GC from working
my $copy = $self;
Scalar::Util::weaken($copy);
$config->{INCLUDE_PATH} = [ sub { $copy->paths } ];
if ( $config->{PROVIDERS} ) {
my @providers = ();
if ( ref($config->{PROVIDERS}) eq 'ARRAY') {
lib/Catalyst/View/TT.pm view on Meta::CPAN
unless ($method) {
Catalyst::Exception->throw( "$method_name not found in TT view" );
}
my $method_body = $method->body;
my $weak_ctx = $c;
weaken $weak_ctx;
my $sub = sub {
my @args = @_;
my $ret;
eval {
$ret = $self->$method_body($weak_ctx, @args);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/View/Template/Pure.pm view on Meta::CPAN
use strict;
use warnings;
package Catalyst::View::Template::Pure;
use Scalar::Util qw/blessed refaddr weaken/;
use Catalyst::Utils;
use HTTP::Status ();
use File::Spec;
use Mojo::DOM58;
use Template::Pure::ParseUtils;
lib/Catalyst/View/Template/Pure.pm view on Meta::CPAN
my $key = blessed($self) ? refaddr($self) : $self;
my $stash_key = "__Pure_${key}";
delete $c->stash->{$stash_key} if delete($args{clear_stash});
weaken $c;
$c->stash->{$stash_key} ||= do {
if($proto) {
foreach my $field (@fields) {
if(ref $proto eq 'HASH') {
lib/Catalyst/View/Template/Pure.pm view on Meta::CPAN
%{$args},
%{$c->stash},
ctx => $c,
);
weaken(my $weak_view = $view);
my $pure = $pure_class->new(
template => $template,
directives => $directives,
filters => $filters,
components => $self->build_comp_hash($c, $view),
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/View/Xslate.pm view on Meta::CPAN
use Moose;
use Moose::Util::TypeConstraints qw(coerce from where via subtype);
use Encode;
use Text::Xslate;
use namespace::autoclean;
use Scalar::Util qw/blessed weaken/;
use File::Find ();
our $VERSION = '0.00019';
extends 'Catalyst::View';
lib/Catalyst/View/Xslate.pm view on Meta::CPAN
}
sub build_exposed_method {
my ( $self, $ctx, $code ) = @_;
my $weak_ctx = $ctx;
weaken $weak_ctx;
return sub { $self->$code($weak_ctx, @_) };
}
sub render {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CatalystX/CRUD/ModelAdapter/DBIC.pm view on Meta::CPAN
CatalystX::CRUD::ModelAdapter
CatalystX::CRUD::Model::Utils
);
use MRO::Compat;
use mro 'c3';
use Scalar::Util qw( weaken );
use Carp;
use Data::Dump qw( dump );
use Sort::SQL;
__PACKAGE__->mk_ro_accessors(qw( treat_like_int ));
lib/CatalystX/CRUD/ModelAdapter/DBIC.pm view on Meta::CPAN
my $c = shift;
my $field_names = shift;
# Model::Utils (make_sql_query) assumes ACCEPT_CONTEXT accessor
$self->{context} = $c;
weaken( $self->{context} );
my $q = $self->next::method($field_names);
#carp "make_sql_query : " . dump $q;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CatalystX/Crudite/Util/Random.pm view on Meta::CPAN
ways
wayside
wayward
we
weak
weaken
weakened
weakening
weakens
weaker
weakest
weakly
weakness
weaknesses
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CatalystX/Controller/ExtJS/REST.pm view on Meta::CPAN
$form->populate($config);
}
# 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.
my $context_stash = $self->_extjs_config->{context_stash};
$form->stash->{$context_stash} = $c;
Scalar::Util::weaken( $form->stash->{$context_stash} );
return $form;
}
sub load_config_file {
my ($self, $file) = @_;
lib/CatalystX/Controller/ExtJS/REST.pm view on Meta::CPAN
Defaults to C<data>.
=head2 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
view release on metacpan or search on metacpan
lib/CatalystX/I18N/Model/Maketext.pm view on Meta::CPAN
use Moose;
extends 'CatalystX::I18N::Model::Base';
use CatalystX::I18N::TypeConstraints;
use Path::Class;
use Scalar::Util qw(weaken);
has 'gettext_style' => (
is => 'rw',
isa => 'Bool',
default => 1,
lib/CatalystX/I18N/Model/Maketext.pm view on Meta::CPAN
# Catch error
Catalyst::Exception->throw(sprintf("Could not fetch lanuage handle for locale '%s'",$c->locale))
unless ( scalar $handle );
if ($self->can('fail_with')) {
weaken($c);
$handle->fail_with( sub {
$self->fail_with($c,@_);
} );
} else {
$handle->fail_with( sub { } );
view all matches for this distribution