This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Example::Controller::Todos; | |
| use Moose; | |
| use MooseX::MethodAttributes; | |
| use Example::Syntax; | |
| extends 'Catalyst::Controller'; | |
| sub root :Chained(/auth) PathPart('todos') CaptureArgs(0) ($self, $c) { | |
| $c->send(my $list = $c->user->todos); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Example::Controller::Todos; | |
| use Moose; | |
| use MooseX::MethodAttributes; | |
| use Example::Syntax; | |
| extends 'Catalyst::Controller'; | |
| sub root :Chained(/auth) PathPart('todos') CaptureArgs(0) ($self, $c) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Example::Controller::Register; | |
| use Moose; | |
| use MooseX::MethodAttributes; | |
| use Example::Syntax; | |
| extends 'Catalyst::ControllerPerRequest'; | |
| has person => ( | |
| is=>'ro', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use warnings; | |
| use strict; | |
| use Class::Method::Modifiers; | |
| sub myfunc1 { | |
| return join(' ', @_); | |
| } | |
| sub myfunc2 { | |
| return join(' ', @_) .' | '. myfunc1('a','b') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Local::MyApp::Model::User; | |
| use Moose; | |
| use Valiant::Params -types; | |
| has 'first_name' => (is=>'ro', required=>1, param=>1); | |
| has 'last_name' => (is=>'ro', required=>1, param=>1); | |
| has 'profile' => (is=>'ro', required=>1, param=>{type=>'::Profile'}); | |
| sub register_type { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Local::MyApp::Controller::Session; | |
| use Moose; | |
| extends 'Catalyst::Controller::PerRequest'; | |
| has person => ( | |
| is => 'rw', | |
| isa => DBICResult, | |
| lazy => 1, | |
| default => sub($self) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jnapiorkowski@MM-MAC-11294 Valiant % OPENSSL_PREFIX=/usr/local/opt/openssl@1.1 cpanm Net::SSLeay -v | |
| cpanm (App::cpanminus) 1.7044 on perl 5.034000 built for darwin-2level | |
| Work directory is /Users/jnapiorkowski/.cpanm/work/1636310557.29093 | |
| You have make /usr/bin/make | |
| You have /usr/bin/curl | |
| You have /usr/bin/tar: bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 | |
| You have /usr/bin/unzip | |
| Searching Net::SSLeay () on cpanmetadb ... | |
| % Total % Received % Xferd Average Speed Time Time Time Current | |
| Dload Upload Total Spent Left Speed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Test::A; | |
| use Moo; | |
| use Valiant::Validations; | |
| use Types::Standard qw(Str); | |
| has 'b' => (is=>'ro'); | |
| has 'c' => (is=>'ro'); | |
| validates 'b', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package MyApp::Model::Session; | |
| use Moose; | |
| extend 'Catalyst::ApplicationModel'; | |
| has 'person' => (is=>'ro', required=>1, model=>'Schema::Person'); | |
| sub authenticate($self, $username='', $password='') { | |
| my $user = $self->person->authenticate($username, $password); | |
| $self->ctx->session->{user_id} = $user->id if !$user->has_errors; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Example::Controller::Root; | |
| use Moose; | |
| use MooseX::MethodAttributes; | |
| extends 'Catalyst::Controller'; | |
| sub root :Chained(/) PathPart('') CaptureArgs(0) { } | |
| # map body params directly to action args |