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

IRC log for #mojo, 2014-08-06

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

All times shown according to UTC.

Time Nick Message
00:02 woz joined #mojo
00:14 * sri ponders adding Mojolicious::Static::is_fresh with support for ETag and Last-Modified
00:14 sri half of it already exists
00:15 sri it would just compare request and response headers to determine if the content is still fresh, in which case you could bail out with a 304 status
00:43 good_news_everyon joined #mojo
00:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/BNWHNw
00:43 good_news_everyon mojo/master c58536c Sebastian Riedel: added a few more caching features to Mojolicious::Static
00:43 good_news_everyon left #mojo
00:43 sri that could also be exposed in helpers
00:44 woz joined #mojo
00:44 sri lets say you set an ETag header in your code $c->res->headers->etag('"$md5"');
00:45 sri now you can do return $self->rendered(304) if $c->app->static->is_fresh($c);
00:46 sri in the next line you would render
00:47 sri there could be a helper to do return $c->rendered(304) if $c->is_fresh;
00:48 sri or even a helper that does the ->rendered(304) automatically
00:48 sri return if $c->is_fresh
00:48 sri you just set an etag or last-modified header before
00:54 sri could also do something like $c->is_fresh($etag, $last_modified) and it sets the headers for you too
01:04 crab sounds nice.
01:08 good_news_everyon joined #mojo
01:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/lCf2Wg
01:08 good_news_everyon mojo/master cad6587 Sebastian Riedel: small optimizations
01:08 good_news_everyon left #mojo
01:14 sri jberger, batman, marcus, tempire: something to think about :)
01:16 laouji joined #mojo
01:18 woz joined #mojo
01:30 good_news_everyon joined #mojo
01:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/CVoEcg
01:30 good_news_everyon mojo/master d1195cb Sebastian Riedel: added is_fresh helper to Mojolicious::Plugin::DefaultHelpers
01:30 good_news_everyon left #mojo
01:30 sri actually, i think the basic helper already makes sense
01:35 good_news_everyon joined #mojo
01:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/FJYVtg
01:35 good_news_everyon mojo/master 577b852 Sebastian Riedel: small optimization
01:35 good_news_everyon left #mojo
01:36 klapperl_ joined #mojo
01:37 absolut_todd joined #mojo
01:40 Averna joined #mojo
01:53 KCL joined #mojo
01:54 woz joined #mojo
02:03 d4rkie_ joined #mojo
02:09 noganex_ joined #mojo
02:17 dvinciguerra joined #mojo
02:29 woz joined #mojo
02:31 good_news_everyon joined #mojo
02:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/-umBrw
02:31 good_news_everyon mojo/master 5966b12 Sebastian Riedel: fixed typo in is_fresh example
02:31 good_news_everyon left #mojo
02:40 jberger batman/marcus: https://github.com/jhthorsen/mojolicious-plugin-linkembedder/pull/2
02:51 basic6 joined #mojo
02:55 sujithm joined #mojo
03:02 Gedge joined #mojo
03:05 woz joined #mojo
03:13 basic6_ joined #mojo
03:24 jberger hey cool, the TechEmpower benchmark test now has a travis build!
03:24 jberger I will be watching this one: https://travis-ci.org/TechEmpower/FrameworkBenchmarks/jobs/31772653
03:39 woz joined #mojo
03:51 jberger here is the most recent master build's mojolicious run: https://api.travis-ci.org/jobs/31771155/log.txt?deansi=true
03:52 jberger I have the 404s fixed on my branch, though the db connectivity still was wrong
03:52 jberger that is what my most recent commit is for
04:06 jberger I wonder if you can call it "continuous" integration when the test runs for >20 hours!
04:13 woz joined #mojo
04:16 jberger oh, too bad, I'm seeing that travis build for pr isn't working yet
04:16 jberger :-/
04:16 jberger too bad
04:20 irq joined #mojo
04:32 d4rkie joined #mojo
04:49 woz joined #mojo
05:20 fitnerd_ joined #mojo
05:24 woz joined #mojo
05:59 woz joined #mojo
06:01 denis_boyun joined #mojo
06:06 fitnerd joined #mojo
06:07 sujithm joined #mojo
06:13 dexteruk_ joined #mojo
06:13 dexteruk joined #mojo
06:31 woz joined #mojo
06:43 batman jberger: thanks for the pull request :) was it difficult to get started adding the class...?
06:46 batman sri: i suggest something like this: $c->is_fresh(etag => ..., last_modified => ...); and it would compare the values you pass along.
06:46 batman don't care about etag? then just do $c->is_fresh(last_modified => ...);
06:47 batman but then i might argue that $c->is_fresh should return false, since there's nothing to compare against. (unless the headers are already set..?)
07:02 dexteruk_ joined #mojo
07:08 woz joined #mojo
07:10 kwa joined #mojo
07:16 Vandal joined #mojo
07:17 Gedge_ joined #mojo
07:29 basiliscos joined #mojo
07:37 dexteruk_ joined #mojo
07:38 trone joined #mojo
07:42 sujithm joined #mojo
07:43 woz joined #mojo
07:44 bobkare joined #mojo
07:53 d4rkie_ joined #mojo
08:01 dexteruk_ joined #mojo
08:04 fhelmber_ joined #mojo
08:04 fhelmber_ joined #mojo
08:05 chansen joined #mojo
08:08 neyasov___ joined #mojo
08:11 dotan joined #mojo
08:12 Averna joined #mojo
08:15 dexteruk_ joined #mojo
08:19 woz joined #mojo
08:19 edestler joined #mojo
08:23 batman anyone who wants to comment on transaction support for Mojo::Redis2? https://github.com/jhthorsen/mojo-redis2/commit/22c507267afb3397fa48b5e80958d8787c3d2edb
08:45 cosimo joined #mojo
08:48 Averna joined #mojo
08:54 woz joined #mojo
08:55 punter joined #mojo
08:57 irq joined #mojo
09:14 odc that looks like a great idea!
09:21 Averna joined #mojo
09:29 woz joined #mojo
09:32 Dandre joined #mojo
09:32 dexteruk_ joined #mojo
09:43 batman odc: Mojo::Redis2 or something else..?
09:44 odc Redis2 Transactions
09:45 batman Cool :) can you give me feedback on the rest of the API as well?
09:46 odc i like it so far, except maybe the $self->multi, which should be $self->multi_result maybe
09:47 odc blpop is not supported yet right?
09:47 batman I'm thinking about changing the non-blocking API to return either an object or an array-ref with [$err, $res]...
09:48 batman I just added blpop support :)
09:48 odc ho :D
09:48 batman Why multi_result..?
09:48 odc to not conflict with MULTI from redis
09:49 odc although i've never used it...
09:50 batman Not sure if I can support just "MULTI" on the Mojo::Redis2 object...
09:51 odc hm right, so redifining multi to something that works might be a good idea
09:52 odc i don't know :/
09:53 batman i need a case where you need it and also an idea on how to make that work.
09:53 batman you see, the Mojo::Redis2 object can have multiple connections to the same server: one for blpop, one for (p)subscribe and one for "normal" commands
09:54 batman there's no multi(), exec() or discard() methods for Mojo::Redis2, only for Mojo::Redis2::Transaction.
09:55 odc i din't tell you, but I tried adding Sentinel support to Mojo::Redis a few weeks ago by modifying connect(), but it never worked as expected :/ I hope the new way you handle connection will make things easier
09:56 odc oh! I missed that. Then multi is totally ok
09:56 dexteruk_ joined #mojo
09:57 batman multi: ok, excellent! :)
09:57 batman yeah, will look at that soon... can you share the code you tried to make work?
09:57 batman *can you share the code you wrote for sentinel support?
09:58 batman it would kick start the development...
09:58 odc yup, but only tonight because I left it at home
09:58 batman send it to me in a pm if you don't want to share it in public...
09:58 batman ok, thanks :)
09:58 batman then i will try to look at it tomorrow...
09:58 odc i only did the part where you ask sentinel for the master hostname
09:58 odc which works
09:58 batman ok.
09:58 odc but then the real command gets lost
09:59 odc apparently removed from the queue
09:59 batman odc: https://metacpan.org/pod/Mojo::Redis2 # transaction support is on cpan. (blpop, brpop and brpoplpush will soon be there as well)
10:00 batman ok...
10:00 batman i think we discussed sentinel support earlier...? i've unfortunately lost the log :(
10:01 odc yes -> http://redis.io/topics/sentinel-clients
10:02 odc a sentinel is just like a normal redis server, except it only accepts the SENTINEL command
10:02 batman did we say that we wanted $redis->sentinel([$url, ...]); ?
10:02 odc yes, but with a S at the end
10:03 batman right.
10:04 batman what do you think about the error handling in Mojo::Redis2?
10:05 woz joined #mojo
10:05 batman is $redis->get(foo => sub { my($redis, $err, $res) = @_; ... }); ok or should i just do my($redis, $res) = @_; in the callback, where $res has [$err, $data]; ?
10:05 d4rkie joined #mojo
10:06 odc it seems consistent with the rest of Mojolicious
10:06 odc it's easier to just test $err instead of $res->{err}
10:06 batman except Mojo::UserAgent
10:07 odc right, i don't remember why sri changed that
10:07 batman i agree... but it sucks with delay https://github.com/jhthorsen/mojo-redis2/blob/master/t/blocking-operations.t#L36 <--- so many elements in @res :/
10:08 odc right, I don't do a lot of chaining, but I guess that's a problem
10:09 batman i see. maybe you like the blocking support in Mojo:Redis2 then..? :)
10:09 odc aren't you supposed to stop at the first error anyway?
10:09 odc yes :)
10:09 neyasov___ joined #mojo
10:09 dexteruk joined #mojo
10:10 odc will delay->catch() work here?
10:10 batman no.
10:10 odc hmm
10:11 batman and i don't stop on the first error. $err is set per command, so even though $redis->set(foo => 42, $delay->begin) fail, $redis->set(bar => 42, $delay->begin) might succeed
10:11 batman the callback in Mojo::Redis2 can't cause the delay to die
10:12 odc oh right
10:12 dexteruk joined #mojo
10:12 dexteruk_ joined #mojo
10:12 odc oh well, just use $res->{error} then
10:13 batman i might. need to think about it a bit more first...
10:13 odc sorry I can't stay meditate with you today -_-
10:14 batman your feedback has been very reassuring :)
10:14 batman thanks!
10:14 batman now i can say "sorry you don't like the api - blam odc!" ;-)
10:15 batman *blame
10:20 ryozi joined #mojo
10:22 Adurah_ joined #mojo
10:25 odc heh! i'll be happy to respond to complains
10:29 dexteruk joined #mojo
10:33 batman \o/
10:40 dexteruk joined #mojo
10:41 woz joined #mojo
10:53 dexteruk joined #mojo
10:56 marcus odc: did you pick your nick to drive people with OCD crazy? :)
10:57 odc haha i never thought about it. But all the better...
11:01 dexteruk joined #mojo
11:05 dexteruk joined #mojo
11:06 dexteruk joined #mojo
11:07 dexteruk joined #mojo
11:13 d4rkie joined #mojo
11:15 woz joined #mojo
11:16 sri yea, i'd like feedback on https://github.com/kraih/mojo/compare/6e5f70209801e3b80ab939a61482020ec2f115cd...5966b12058996049e516e6d7ef4e16d39fb33570
11:24 sri also repeating my link from yesterday for those that want to learn more about caching... since it appears to not have made it into the channel log http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/
11:24 batman 08:46 - sri: i suggest something like this: $c->is_fresh(etag => ..., last_modified => ...); and it would compare the values you pass along.
11:24 sri batman: that's similar to what i already proposed yesterday
11:24 dvinciguerra joined #mojo
11:25 sri but i'm not entirely sure about that yet, so it's not implemented yet
11:25 batman yeah, i read that :)
11:25 batman i'm +1 on adding arguments to is_fresh()
11:26 sri last_modified should be an epoch value btw.
11:26 sri would make it easier to deal with
11:26 batman https://github.com/kraih/mojo/compare/6e5f70209801e3b80ab939a61482020ec2f115cd...5966b12058996049e516e6d7ef4e16d39fb33570#diff-13b15adfdbedecfc27586a15b4d29687R25 <-- why did you move the epoch "if" ?
11:26 og01 Hey guys, I have some experience with using ZMQ in an eventloop (EV), and I'm pretty certain i can get it to work in Mojolicious,  I want to use it to communicate between websocket clients.
11:26 sri tiny performance gain
11:27 batman ok
11:27 sri the regex that is first now is the one ued in 99.9% of all cases
11:27 dexteruk joined #mojo
11:27 batman aha
11:27 og01 my question is, in a forking webserver such as hypnotoad, where in my application can I setup the ZMQ server (bind) part of my code
11:28 og01 I want it to run after the fork, but only in one process on startup
11:28 dexteruk_ joined #mojo
11:29 og01 everything in sub startup happens prefork right? and will get forked?
11:29 batman sri: why do you continue checking If-Modified-Since if If-None-Match test fail?
11:30 batman can't you just do return 0 if $match && ($res_headers->etag // '') ne $match; # ?
11:30 sri batman: if you can make it use less lines of code, be my guest
11:30 batman i just gave an suggestion, that i don't get why doesn't do the same...
11:31 dexteruk joined #mojo
11:32 og01 actually i think i know what i can do, I can test if the port is already open when a websocket connection is established, and if it isnt i'll setup all the server end of the zmq connection
11:32 batman sri: the rest of the cache change has +1 from me
11:32 dexteruk joined #mojo
11:32 batman to sum up, i would like $c->is_fresh(%arguments), the rest is +1
11:33 batman the code comment is just a code comment. doesn't change +1.
11:33 neilhwatson joined #mojo
11:35 dexteruk_ joined #mojo
11:36 dexteruk_ joined #mojo
11:42 dexteruk_ joined #mojo
11:42 dexteruk_ joined #mojo
11:43 laouji joined #mojo
11:44 neyasov___ joined #mojo
11:47 Kripton joined #mojo
11:50 good_news_everyon joined #mojo
11:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/L69Crg
11:50 good_news_everyon mojo/master 1dae377 Sebastian Riedel: small optimizations
11:50 good_news_everyon left #mojo
11:51 woz joined #mojo
11:53 D4RK-PH0ENiX joined #mojo
11:55 sri https://github.com/kraih/mojo/compare/6e5f70209801e3b80ab939a61482020ec2f115cd...1dae3771bbe098ba5b966b10ee607853124e0933
11:55 batman thanks :)
12:07 marcus +1 on the freshness
12:08 sujithm joined #mojo
12:26 woz joined #mojo
12:49 good_news_everyon joined #mojo
12:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/83-Oug
12:49 good_news_everyon mojo/master 19a8da6 Sebastian Riedel: is_fresh can now add headers as well
12:49 good_news_everyon left #mojo
12:49 * sri pokes batman
12:49 sujithm joined #mojo
12:50 batman sri: <3
12:50 batman :)
12:54 dexteruk joined #mojo
12:54 sri not 100% sure about this yet... seems like a lot of code for limited value
12:54 dexteruk_ joined #mojo
12:59 dexteruk_ joined #mojo
13:00 woz joined #mojo
13:00 batman maybe, but it's super convenient.
13:00 sujithm joined #mojo
13:02 Jonis -win 4
13:04 good_news_everyon joined #mojo
13:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/trSeXQ
13:04 good_news_everyon mojo/master b7c67a4 Sebastian Riedel: a few more is_fresh tests
13:04 good_news_everyon left #mojo
13:05 sri batman: it's either super convenient or not worth it
13:10 bayashi joined #mojo
13:12 zivester joined #mojo
13:25 batman sri: hehe :)
13:36 woz joined #mojo
13:53 KCL_ joined #mojo
14:00 kwa joined #mojo
14:05 pth_ joined #mojo
14:08 sri i wonder if we should force a little more structure
14:09 sri like a MyApp::Controller namespace
14:10 woz joined #mojo
14:21 * sri was just reading a bit in the Convos source, and noticed that it's not very well organized
14:22 sri you have classes like this, and you need to jump to line 26 to realize that's not actually a controller https://github.com/Nordaaker/convos/blob/master/lib/Convos/Loopback.pm#L26
14:23 * sri waits for batman to ask what he could do differenty... (proving my point!) ;p
14:25 dexteruk joined #mojo
14:28 sri encouraging MyApp::Controller is actually a pretty simple change
14:28 sri we set $r->namespaces(['MyApp']) by default
14:29 sri could just as well set $r->namespaces(['MyApp::Controller', 'MyApp'])
14:29 sri everything else is just documentation tweaks
14:30 sri breaks no tests
14:32 dvinciguerra joined #mojo
14:33 sri marcus: or do you think the way Convos is organized is good?
14:34 sri i never noticed this problem reading my own apps... but trying to read stuff on github... the way apps are organized is not very obvious
14:39 dexteruk joined #mojo
14:40 dexteruk joined #mojo
14:46 woz joined #mojo
14:56 lb is there a way to get at the current controller (specifically stash) from the app object?
14:57 lb i need this (or something similar) to communicate error information from check-functons added to the validator
14:58 lb (similar could be the validation object knowing which controller it belongs to)
15:04 sri batman, marcus, jberger, tempire, crab: here's my proposal https://gist.github.com/anonymous/1d54960537a228f8de8d
15:04 sri lb: that can't ever work, there may be multiple controllers active in an app at any given time
15:05 lb ok
15:05 lb but a controller only has one validation object
15:05 lb would be nice with a pointer back
15:06 lb a boolean and the name of the failing check is not always enough information for business logic checks
15:06 sri where did you read boolean?
15:07 lb that's a good question, i got that from one of my cow orkers, who didn't know how to solve this and threw it at me :)
15:07 sri http://mojolicio.us/perldoc/Mojolicious/Validator/Validation#error
15:08 lb ok, i've seen that, i probably didn't understand the concise example
15:09 sri anyway, i need to get back to the controller stuff
15:09 lb thanks
15:09 * lb will try it out and complain if he doesn't find a solution :)
15:10 sri batman, marcus, jberger, tempire, crab: i really hate how apps like Convos mix controllers and other classes
15:10 lb gross
15:11 crab "mix" how?
15:11 crab in the same namespace under convos::?
15:11 sri https://github.com/Nordaaker/convos/blob/master/lib/Convos/Loopback.pm#L26
15:11 sri that's not a controller, now navigate to the directory level
15:12 lb gross
15:12 sri i'm cool with supporting that kinda mess (it can be useful if your developers are disciplined enough)... but i think we should encourage a ::Controller namespace by default
15:13 lb $self->routes->namespaces( ['DKHM::Web::SB::Controller'] );
15:14 sri my proposal is simple, just have two default controller namespaces, and encourage good design with documentation, no tests break
15:15 lb i like when your thinking align with my own ;)
15:17 fitnerd_ joined #mojo
15:22 woz joined #mojo
15:23 crab i do not object to this proposal, since no existing code would break
15:34 sri crab: but you do not believe it's the right thing to do?
15:36 tempire I also feel a little icky mixing them.
15:36 tempire But ::Controller:: reminds me of catalyst
15:36 tempire which also makes me feel icky.
15:36 tempire I am therefore ambivalent to this proposal
15:36 sri if that's your only worry i take that as a +1 ;p
15:36 tempire neither -1 nor +1
15:36 tempire just 1
15:37 tempire or maybe 0
15:37 tempire depending on what the identity is
15:37 sri i think the ::Controller namespace is one of the few things to like about catalyst :D
15:45 crab sri: i do not feel strongly about it, but weak positive
15:48 davido___ I haven't seen further discussion regarding the pull request for canonical json encoding.  Is that definitely a thumbs-down, or still TBD?  (I don't have a strong opinion either way -- seems like some will feel the tradeoff is worthwhile, others not.)
15:49 sri https://gist.github.com/anonymous/9a89a4c0f53821db087b # with some more documentation tweaks
15:50 sri davido: looks like the discussion died in which case it would be a -1
15:51 sri MyApp::Controller was actually used as an example for custom namespaces, so i've changed those to use MyApp::C
15:53 pth_ Any thoughts on a adding a new method "encode_json_sorted" if you don't mind the performance hit.  or optional flags like encode_json($obj, { sorted => 1 })
15:53 davido___ Could be an OO-only option; my $j = M::J->new(canonical=>1).  But that dispells the magic of zero configuration. :)
15:54 davido___ Anyway, -1 is fine too. ;)
15:54 sri pth, davido: and that wouldn't be a performance hit?
15:54 davido___ It would only impact the OO usage.
15:54 sri suddenly you need to pass configuration state around between all the functions
15:55 sri davido: that's just plain false
15:57 woz joined #mojo
15:58 crab just plain false, as opposed to a string containing "false"?
15:58 sri yes
15:58 davido___ :)
15:59 sri don't you know your JSON? ;p
16:00 sri ANYWAY... lets talk about MyApp::Controller -.-
16:02 crab MyApp::ControllerFreak!
16:03 sri \o/
16:04 good_news_everyon joined #mojo
16:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/GyI9qg
16:04 good_news_everyon mojo/master 64a3408 Sebastian Riedel: improved Mojolicious to use MyApp::Controller namespace by default and encourage its use in the documentation
16:04 good_news_everyon left #mojo
16:08 good_news_everyon joined #mojo
16:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/472p0Q
16:08 good_news_everyon mojo/master 13881d2 Sebastian Riedel: use MyApp::MyController instead of MyApp::C in examples
16:08 good_news_everyon left #mojo
16:12 komodo_ joined #mojo
16:14 odc heh, mojo looks like Enterprise software now
16:15 sri me right now http://cdn.scratch.mit.edu/static/site/projects/thumbnails/1983/0020.png
16:16 sri oh, there are much nicer ones!
16:16 sri http://media-cache-ak0.pinimg.com/236x/00/16/3a/00163ac7a3075b6170893ce5affb0b83.jpg
16:16 denis_boyun joined #mojo
16:18 denis_boyun_ joined #mojo
16:21 marty joined #mojo
16:23 d4rkie joined #mojo
16:26 denis_boyun joined #mojo
16:28 good_news_everyon joined #mojo
16:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/MgnkSQ
16:28 good_news_everyon mojo/master 8169d06 Sebastian Riedel: mention both namespaces in routing guide
16:28 good_news_everyon left #mojo
16:28 sri i'm actually a little surprised tempire is not all +1 on this, since he's usuallly all over ways to make code cleaner
16:29 tempire Emotional linkage to dark catalyst days
16:29 sri there will be no Model and View namespaces :D
16:29 woz joined #mojo
16:29 * tempire twitches
16:32 denis_boyun joined #mojo
16:37 sri we already used Mojolicious::Controller and MVC terminology all over the place before for crying out loud ;p
16:39 denis_boyun_ joined #mojo
16:39 sri i want bigger mojolicious apps to be cleaner!
16:39 sri any ideas in that direction would be very welcome
16:40 sri perhaps easier ways to factor out helpers
16:40 tempire hmm
16:40 tempire I might have some ideas on that.
16:41 sri i'm specifically looking for stuff that would make Convos prettier https://github.com/Nordaaker/convos
16:42 sri the inline pod really doesn't help though
16:43 batman sri: about the ::Controller namespace... Convos is a complete mess.
16:43 batman Haven't had time to organize it :(
16:43 sri yea, i want it to be harder to make such a mess
16:44 batman Never understood how to do it proper though, but Convos is the worst I've done.
16:44 sri Controller namespace will help there
16:44 sri i'm actually using MyApp::Controller in all my apps
16:44 sri in one app i even have MyApp::Model xD
16:44 lb gasp
16:45 sri no ::View though!
16:45 batman Then I think your patch makes sense. But I don't have the capacity to do +/-1 now. I got visitors...
16:45 batman I'm back tomorrow.
16:45 sri discuss it with your visitors :)
16:46 batman Right now I think I'm -1 though...
16:46 batman Haha. He's a movie maker :P
16:47 lb naming is hard, conventions help a lot
16:47 sujithm joined #mojo
16:50 sri i actually looked at webapps from other frameworks on github to make this decision
16:51 sri the ones i liked reading always had a clear structure encouraged by the framework
16:53 sri https://github.com/bratta/fikus # like this random padrino app
16:53 sri it's not big of course, but stuff is easy to understand
16:57 sri ruby frameworks do a pretty good job in general, even the smaller ones
16:57 preaction joined #mojo
16:58 sri express.js apps, even the popular ones, are usually a total fricking mess where absolutely nothing is encouraged https://github.com/tryghost/Ghost
16:58 genio I'm not that big on ::View... ::Model I flip-flop on since DBIx::Class, but I like the idea of ::Controller
16:59 sri the templates directory is basically our ::View
16:59 sri it could just as well have been called view
17:00 punter joined #mojo
17:00 lb but then i would have had to hurt you :(
17:00 sri :o
17:00 * genio cowers in fear
17:00 lb i increasingly dont like web-mvc
17:00 btyler agree re express.js apps often being a mess
17:02 lb mv&htmlandbits
17:02 lb bah
17:02 lb mc!
17:05 woz joined #mojo
17:12 basiliscos joined #mojo
17:34 neyasov___ joined #mojo
17:41 woz joined #mojo
17:43 _eugen joined #mojo
17:43 marty joined #mojo
17:46 marty joined #mojo
17:46 davido___ :| .... hoping I don't get eaten alive.
17:56 * sri wonders if the namespace part could be rephrased to sound better http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Special-stash-values
17:58 good_news_everyon joined #mojo
17:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1FXVaw
17:58 good_news_everyon mojo/master 8dcbaf8 Sebastian Riedel: show namespace examples
17:58 good_news_everyon left #mojo
18:13 good_news_everyon joined #mojo
18:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/QTc0ow
18:13 good_news_everyon mojo/master e7e9da8 Sebastian Riedel: better description for namespaces
18:13 good_news_everyon left #mojo
18:13 sri that's better
18:13 sri looks like 5.25 will be a significant release :)
18:15 woz joined #mojo
18:25 lb 5.25 - "ye ole floppy"
18:26 sri that gave away your age ;p
18:27 * lb has gotten paid for writing perl4, how's that
18:28 sri :O
18:34 marty joined #mojo
18:35 good_news_everyon joined #mojo
18:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/SZM-Pg
18:35 good_news_everyon mojo/master 1ddc343 Sebastian Riedel: simplify namespace examples
18:35 good_news_everyon left #mojo
18:39 irq joined #mojo
18:45 neyasov___ joined #mojo
18:51 woz joined #mojo
18:53 davido___ ok, done. ;)
18:58 denis_boyun joined #mojo
19:13 davido__ joined #mojo
19:15 denis_boyun joined #mojo
19:20 denis_boyun_ joined #mojo
19:26 preaction joined #mojo
19:27 woz joined #mojo
19:33 denis_boyun joined #mojo
19:44 zackiv31 joined #mojo
19:44 * sri is tempted to move the MyUsers class in the growing guide to MyApp::Model::MyUsers
19:45 sri or rather MyApp::Model::Users
19:46 sri i will prolly move it to MyApp::Users
19:48 good_news_everyon joined #mojo
19:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/k_j60A
19:48 good_news_everyon mojo/master 54f9a49 Sebastian Riedel: rename MyUsers class in growing guide to MyApp::Users
19:48 good_news_everyon left #mojo
19:53 denis_boyun joined #mojo
19:54 sri still very tempted to use MyApp::Model::Users
19:54 sri maybe with a note tht the name is arbitrary
20:01 woz joined #mojo
20:10 odc` joined #mojo
20:12 odc` batman, ping
20:19 neilhwatson joined #mojo
20:29 neyasov___ joined #mojo
20:36 woz joined #mojo
20:45 Kripton I am using Mojo::UserAgent to login in a http form that uses multipart/form-data on the login URL
20:45 Kripton $tx = $ua->post('URL' => form =>{username => {content => 'username'}});
20:45 Kripton Mojo::UserAgent is sending 'Content-Disposition: form-data; name="username"; filename="username"'
20:45 preaction joined #mojo
20:45 Kripton But only works when I change to 'Content-Disposition: form-data; name="username"'
20:45 Kripton Right now, to disable the "automatic" filename variable
20:45 Kripton i am commenting the line '$disposition .= qq{; filename="$filename"} if defined $filename;'
20:45 Kripton on UserAgent/Transactor.pm
20:46 Kripton there is another way to prevent the "automatic" filename variable ?
20:50 og01 hey does this look correct route for websocket on the RealTimeData.pm controller for the sub echo? $routes->websocket('/echo')->to('real_time_data#echo');
20:51 og01 im getting 404 in the browser
20:58 good_news_everyon joined #mojo
20:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/6qHk-g
20:58 good_news_everyon mojo/master 5bbde73 Sebastian Riedel: mention that the controller can be specified in CamelCase form
20:58 good_news_everyon left #mojo
21:07 good_news_everyon joined #mojo
21:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/il9wug
21:07 good_news_everyon mojo/master 111e1b6 Sebastian Riedel: use MyApp::Model namespace in growing guide
21:07 good_news_everyon left #mojo
21:07 sri but it mentions that the name is an arbitrary choice
21:09 sri considering that the guide is all about MVC, i think it helps getting the point across
21:09 sri a few people will certainly cargo cult the layout and use ::Model::, but that's not a bad practice
21:11 Kripton I discovered how to do it
21:14 Kripton I am forcing the content-type using 'my $headers = {'Content-Type' => 'multipart/form-data'};'
21:15 Kripton and then $tx = $ua->post('URL' => $headers => form => {username => 'user'});
21:17 odc` batman, i'll just leave this here : http://p.thorsen.pm/162e9ef4e64a
21:17 Kripton my problem now with mojo is my inexperience with perl :(
21:20 davido_ joined #mojo
21:28 punter joined #mojo
21:30 jnbek so, does anyone know of a Wiki app powered with Mojolicious?
21:39 woz joined #mojo
21:39 sri jberger, tempire, batman, marcus, crab: MyApp::Model::Users!
21:40 tempire I...
21:40 tempire ::View::
21:41 tempire It does make it clear.
21:50 sri http://p5js.org/ # not going to be confusing at all!
21:55 tianon not gonna lie, was hoping that link was going to lead me to a javascript port of Perl 5
21:55 tianon was sorely disappoitned
21:55 tempire case in point
21:55 purl somebody said case in point was an android phone triddle_'s friend has, he got 3/4 of a day of use out of it, it's so bad verizon offers a battery "upgrade" so now the phone is usable but it's got straight up ghetto booty
21:56 woz joined #mojo
22:00 good_news_everyon joined #mojo
22:00 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/0-FJmA
22:00 good_news_everyon mojo/master 338cabb Sebastian Riedel: mention that templates are our views
22:00 good_news_everyon left #mojo
22:02 sri tempire: was hoping from a teaching point of view you would at least "not hate" clearer MVC naming :)
22:05 sugar joined #mojo
22:16 woz joined #mojo
22:21 woz_ joined #mojo
22:21 sri tempire: still interested in your helper ideas btw.
22:21 * sri shakes tempire
22:27 sri hmm, every django app i've looked at was a mess
22:46 woz joined #mojo
22:55 d4rkie joined #mojo
22:55 sri tempire: perhaps a plugin generator for app specfic plugins
22:59 preaction joined #mojo
23:13 good_news_everyon joined #mojo
23:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xAGB8Q
23:13 good_news_everyon mojo/master 486076b Sebastian Riedel: added a recipe for application specific plugins
23:13 good_news_everyon left #mojo
23:13 sri tempire: step 1!
23:14 sri i always figured app specific plugins were kind of implicit... but i've not seen anyone use them yet
23:14 d4rkie joined #mojo
23:14 sri so here's your recipe!
23:15 sri the example is very unoriginal though... something more fun would be nice
23:15 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Adding-a-plugin-to-your-application
23:23 oetiker joined #mojo
23:29 woz_ joined #mojo
23:31 good_news_everyon joined #mojo
23:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/IWRMbA
23:31 good_news_everyon mojo/master fcd45f1 Sebastian Riedel: link to plugin base class from recipe
23:31 good_news_everyon left #mojo

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