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

IRC log for #mojo, 2014-07-27

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

All times shown according to UTC.

Time Nick Message
00:07 sjn oh noes!
00:07 woz joined #mojo
00:20 thowe lb, I get the same complaint with   <% if (stash 'error') { %><div><%= $error %></div><% }; =%>   as I was getting before if I don't set a default 'error'.
00:43 thowe the code sections of the online docs suddenly have much smaller fonts.
00:46 sri well, you wanted working links, you can't have big fonts and working links ;p
00:46 thowe Oh.  OK then.
00:49 thowe I'll take the broken anchors again, then, if I have a choice...  =]
00:50 good_news_everyon joined #mojo
00:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/FUhdvA
00:50 good_news_everyon mojo/master e11921b Sebastian Riedel: improved documentation browser CSS
00:50 good_news_everyon left #mojo
00:50 * thowe actually got a Lite app to do something he wanted today o/
00:50 sri \o/
00:51 thowe damn, sri.  You make the happy happen right away every time.  Thank you!
00:51 * sri really needs to sleep... but it's still too warm :/
00:51 thowe I've slept for two days straight after some minor surgery...  I felt like I needed to do something.
01:11 woz joined #mojo
01:47 klapperl_ joined #mojo
02:20 noganex_ joined #mojo
02:24 woz joined #mojo
03:29 woz joined #mojo
04:25 gatitskiy joined #mojo
04:30 sujithm joined #mojo
04:31 dj_goku so I am building a REST api (using json) and when I don't find a particular record I am currently returning "null". How is this handled normally? I have thought of adding a metadata attribute but not sure how that would help.
04:31 woz joined #mojo
04:32 preaction how about returning a status => 404?
04:39 dj_goku would you also return status on good requests too?
04:41 preaction good requests already get a status of 200
04:41 preaction this is the http status code, not a response body
04:42 preaction you could additionally respond with something like: { error => 'Could not get "<thing you tried to get>"' } as a human-readable error message
04:42 preaction but the important bit is the http status code 404
04:49 dj_goku hmm interesting
04:50 dj_goku I should probably find something to read about RESTish api implementations.
04:57 KCL_ joined #mojo
04:57 KCL joined #mojo
04:58 dj_goku preaction: thanks
05:23 Vandal joined #mojo
05:36 woz joined #mojo
05:57 ryozi joined #mojo
06:41 woz joined #mojo
06:45 woz joined #mojo
06:56 sujithm joined #mojo
07:08 rwp joined #mojo
07:11 dod joined #mojo
07:27 _eugen joined #mojo
07:44 punter joined #mojo
07:54 lb thowe: that's exactly what i said
07:54 woz joined #mojo
08:24 mire joined #mojo
08:44 basiliscos joined #mojo
08:50 zivester joined #mojo
08:57 rwp joined #mojo
09:00 woz joined #mojo
09:24 denis_boyun joined #mojo
09:29 rwp joined #mojo
09:54 sh4 joined #mojo
10:01 woz joined #mojo
10:09 D4RK-PH0ENiX joined #mojo
10:09 sh4|2 joined #mojo
10:11 sh4|3 joined #mojo
10:18 neyasov_ joined #mojo
10:32 D4RK-PH0ENiX joined #mojo
10:39 neyasov__ joined #mojo
10:41 neyasov___ joined #mojo
10:44 mattastrophe joined #mojo
10:55 basiliscos joined #mojo
10:58 neyasov____ joined #mojo
11:02 woz joined #mojo
11:02 DerShokus joined #mojo
11:03 DerShokus hi! Can somebody help?
11:04 DerShokus I include template from main.html.ep "%= include 'main/header'
11:06 DerShokus and in the Controller write "$self->render(param_name => param_value);
11:06 DerShokus but I get an error "Bareword "param_name" not allowed while "strict subs" in use at template "main/header.html.ep" "
11:07 DerShokus help me please :'(
11:09 batman probably two bugs: $self->render(param_name => param_value) <--- param_value...?
11:09 batman and you need $param_value in the template. not param_value.
11:09 batman all the variables are scalars (or scalar refs) in the template.
11:11 batman DerShokus: i think you need to run through the lite tutorial
11:11 batman https://metacpan.org/pod/Mojolicious::Lite and https://metacpan.org/pod/Mojolicious::Lite#Stash-and-templates
11:13 DerShokus oh, I had read
11:14 * batman will try not to start an argument
11:14 DerShokus yes, a call render like this $self->render('param_name' => 'param value',)
11:15 DerShokus from controller "Main" in sub main
11:15 DerShokus and in the templates dir i have main.html.ep and header.html.ep
11:16 DerShokus in header.html.ep : <%= param_name %>
11:17 DerShokus in main.html.ep: % layout 'main'\n % titile 'example'\n %= include 'main/header'
11:19 batman and you need $param_value in the template. not param_value. <-------------------------------------
11:20 batman DerShokus: i won't spend more time trying to explain when you fail to read.
11:21 DerShokus oooo, thank you. thank you so much!
11:22 sri batman: be nice
11:22 DerShokus excuse me for stupid question
11:22 batman i'm trying to :(
11:22 batman DerShokus: the question is not stupid.
11:23 sri i know how frustrating it can be ;p
11:23 sri welcome to my world!
11:24 DerShokus I read this tutorial three times. thanx!
11:29 sri i'dd be damned...
11:29 sri *i'll
11:30 sri jamadam already backported mojolicious 5.20 :O
11:30 batman wow.
11:30 batman impressive :)
11:30 sri jamadam++
11:32 sri oh of course... he already needed to handle Pod::Simple::HTML as a special case... since on Perl 5.8 it was not available or broken https://github.com/jamadam/mojo-legacy/commit/41b41fe0a66658fd628b7100798e718a0eae8a32#diff-8ba7992c8651f06d0182159daf4cea72L9
11:33 sri still very impressive
11:36 sri makes me wonder if we should just declare Pod::Simple 3.09 as a dependency in Makefile.PL
11:37 sri maybe better than the hard exception when you load the PODRenderer plugin
11:40 batman I don't get why my Mojo::IOLoop delay solution is an antipattern... https://github.com/kraih/mojo/pull/655#issuecomment-50262169
11:41 neyasov____ joined #mojo
11:44 mr-foobar joined #mojo
11:45 good_news_everyon joined #mojo
11:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/VillDg
11:45 good_news_everyon mojo/master 021b944 Sebastian Riedel: improved handling of Pod::Simple::XHTML 3.09 dependency
11:45 good_news_everyon left #mojo
11:45 sri now it works on 5.10.1 but we are only dep free after 5.12
11:47 batman sri: do you get https://github.com/kraih/mojo/pull/655#issuecomment-50262169 ?
11:48 sri i'm starting to understand something
11:48 batman ok..?
11:52 sri he wants promises
11:52 batman :)
11:55 batman sri: can i ask what he means about the "antipattern" statement?
11:55 batman or will that just trigger a *religious* war..?
11:57 sri i have no idea what he meant, but i try to avoid discussions about semantics with non-native english speakers
11:57 batman makes sense.
12:01 good_news_everyon joined #mojo
12:01 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/K7DjKQ
12:01 good_news_everyon mojo/master b2f027a Sebastian Riedel: fixed Pod::Simple dependency
12:01 good_news_everyon left #mojo
12:01 sri i'm a doofus
12:01 sri but nobody else noticed either -.-
12:04 woz joined #mojo
12:09 sri batman" i'll close the pull request... don't like how the discussion is going circles
12:09 batman sri++
12:15 DerShokus joined #mojo
12:19 sri hmmmmm
12:19 sri i guess this is now a lie with the Pod::Simple 3.09 requirement
12:19 sri "Very clean, portable and Object Oriented pure-Perl API without any hidden magic and no requirements besides Perl 5.10.1 (although 5.18+ is recommended, and optional CPAN modules will be used to provide advanced functionality if they are installed)"
12:19 sri we are only dep free on Perl 5.12+
12:21 sri if i change that to "...no requirements besides Perl 5.12.0..." it looks like we don't work on 5.10.1... and if i mention Pod::Simple it reads terrible :S
12:22 batman maybe you should just "forget" about it and fix it if someone complains..?
12:22 * batman tries to find the solution with least effort :(
12:22 lb require 5.20 and damn the torpedos
12:23 sri don't make me cry :(
12:23 sri ...the thought of using signatures everywhere...
12:23 sri :,(
12:24 lb i wish os-vendors stopped shipping perl
12:25 batman that's the weirdest thing i've heard... in a looooooooooooooong while
12:26 lb thanks
12:26 batman :)
12:30 basic6 joined #mojo
13:07 good_news_everyon joined #mojo
13:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ac9y-Q
13:07 good_news_everyon mojo/master 0f39ea8 Sebastian Riedel: use $c consistently
13:07 good_news_everyon left #mojo
13:09 woz joined #mojo
13:12 human39 joined #mojo
13:22 mattastrophe joined #mojo
13:40 mattastrophe joined #mojo
13:53 denis_boyun joined #mojo
13:59 batman joined #mojo
13:59 jberger_ joined #mojo
13:59 marcus joined #mojo
14:18 woz joined #mojo
14:18 zivester joined #mojo
14:29 lipizzan joined #mojo
14:31 berov joined #mojo
14:34 good_news_everyon joined #mojo
14:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ciffWQ
14:34 good_news_everyon mojo/master e4359b0 Sebastian Riedel: a few more val examples
14:34 good_news_everyon left #mojo
14:36 sujithm joined #mojo
14:49 batman sri: https://gist.github.com/jhthorsen/c268a31539920c12699b # am i using delay wrong? i mean, the return in the second step, will that cause the delay object to stay around forever?
14:50 batman (line 12)
14:57 marcus joined #mojo
14:57 jberger_ joined #mojo
14:57 batman joined #mojo
15:00 thowe So...  I make an offhand comment yesterday and next thing I know Mojo requires 5.12.  Butterfly effect.
15:00 good_news_everyon joined #mojo
15:00 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/J34ssA
15:00 good_news_everyon mojo/master 1706372 Sebastian Riedel: better list formatting
15:00 good_news_everyon left #mojo
15:01 sri batman: http://mojolicio.us/perldoc/Mojo/IOLoop/Delay#steps
15:21 woz joined #mojo
15:26 denis_boyun joined #mojo
15:38 asarch joined #mojo
15:38 asarch Using TT, you could do [% content | html %] to prevent HTML escaping. How do you do the same with EP?
15:45 batman sri: not sure if that answers my question :/ my best guess is that the counter never reach zero, so the last steps are always kept around..?
15:45 batman asarch: %= content
15:46 batman <%= $escape_this %> <%== $do_not_escape_this %>
15:49 sri batman: "This chain will continue until there are no more callbacks, a callback does not increment the active event counter or an error occurs in a callback."
15:51 asarch Thank you
15:51 asarch Thank you very much :-)
15:51 batman asarch: you're welcome :)
15:52 batman sri: ah! now i get it :) sweet.
15:52 sri \o/
15:53 batman i had to read the source code though :P
15:53 batman "a callback does not increment the active event counter" <-- i guess this is the same as "a callback does not call begin()"
15:58 marcus joined #mojo
15:58 jberger_ joined #mojo
15:58 batman joined #mojo
15:59 batman left #mojo
15:59 batman joined #mojo
16:00 dod joined #mojo
16:22 sujithm joined #mojo
16:23 woz joined #mojo
16:24 denis_boyun joined #mojo
16:38 DerShokus joined #mojo
16:42 sri batman: no it is not, other methods like pass may also increment it
16:43 batman true.
16:44 Insane joined #mojo
17:08 sujithm_ joined #mojo
17:11 jberger_ joined #mojo
17:11 batman joined #mojo
17:11 marcus joined #mojo
17:13 hesco1 joined #mojo
17:13 sujithm joined #mojo
17:14 btyler joined #mojo
17:17 d4rkie joined #mojo
17:19 D4RK-PH0ENiX joined #mojo
17:24 woz joined #mojo
17:51 davido_ joined #mojo
18:22 batman joined #mojo
18:22 marcus joined #mojo
18:22 jberger_ joined #mojo
18:28 woz joined #mojo
18:47 good_news_everyon joined #mojo
18:47 good_news_everyon [mojo] kraih tagged v5.21 at 6443bcf: http://git.io/WI9-LA
18:47 good_news_everyon left #mojo
18:48 good_news_everyon joined #mojo
18:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/tDcCsw
18:48 good_news_everyon mojo/master 7547c79 Sebastian Riedel: bump version
18:48 good_news_everyon left #mojo
18:56 zz_Foxcool joined #mojo
18:56 samb1 joined #mojo
18:59 berov joined #mojo
19:08 neyasov____ joined #mojo
19:12 Insane joined #mojo
19:15 denis_boyun joined #mojo
19:22 asarch In the template: % if ($user eq "asarch") {
19:22 asarch <%= "Perl" %>
19:22 asarch % } else {
19:23 asarch <%= "C++" %>
19:23 asarch % }
19:23 asarch Can you do that in-line?
19:23 asarch I mean, in just one line?
19:24 Insane yes
19:24 asarch How?
19:24 Insane <% if ... %><%= "Perl" %> <% } else { %> and so on
19:24 asarch GOTCHA!!!
19:24 asarch Thank you
19:24 asarch Thank you very much :-)
19:25 Insane u're welcome ;)
19:25 asarch :-)
19:25 batman pastebin?
19:25 purl i guess pastebin is see nopaste. or see shadowpaste
19:25 batman asarch: ^
19:25 asarch ?
19:29 woz joined #mojo
19:33 denis_boyun_ joined #mojo
19:33 sri asarch: he means that you should not paste code into the channel
19:38 sri asarch: i've seen you use paste sites before, so you do know better
19:46 asarch Oh, I really sorry
19:46 asarch I'm sorry
19:47 asarch My application can now sort by date, id, login, etc, all the entries :-)
19:50 asarch Thank you guys, thank you very much for saving me from PHP and RoR
20:15 basiliscos joined #mojo
20:33 woz joined #mojo
20:39 mattastrophe joined #mojo
21:27 KCL joined #mojo
21:27 KCL_ joined #mojo
21:36 woz joined #mojo
21:55 zivester joined #mojo
22:37 woz joined #mojo
23:00 basiliscos joined #mojo
23:04 mire joined #mojo
23:11 D4RK-PH0ENiX joined #mojo
23:14 romel joined #mojo
23:14 romel hello guys. what is the best approach to localize a long text with l18n ?
23:17 romel is it reasonable to put it into %Lexicon of my l18n subclasses?
23:32 Insane joined #mojo
23:38 woz joined #mojo
23:57 voegelas joined #mojo

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