Camelia, the Perl 6 bug

IRC log for #mojo, 2013-10-29

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

All times shown according to UTC.

Time Nick Message
00:09 marty Ahh, now I remember why I did not go with TM2, no split screen editing.   That's a big one for me.
00:25 asarch joined #mojo
00:34 bpmedley I just noticed that the new error template has the flat look.  Cool.
00:55 russum joined #mojo
00:56 laouji joined #mojo
01:03 * jberger catches up
01:03 * jberger blushes
01:04 jberger " wish you had the time to write a book" -- I wish I did too
01:04 jberger you never know, maybe I will get bored sometime this winter
01:04 jberger in which case I will finally have to learn how the router works
01:05 * jberger can use under, but bridges and shortcuts and conditions (oh my!) still escape me
01:10 SmokeMachine joined #mojo
01:18 SmokeMachine joined #mojo
01:51 rem_lex joined #mojo
02:01 d4rkie joined #mojo
02:03 good_news_everyone joined #mojo
02:03 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/xREypg
02:03 good_news_everyone mojo/master 5e8011b Sebastian Riedel: use hash rockets consistently
02:03 good_news_everyone left #mojo
02:04 jberger hahaha, hash rockets?!
02:04 * jberger steals
02:05 sri HASH ROCKETS!
02:05 jberger btw hash rockets (and hash access stringification) are things that I really miss when  I have to use python
02:06 jberger (which is all the time now)
02:06 sri :(
02:06 jberger $work
02:07 jberger all the more reason to use Perl for after-work fun
02:08 * sri loves how the generated template source is now actually readable
02:08 jberger \o
02:09 jberger (I still haven't figure out how to denote "high-five guy" from "waving goodbye guy")
02:09 jberger (that was "high-five guy")
02:10 sri haha
02:11 sri o/ (5)
02:12 jberger I think if I was going to write a mojo book, I would have to start with "why MVC", I am continually amazed at the number of people who still build up their HTML incrementally
02:12 sri well... lets look it up... http://en.wikipedia.org/wiki/List_of_emoticons
02:12 sri o/ \o
02:12 jberger nice
02:13 * jberger is reminded that wikipedia knows everything
02:14 jberger holy carp, is that page curated?!
02:14 jberger I have no idea what any of that means!
02:14 sri mvc sounds like it would fit well into a intro/history chapter
02:15 jberger it leads into the templating section too
02:15 jberger meaning Mojo::Template
02:15 jberger but yeah, intro
02:15 sri perhaps little inline history/concept blocks
02:15 jberger yeah
02:16 sri i loved that about the new browser networking book
02:16 jberger in what markup do modern book writers (especially technical writers) write?
02:17 sri yada yada TLS yada [history tidbit] yada yada
02:17 jberger LaTeX has never had great support for code
02:17 sri oreilly is docbook i believe
02:18 jberger the idea of writing an entire book in markdown seems daunting
02:18 sri or pod
02:18 jberger IIRC the modern perl book is pod
02:19 * jberger wishes there was better code support for LaTeX
02:20 sri impossible to say what source format this might be, but even the early previews have nice formatting, so might be a rich format http://chimera.labs.oreill​y.com/books/1230000000545
02:21 sri haha http://oreilly.com/oreilly/author/
02:21 sri of course there's a book for that!
02:22 jberger of course
02:24 jberger LaTeX at least merits an "only if you must"
02:24 jberger hehe: Clean LaTeX, where "clean" means without elaborate local macros. If you wish to use this option, you will be required to provide us with a sample file early in the writing process.
02:25 jberger so does POD actually
02:26 jberger I can't really fathom that a publisher would rather have a word doc than LaTeX but then again, I'm (very) biased
02:27 sri this wysiwyg editor for docbook doesn't look too bad http://www.conglomerate.org/intro.html
02:30 sri hmmm.... google glass 2.0 :o
02:46 duncanthrax2 joined #mojo
02:51 sri powerman: i don't disagree, but there is too little information for me to really have a discussion
02:52 sri especially the downsides of any potential changes
02:53 powerman sri: ok. is it make sense for me to try to improve patch to avoid changes in current behaviour?
02:54 sri powerman: i don't know
02:54 sri i don't have time to look into it either
02:54 sri or even motivation in this case... such a core change means a million new code paths
02:54 powerman ok, no rush here. for my app I'm currently fixed this using monkey patching
02:56 powerman in worst case I always can release separate module like MojoX::Fatal with this monkey patching
02:57 powerman it'll let people to test this behaviour on some projects without changing Mojo itself
03:00 * jberger thinks he knows how sri will feel about that :-P
03:01 sri we are talking about this btw. https://github.com/kraih/mojo/pull/554
03:01 powerman jberger: why? you think releasing such module is bad idea?
03:01 sri if you release it as an experiment it's a good idea, as a solution it's a bad idea
03:02 beyondcreed joined #mojo
03:03 jberger monkey-patching a module in a different dist is going to be fragile
03:04 jberger I'm not saying its a **BAD** idea, I'm just saying it needs flashing lights and sirens telling people not to rely on it
03:05 powerman yep. that's why I spend time trying to prepare pull request. but if there is no other options… and I hope it won't be really fragile - such core code is unlikely to change
03:05 powerman as we see :)
03:05 jberger well that's true, by working through the public api, it should be insulated somewhat
03:06 sri well, you knew your pull request was at the very least unfinished, so chances it gets rejected were 100%
03:06 jberger there has been relatively little public api breakage while I've been associated
03:08 powerman yeah, I know. but to be honest I don't know mojo internals good enough yet, so I'm not sure I'm able to finish this patch. if we'll use tricks like adding default behaviour using reactor->on(error), then even this may break some mojo projects which doesn't expect to see existing handler for this event
03:09 powerman we can use ENV var to switch between warn/exception, this way we won't break anything for sure, but it will looks ugly in the code
03:10 sri actually, i'm more opposed to adding an ENV var than changing the current bahvior :)
03:10 sri million code patchs problem
03:10 sri s/c//
03:11 powerman yeah. but I like idea to move hardcoded behaviour to simple default handler for reactor->on(error). it's mojo-way, it's configurable and flexible, and it's unlikely break anything.
03:12 sri i'm not sure what you mean with that
03:16 powerman sri: with proposed patch when, say, user callback for Mojo::UserAgent->post() will die(), this unhandled exception will generate "error" event in Mojo::UserAgent class first, and if there is no handler for this event in $ua, or if that handler will die() too, then it will generate "error" event in Mojo::Reactor::EV class
03:17 r0b3rt1 joined #mojo
03:17 powerman and only if there is no "error" handler in Mojo::Reactor::EV too (or that handler will die()) we'll have real exception and app crash (well, not exactly - we'll have $EV::DIED called, which by default will do only warn())
03:18 powerman so, if we define reactor->on(error) we'll effectively catch all unhandled exceptions in Mojo app
03:19 powerman so we can move current behaviour hardcoded in emit() and emit_safe() into reactor->on(error) handler
03:19 powerman like I show in comment for my patch
03:19 powerman that single line of code should emulate current behaviour
03:21 powerman but users can easily choose to have exception instead of warn() by doing reactor->unsubscribe(error) plus $EV::DIED=sub{warn $@; exit 255};
03:24 sri powerman: i'm starting to understand, and it might not actually break features then
03:26 powerman if some mojo app expect no default reactor->on(error) handler it may break, but I've no idea is anyone actually do this
03:26 sri i don't consider that breakage
03:35 powerman sri: actually I see only one difference to current behaviour - if we'll have several handlers for some "error" event, then emit_safe(error) will be called, and one of these handlers will die() - rest of handlers won't be executed
03:39 powerman and probably this is for good
03:41 sri i'm checking the documentation to see if there is anything described that would break
03:53 sri http://pastie.org/8439068 # i believe this is what a full patch would look like
03:55 * sri pokes powerman
03:57 powerman sri: local $SIG{__DIE__} in my version was there to not duplicate error message when re-throwing exception
03:58 powerman also, same line doesn't add prefix with class name because it's already there - it's just re-throwing
04:00 sri hmmm
04:01 powerman and, yeah, your version looks much more comprehensive :)
04:02 sri why shouldn't the rethrow add the class?
04:03 powerman because it was just added
04:03 sri it's not already there
04:03 sri it's an exception in an error event, an actual event
04:04 sri we add it when there are no error events
04:06 sri and i'm not sure why you care about $SIG{__DIE__}
04:06 powerman hmm. you probably right, but when I tested this patch I've seen duplication of error messages. maybe real issue was somewhere else and I just fixed it in wrong place
04:06 sri maybe your errors are bubbling up through  multiple layers
04:06 powerman as for $SIG{__DIE__} it's simple - I'm usually set this handler to route all messages to log file
04:07 sri but that's to be expected
04:07 sri it's a new error, so it should call the handler
04:08 sri like i said, exception in actual error event
04:10 sri jberger: if you're still here take a look!
04:10 asarch joined #mojo
04:11 good_news_everyone joined #mojo
04:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/c4​4776862b849319feb36cef1bc8b881dafeba85
04:11 good_news_everyone mojo/master c447768 Sebastian Riedel: improved Mojo::EventEmitter to allow unhandled error events to be fatal
04:11 good_news_everyone left #mojo
04:13 johnny5_ joined #mojo
04:13 sri powerman: you're welcome to make tests if there's something missing
04:14 powerman sri: sure. I'm now testing this patch on my real project. just catch that duplicated error in logs, but looks like these two messages comes with different log levels - warn and err
04:17 powerman yeah, it looks like I missed something and your version is correct
04:18 johnny5_ sri: so question about this response: https://groups.google.com/d/msg/mo​jolicious/h5PlnQ1XmiE/AwnhWcop-9sJ so you are working on a job queue system for mojo?
04:18 sri johnny5_: yes
04:19 good_news_everyone joined #mojo
04:19 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Xvoh9A
04:19 good_news_everyone mojo/master 26d4110 Sebastian Riedel: slightly more consistent formatting
04:19 good_news_everyone left #mojo
04:20 johnny5_ sri: sweet, anything I can do to help? I am think I want to have a web app kick off work to an external app so I think that would help me a lot.
04:21 sri johnny5_: afraid not
04:23 sri i have a tendency not to make stuff public before it's at least somewhat usable
04:23 johnny5_ ahh
04:26 sri and i've been slacking a bit since i wanted to use some mongodb 2.6 features
04:27 r0b3rt1 left #mojo
04:31 dqw111 joined #mojo
04:32 sri think i might push 4.52 to cpan soonish so we can get some real feedback :)
04:32 sri and i'll be prepared to quickly roll back in case we missed something
04:35 sri powerman: or do you have anything else?
04:36 powerman sri: no, I'm playing with it now, but everything looks fine
04:51 good_news_everyone joined #mojo
04:51 good_news_everyone [mojo] kraih tagged v4.52 at 9c1b133: http://git.io/y64yXQ
04:51 good_news_everyone left #mojo
04:54 good_news_everyone joined #mojo
04:54 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/UpW85Q
04:54 good_news_everyone mojo/master 5cf86ba Sebastian Riedel: consistent quoting style
04:54 good_news_everyone left #mojo
04:55 preflex_ joined #mojo
04:58 sri lets hope for the best
05:01 crab bright lights and angels singing?
05:15 lizzin joined #mojo
05:57 den4ik joined #mojo
05:57 den4ik hi
05:58 den4ik Can anyone help me with hypnotoad?
05:59 den4ik I run it on my linux box, and have no see mojo proccess in ps
05:59 den4ik # ./lib/mojo/script/hypnotoad ping.pl
06:00 den4ik How to debug it? (Why it cannot start).
06:00 den4ik OS: Debian GNU/Linux 6.0, Mojo: 4.50
06:19 basiliscos joined #mojo
06:21 dotandimet joined #mojo
06:23 firnsy den4ik: run it in the foreground "-f" to see if you have any errors being supressed
07:04 dpetrov_ joined #mojo
07:29 highflying joined #mojo
07:29 Vandal joined #mojo
07:32 dotandimet joined #mojo
07:38 denis_boyun joined #mojo
07:53 iSlug joined #mojo
07:54 martin joined #mojo
07:54 rem_lex|pivo joined #mojo
07:56 martin anyone offer me a bit of advice ?  I'm trying to add helpers to a full mojo app (e.g not lite) , but not sure of the correct syntax to use , there seems to be lots of documentation for the Lite syntax, but I can't find it for the full mojo
07:59 dod joined #mojo
08:00 firnsy martin: $self->helper(name_of_your_helper => sub {});
08:02 martin thx, stupid typing mistake my side !     can I ask another quick question whilst you're here ?
08:03 martin I'm breaking my app down into a model anmd various Controllers, is it better to just stick with full mojo apps everywhere or use a mixture of Lite and full ?   whats the done thing ?
08:09 trone joined #mojo
08:10 firnsy martin: i use a mix of both
08:11 martin I'm beginning to think that might be easier for me to begin with.  thx
08:11 firnsy ... i use lite for small REST services
08:11 firnsy ... and grow to full, if anything more than a dozen routes
08:12 firnsy you'll find your flow
08:16 martin thx again,   off to consufe myself for a while !
08:17 martin s/consufe/confuse
08:18 hrupp joined #mojo
08:23 martin_ joined #mojo
08:24 dod joined #mojo
08:27 Kundun joined #mojo
08:27 fhelmber_ joined #mojo
08:57 martin joined #mojo
08:59 martin joined #mojo
09:01 themage joined #mojo
09:04 arthas joined #mojo
09:05 arthas joined #mojo
09:06 dotandimet joined #mojo
09:13 fhelmbe__ joined #mojo
09:23 basic6_ joined #mojo
09:35 maxhq joined #mojo
09:37 martin joined #mojo
09:43 dotandimet joined #mojo
09:47 yannickberthoud joined #mojo
09:53 dotandimet joined #mojo
10:43 odc is there a way to set the default cookie_name in a Lite app?
10:46 odc nvm found it
10:47 tba_ joined #mojo
11:02 d4rkie joined #mojo
11:03 gedge joined #mojo
11:04 rem_lex| joined #mojo
11:04 mtj joined #mojo
11:06 gedge_ joined #mojo
11:08 dotandimet joined #mojo
11:10 denis_boyun joined #mojo
11:12 gedge joined #mojo
11:18 d4rkie joined #mojo
11:21 marty joined #mojo
11:27 punter joined #mojo
11:42 denisboyun joined #mojo
11:47 punter joined #mojo
11:48 maxhq joined #mojo
11:51 mire_ joined #mojo
11:57 jberger sri++ powerman++
11:57 jberger looks good
11:57 jberger martin, Lite is a very thin wrapper actually
11:58 jberger fwiw, I only use Lite for examples and for the tiniest of apps
11:58 jberger I tend to move to full very quickly
12:08 forke joined #mojo
12:11 forke Hello… I've a quick nooby question :) … I'll display always the supervisord status (I create a little module for this) on my layout page… by different pages like /dashboard /health or /log … and now I search a good solution, to find a way that I display the information on each page, without add the function to stash on each sub url.. has someone a better idea :)
12:11 forke I hope it make sense
12:12 moritz forke: put it in the layout?
12:12 moritz and the logic in an under() ?
12:12 * moritz has no idea if that's sane
12:14 forke hmm… yes I'll use the variable in the layout… this is clear… like the session information with username …. but at the moemnt I'm not sure how I can add it to my mojo code like any '/dashboard' => sub {}….  but I hope I find a solution :)
12:16 moritz 'under' seems to apply here.
12:16 forke ok thank you
12:21 forke ok done :) And it work for every page :) thank you
12:21 moritz \o/
13:11 fhelmber_ joined #mojo
13:13 ryozi joined #mojo
13:15 D4RK-PH0ENiX joined #mojo
13:20 bluescreen joined #mojo
13:21 bluescreen_ joined #mojo
13:22 bluescreen__ joined #mojo
13:28 lizzin joined #mojo
13:34 bluescreen joined #mojo
13:35 asarch joined #mojo
13:38 sri \o\
13:38 sri /o/
13:38 nic \o.....\
13:39 * nic was never any good at skiing
13:44 batman http://weblog.bocoup.com/building-m​ultiplayer-html5-games-with-cloak/ # anyone who wants to port this to mojo?
13:47 dqw111 joined #mojo
14:18 sri powerman, jberger: i think we've made a mistake with the eventemitter patch though
14:18 sri logic error
14:18 powerman where?
14:18 sri with the error event
14:18 sri it can't really be emitted safely
14:26 martin joined #mojo
14:32 sri we either have to make failed error events warn again, or document that they are always fatal
14:32 sri second case also means that we could remove some code
14:33 sh4 joined #mojo
14:38 sri oh, and i found a ->once bug :)
14:38 sri which can make errors disappear
14:50 gryphon joined #mojo
14:50 good_news_everyone joined #mojo
14:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/gA9Apw
14:50 good_news_everyone mojo/master 652596e Sebastian Riedel: fixed a few unsubscribe and error event bugs in Mojo::EventEmitter
14:50 good_news_everyone left #mojo
14:50 sri core question is if a failed error event should be fatal, which i think we agreed it should
14:56 sri powerman, jberger, tempire, marcus, crab: if i'm wrong please correct me
14:59 powerman sri: 1 sec, I'll check it
14:59 btyler joined #mojo
15:06 dqw112 joined #mojo
15:07 good_news_everyone joined #mojo
15:07 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/1tKVyw
15:07 good_news_everyone mojo/master dd8d6db Sebastian Riedel: mention that the error event in Mojo::Reactor is dangerous
15:07 good_news_everyone left #mojo
15:09 powerman sri: I think unsubscribe() isn't really fixed yet
15:09 sri powerman: how so?
15:09 powerman when you add handler and then remove it you'll get [] in {events}{$name}
15:10 powerman so it's either should be fixed more to replace [] with undef
15:10 sri that's what i fixed and added a test for
15:10 powerman or that fix in unsubscribe should be removed and emit/emit_safe should check is there are any handlers by testing both for undef and []
15:11 sri powerman: please make a test case
15:11 powerman ok, 1 min
15:13 powerman ohh, I looked at 4.52 source, sorry
15:14 sri heh
15:14 * sri sets powerman on fire
15:14 powerman but your current code didn't check it's really $cb in {events}{$name}
15:14 powerman yep :(
15:15 powerman so, if there are two different handlers for that event, and we do unsubscribe($handler1) twice by mistake - we'll remove both
15:16 sri also not true
15:17 sri or actually it is
15:17 sri hmm
15:23 good_news_everyone joined #mojo
15:23 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/YW-Wuw
15:23 good_news_everyone mojo/master b98b86e Sebastian Riedel: made unsubscribe a little smarter
15:23 good_news_everyone left #mojo
15:23 powerman and one more thing. I'm not sure current version will actually bubble error events
15:35 sh4|2 joined #mojo
15:40 sri powerman: no idea what you mean
15:42 powerman is it possible to catch exception in, say, UserAgent->on(error) handler using reactor->on(error) handler?
15:43 good_news_everyone joined #mojo
15:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/_5WHhw
15:43 good_news_everyone mojo/master 5f19dfc Sebastian Riedel: better unsubscribe tests
15:43 good_news_everyone left #mojo
15:43 powerman I think this feature is needed to be able to setup top-level catch-all error handler on reactor
15:43 sri no that's not possible, and i thought that was intentional
15:43 powerman for example, to make sure old behaviour with converting all exceptions into warn() be possible
15:44 sri i'm having a hard time following you
15:44 sri that's the exact thing i asked about earlier
15:45 beyondcreed joined #mojo
15:45 sri or is it not?
15:48 powerman sri: yeah, for me it's fine if it will throw exceptions like now, but you've wanted to keep default behaviour compatible with previous versions, and this is what I'm trying to check now
15:49 sri powerman: i have no interest in keeping the old behavior, what matters is what the documentation says and is actually tested
15:49 sri we only consider things that are documented *and* tested to be features
15:50 powerman ahh, ok then
15:50 sri atm. i care about correctness
15:51 dqw112 joined #mojo
15:54 sri big question for today is if this line is correct https://github.com/kraih/mojo/blob/​master/lib/Mojo/EventEmitter.pm#L30
15:55 sri if an error event fails in ->emit_safe, it gets emitted again with ->emit, and if it fails there dies
15:56 sri we don't emit_safe error events anymore... so it's more of a theoretical correctness question
15:57 powerman looks good for me, but I'm not writing tests to make sure it works as I think
15:57 powerman s/not/now/
15:57 sri i've already written tests for it
15:57 sri https://github.com/kraih/mojo/blob​/master/t/mojo/eventemitter.t#L29
15:58 sh4 joined #mojo
15:58 sri it's also a funny test case for ->once
16:01 sri powerman: btw. i've added a note to make people aware of the risks of messing with the reactor error event http://mojolicio.us/perldoc/Mojo/Reactor#error
16:05 good_news_everyone joined #mojo
16:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/N0A3Mw
16:05 good_news_everyone mojo/master 892e9c9 Sebastian Riedel: mention that error event needs to be handled
16:05 good_news_everyone left #mojo
16:06 sri damn, this stuff is hard
16:10 sri LETS GO SHOPPING
16:15 martin is there a way to loop through an array returned from a helper directly in a template ?   I'm returning this  > return $sth->fetchall_arrayref;    ,  I can loop through a hashref or array ref if they're passed back in the stash, but I can't seem to find it documented how to do this for a helper
16:17 rem_lex|pivo joined #mojo
16:19 powerman sri: are we still need https://github.com/kraih/mojo/bl​ob/master/lib/Mojo/IOLoop.pm#L26 if there is no more "error" event bubbling?
16:19 sri powerman: yes, very much so
16:19 abhishekisnot joined #mojo
16:20 sri by default it should be impossible to bring down a mojolicious server with a normal exception
16:20 powerman btw, maybe we should reconsider "error" bubbling - it's very natural to how try/catch works, so it's probably not a bad idea
16:20 sri maybe i don't understand what you mean
16:21 powerman right now if "error" event happens on, for example, UserAgent - it will crash all server
16:21 sri "Mojo::IOLoop->timer(3 => sub { die })" should not be able to kill the server
16:21 sri unless you unsubscribe the error event from the reactor
16:21 powerman timer won't kill the server, but $ua->get(, sub{ die }) will kill it
16:22 powerman because there is no default handler for $ua->on(error)
16:23 sri a) it would end up in the reactor error event b) there actually us for mojolicious apps https://github.com/kraih/mojo​/blob/master/lib/Mojo.pm#L21
16:23 powerman so, you either should add default ->on(error=>sub{warn $_[1]}) handlers for all classes… or restore "error" bubbling behaviour
16:25 sri perl -Mojo -E 'my $ua = Mojo::UserAgent->new; a(sub { my $self = shift; $ua->get("mojolicio.us" => sub { die }) })->start' get /
16:26 sri not a problem for the built-in servers, and for everything else we don't care
16:31 dod joined #mojo
16:31 Vandal joined #mojo
16:38 marty martin:  yes you can.    https://gist.github.com/MadMartigan/7218147
16:39 powerman sri: I get it! while there is no real bubbling for 'error' in emit/emit_safe not all events fired using emit/emit_safe - reactor fire events using _sandbox, which use eval
16:40 sri yea :)
16:41 powerman so, exceptions in any events, including 'error' events on all classes except reactor catched by reactors 'error' event, and only exception in reactor's 'error' event handler is fatal for server
16:41 bowtie_ joined #mojo
16:41 sri exactly
16:41 powerman ok, then everything is really fine! :)
16:41 sri \o/
16:46 martin marty:   thankyou,  that helps a lot
16:56 markus joined #mojo
16:56 markus Hello!
16:56 markus First of all, nice Project ;-)
16:57 russum joined #mojo
16:57 mire_ joined #mojo
17:02 markus I try to write a application with some controller (handler) and some static content (javascript files, images, ...). My problem is, that i have a folder /public/ with my public content. When the server now is listening to localhost:8888 the server links localhost:8888/test.html to my public folder. Is it possible to link only localhost:8888/public/
17:02 markus ... to my public directory? http://nopaste.info/82c2ec1f72.html here is my code.
17:03 lizzin joined #mojo
17:05 dqw112 joined #mojo
17:30 batman markus: why do you want that?
17:30 markus hmm, i'm replacing an old project, and there are a lot of existing links
17:31 markus when i now change the location, there will be a lot of 404 Requests
17:31 ladnaV joined #mojo
17:31 batman It is possible: add a directory inside public, named public :)
17:31 markus yeah, that was my first idea, but thats.... not so nice :D
17:31 batman Or make an internal redirect in the frontend server
17:31 marcus Sounds perfect to me
17:31 marcus for what you want
17:32 batman Do you use nginx or apache as reverse proxy..?
17:32 markus no, only the daemon.
17:33 batman Directly connected to Internet?
17:33 markus Its en embedded application
17:33 markus running in an intranet
17:33 markus so its directly listening on an defined port
17:33 markus is that what you mean?
17:34 batman Ok. Unix/ Linux or something else?
17:34 markus Thats not defined, its a lot, from fritz!box to ...... raspi, everthing should be possible ;)
17:35 markus hmm perhaps i really do it with /public/public
17:35 batman Ok. If you where running on Linux, you could make a symlink.
17:36 markus yes. I think i do /public/public
17:36 markus so its not possible to add a route to a static folder?
17:36 batman Then both /public/foo.txt and /foo.txt would work
17:36 markus that would be great ;)
17:37 batman Yes. You can. But I'm chatting on a phone, so it's a bit difficult to explain :/
17:37 batman Check out Mojolicious::Static
17:37 markus $route->any( '/public/' )->to(A STATIC FOLDER);
17:37 nic markus: you don't need to have your static stuff in 'public'
17:38 markus thats what i try at the moment
17:38 nic You can use www/public and www/lan (or whatever)
17:38 markus nic: yes, i know this, but my problem isn't the local location
17:39 martin joined #mojo
17:39 batman nic: it's the other way around.
17:39 markus it's the url server:port/ddd => www/public/ddd and what i want is server:port/public/ddd => www/public/ddd
17:40 nic isn't that what I just said?
17:41 markus no, you explain the other way? Or i don't understand you :D
17:41 markus www/public/ddd is not the problem
17:42 nic app->static->paths->[0] = app->home->rel_dir('www');
17:42 markus I'm able to change this in every location on my hdd
17:42 nic gives you exactly what you asked for
17:42 markus than is server:port/test => www/test?
17:43 batman nic: no. It's the other way around
17:43 nic I'm guessing I'm not understanding the use of "=>"
17:43 markus links to
17:43 markus ;-)
17:44 batman markus: it would be super easy in *nix
17:44 batman Since you have symlinks...
17:44 markus yipp, but thats not possible :/
17:45 batman I'm home in about 15 minutes. Stick around and I'll tell you how in mojo
17:45 markus isn't it possible to make a route with $route->any("/public")->to a Mojolicious::Static?
17:45 batman It is
17:46 markus yeah that would be great! But im away for one houre
17:46 markus -e
17:46 batman That's what Mojolicious.pm does
17:46 markus Lets write, when you are back okay?
17:46 markus and me, too ;)
17:49 markus2 joined #mojo
17:49 lizzin joined #mojo
17:58 denisboyun joined #mojo
17:58 sri http://mojolicio.us/perldoc/Mojolicious/​Guides/Rendering#Rendering_static_files
18:00 good_news_everyone joined #mojo
18:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/m8twjA
18:00 good_news_everyone mojo/master a7a0779 Sebastian Riedel: mention that error events need to be handled in all classes
18:00 good_news_everyone left #mojo
18:07 batman markus: this is the easiest way: $app->routes->get('/public/*sr')->to(cb => sub { $_[0]->redirect_to($_[0]->stash('sr')) });
18:09 marcus sri: I think so too, yeah.
18:10 sri batman: make it at least a permanent redirect
18:11 sri btw. i like ->get("/..." => sub {...}) more than the ->to(cb => sub {...}) version
18:11 sri marcus: redirect is good because you don't have to worry about access control
18:12 * marcus has been spoilt by sinatra lately
18:12 marcus get '/' do "OH HAI" end
18:14 Vandal joined #mojo
18:15 sri sinatra sucks for async too though
18:15 batman markus: http://p.thorsen.pm/ef185fa605d4
18:15 KindTwo joined #mojo
18:15 sri marcus: you can have that too though with the around_action hook ;p
18:17 marcus sri: It probably does. Nothing async about this app actually.
18:20 * batman need to make dinner. good luck markus
18:20 batman confusing with markus and marcus
18:20 batman :P
18:21 marcus I was here first!
18:21 sri MAY THE REAL MARCUS PLEASE STAND UP
18:25 markus sooo now im back
18:25 batman :)
18:26 batman markus: scroll back to the paste i sent...
18:26 markus yes, moment
18:27 batman "sr" can be replaced with "asdkjsandkja" if you like
18:28 marcuz marcus: dude!
18:29 marcus wass
18:29 marcus I don't even
18:29 batman hm... bug in wirc :/
18:29 marcus unpossible!
18:30 batman http://screencloud.net/img/screenshots​/45fb9fab7b78821a56b6454347a78331.png # didn't enter an invalid nick and did not change back
18:30 * marcus is almost ready to open up http://ranked.no/
18:30 markus yeah it works, thanks!
18:31 batman sweet
18:31 KindTwo joined #mojo
18:31 markus But one more question, is it now possible to disable the listening / ?
18:31 markus now its possible to request the file with /public/file.html
18:32 markus but also with /file.html
18:32 batman why do you want to deny that??
18:32 markus hmmm
18:33 markus That every file only has one link ;)
18:33 markus but its only a nice to have
18:34 batman $app->static->paths([]);
18:34 batman no
18:34 batman sorry
18:34 batman don't do that
18:34 markus :D
18:36 markus owwww mojo is really nice :D
18:36 markus i have to say this again^^
18:39 batman tell your friends :)
18:39 batman or tweet
18:40 markus ;-)
18:42 lizzin joined #mojo
18:50 good_news_everyone joined #mojo
18:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/9jBjKg
18:50 good_news_everyone mojo/master 649ac29 Sebastian Riedel: mention reactor in sandbox error messages
18:50 good_news_everyone left #mojo
18:52 trone joined #mojo
18:53 asarch joined #mojo
18:56 good_news_everyone joined #mojo
18:56 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/eR3spQ
18:56 good_news_everyone mojo/master 7e172e7 Sebastian Riedel: mention reactor class in warning
18:56 good_news_everyone left #mojo
18:57 marcuz that's nicer
18:58 sri perl -Ilib -Mojo -E 'my $ua = Mojo::UserAgent->new; a(sub { my $self = shift; $ua->get("mojolicio.us" => sub { die }) })->start' get /
18:58 sri Mojo::Reactor::EV: Read failed: Mojo::UserAgent: Event "read" failed: Died at -e line 1.
19:09 dod joined #mojo
19:14 Mike-PerlRecruiter_ joined #mojo
19:19 fhelmber_ joined #mojo
19:21 rem_lex joined #mojo
19:26 martin joined #mojo
19:31 bpmedley_ joined #mojo
19:33 martin joined #mojo
19:36 bpmedley__ joined #mojo
19:58 asarch joined #mojo
20:14 punter joined #mojo
20:31 lukep joined #mojo
20:51 good_news_everyone joined #mojo
20:51 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/lCMD8g
20:51 good_news_everyone mojo/master 089936f Sebastian Riedel: small optimizations
20:51 good_news_everyone left #mojo
20:55 lizzin joined #mojo
21:06 bluescreen_ joined #mojo
21:07 bluescreen__ joined #mojo
21:39 sri book thread popped up on the list again
21:44 punter joined #mojo
21:50 markus hmmm
21:52 markus When i use $self->session->{foo} = 'bar'; and $self is my Mojo::Base, do i have to initiate the session before?
21:52 markus in the documentation on http://mojolicio.us/perldoc/M​ojolicious/Controller#session i didn't see something like this, but my example doesn't work :/
22:07 markus i tried to store $self->session->{foo} to my $test, after that i printed $test and got the message "Use of uninitialized value $test"...
22:07 markus that looks strange for me..
22:12 dotandimet joined #mojo
23:06 gedge joined #mojo
23:18 maxhq joined #mojo
23:27 dqw112 joined #mojo
23:31 russum joined #mojo
23:45 bluescreen_ joined #mojo
23:56 jberger_ joined #mojo
23:58 jberger_ Holy carp! I just watched Stevan's p5 mop video and I WANT IT NOW!
23:58 tadamo joined #mojo
23:58 tadamo joined #mojo

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