The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-08-08

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
02:13 noganex joined #mojo
04:39 howitdo joined #mojo
04:52 aborazmeh joined #mojo
05:27 karjala joined #mojo
05:28 _sfiguser joined #mojo
07:04 petru joined #mojo
07:34 Vandal joined #mojo
08:24 prg joined #mojo
08:34 pirateFinn joined #mojo
08:49 pirateFinn joined #mojo
09:08 sri re roles support in Test::Mojo, we are now considering a Mojo::Base::with_roles method and an optional dep on Role::Tiny
09:09 sri my $t = Test::Mojo->new(...)->with_roles('Foo', 'Bar');
09:10 sri the optional dep should be pretty smooth, since you get Role::Tiny installed automatically when you install a 3rd party role
09:11 sri and having Mojo::Base::with_roles() means we also get Mojo::UserAgent->new(...)->with_roles(...) and Mojo::DOM->new(...)->with_roles(...)
09:11 sri thoughts?
09:11 purl "I'm never here, I'm never here, I'm never here  /  never a bird, or a flower in the tree, or the pain of the respect thereof..."
09:18 nic joined #mojo
09:19 petru joined #mojo
09:20 nic Sounds good.  I'm going to hold off releasing Mojo::CachingUserAgent for a bit.  My hunch is it'll be more widely applicable as a role
09:23 haarg generally i'd say Test::Mojo->with_roles('Foo', 'Bar')->new would be a better thing to use, although it would certainly be possible to support both
09:23 batman haarg: that would (could?) modify all of Test::Mojo instances, instead of just a single instance
09:24 haarg no, it would give you a new class
09:24 batman aha
09:24 sri it's the same without the rebless
09:24 dhg joined #mojo
09:25 sri i suppose there is less potential for surprises this way
09:25 batman sri: could we automatically do "$base_class\::Role::$role_name" when doing with_roles("Foo") ?
09:26 sri Test::Mojo->with_roles('+Foo')->new(...)
09:26 sri what jberger did
09:26 irqq joined #mojo
09:26 batman Test::Mojo->new->with_roles("Foo") == Role::Tiny->apply_roles_to_object(Test::Mojo->new, "Test::Mojo::Role::Foo");
09:27 sri the +Foo expands to $base_class::Role::Foo
09:27 batman ok. that's fine i guess, but i do like the way $app->plugin("...") works
09:27 sri that's funny, i'm kinda not so happy about that :)
09:27 batman hehe
09:28 batman i see your reasoning behind why you're not happy about it :)
09:28 batman and it makes sense to me
09:29 sri haarg: is there a convention for making role application mechanisms that expand the role name?
09:29 sri (like +Foo)
09:29 haarg not really
09:30 haarg Foo meaning Some::Base::Foo and +Foo meaning Foo is what Plack::Builder does
09:31 haarg Module::Runtime has a scheme for composing class names like that, although i don't know if anyone uses it
09:31 nic so using '+' to mean "do not +"
09:31 nic interesting
09:32 haarg Dist::Zilla uses bare names for plugins, and =Names for fully qualified names, and some other prefixes for other things
09:32 haarg none of these are really related to roles, just throwing out examples
09:34 nic avoiding having syntax mapping to the opposite semantics could yield profit
09:49 pink_mist yeah, what Plack::Builder does seems like it would cause loads of confusion
09:49 pink_mist they should have gone with = like dzil, makes much more sense for that case
09:57 sri ok, so for the first version we won't have a shortcut for $basename::Role::Foo :p
09:58 sri until there's a clear solution
10:10 pink_mist I'd vote for doing it like dzil myself - that is, have 'Foo' expand automagically and '=Foo' translate to just 'Foo'
10:14 sri if anyone wants to write the Mojo::Base::with_roles patch, please go ahead, i won't get around to it today
10:16 sri optional dep (like IO::Socket::Socks and so on), Mojo::Base::can_roles method, version command entry, Mojo::Base::with_roles class method, some minimal ref docs, and a new test file (with the usual optional dep boilerplate)
10:16 haarg sub with_roles { require Role::Tiny; ref $_[0] ? Role::Tiny->apply_roles_to_object(@_) : Role::Tiny->create_class_with_roles(@_) }
10:17 sri we do require a little more boilerplate
10:17 sri consistent with the other optional deps
10:19 sri and i think we can get scott to add an example to the guide once that has been done https://github.com/kraih/mojo/pull/1118
10:21 sri haarg: for now i think we'll just do Role::Tiny->create_class_with_roles(@_)
10:22 sri we can always extend it later, lets start conservative
10:23 haarg sure
10:24 haarg i hadn't double checked what Role::Tiny will do if you try to use create_class_with_roles with an object.  it will try to load the object as if it were a package name.
10:35 calatalee joined #mojo
11:11 tchaves joined #mojo
11:23 yukikimoto joined #mojo
11:32 dhg joined #mojo
11:42 nicomen j yapc
11:42 nicomen oops
11:42 yukikimoto left #mojo
11:42 nicomen (well, might as well ask who is attending?)
11:44 marcus nicomen: \o :D
11:45 nicomen except batman and marcus :-D
11:52 * pirateFinn waves from venue
11:56 marcus yarr!
11:57 * ashimema wishes he was there
12:03 blaphmat joined #mojo
13:15 tchaves joined #mojo
13:29 _sfiguser joined #mojo
13:56 gordonfish joined #mojo
14:08 mcsnolte joined #mojo
14:18 Grinnz roles support in Mojo::Base is a great idea
14:53 stryx` joined #mojo
15:09 itaipu joined #mojo
15:09 aborazmeh joined #mojo
15:20 PryMar56 joined #mojo
15:23 aborazmeh joined #mojo
15:31 gryphon joined #mojo
15:36 * sri loves working with the new minion foreground feature
15:38 sri "so job 123 failed on some node in the cluster... lets pull it to this box where i have added a few debug lines to the task class, and run it in the foreground to see what's going on"
15:38 sri i wonder if other job queues have that workflow
15:38 sri "myapp minion job -f 123"
15:39 sri all i had to do
15:39 sri while the cluster keeps doing its thing
15:45 sri btw. this is what roles will look like for Test::Mojo in the beginning https://github.com/kraih/mojo/pull/1118#issuecomment-320930345
15:45 prg just curious, when you say "cluster" you mean multiple machines accessing the same db?
15:46 sri multiple servers running workers against the same postgres database
15:46 prg yeah, that's what i meant
16:11 tchaves joined #mojo
16:16 howitdo joined #mojo
16:27 karjala joined #mojo
16:28 karjala joined #mojo
16:35 sri i think we have core team consensus on Role::Tiny support, so we just need a patch now :o
16:35 sri (this https://irclog.perlgeek.de/mojo/2017-08-08#i_14984163)
16:38 itaipu joined #mojo
16:42 Lee[home] joined #mojo
17:36 gizmomathboy joined #mojo
17:55 tchaves1 joined #mojo
18:09 irqq joined #mojo
18:28 _sfiguser hello all can somebody show me an example of usage of sessions ?
18:31 tchaves joined #mojo
18:33 sri the growing guide is all about sessions
18:35 gizmomathboy joined #mojo
18:38 _sfiguser sri this one  https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Growing.pod#Sessions  ? where ?
18:38 _sfiguser i need to know how manage them...  a simple web application which uses sessions would be ok  ?
18:39 preaction _sfiguser: keep reading https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Growing.pod#State-keeping
18:42 _sfiguser preaction, ok then when a $username logs in... i should do $c->session(user => $username); in order to set up a session ?
18:43 preaction what happens when you try it?
18:47 _sfiguser preaction, i'm trying... also what should i put instead of "Mojolicious rocks" in the secret ?
18:49 pink_mist SOMETHING SECRET!
18:49 pink_mist if preaction tells you what, IT'S NOT SECRET ANYMORE
18:49 sri hunter2
18:50 _sfiguser pink_mist, ok i'm just not used to this... i mean, like a password, so it is used to sign cookies
18:51 pink_mist it's a SECRET
18:51 pink_mist it's supposed to be something NOBODY else knows
18:51 pink_mist so yes, similar to a password
18:58 preaction if someone knows the secret, they can sign cookies with it, which means they could create "trusted" data. so yes, it's a password
19:30 itaipu joined #mojo
19:32 irqq_ joined #mojo
19:40 sri yay, a new book in my favorite scifi series is out today \o/
19:42 sri (all these worlds)
20:03 petru joined #mojo
20:45 mgrimes joined #mojo
20:48 mikegrb joined #mojo
21:11 Peppard joined #mojo
21:34 _sfiguser joined #mojo
22:51 aborazmeh joined #mojo
22:54 stryx` joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary