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

IRC log for #mojo, 2015-11-04

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

All times shown according to UTC.

Time Nick Message
00:02 miquelet joined #mojo
00:07 FatalNIX wow, never heard of that module before.
00:08 FatalNIX Seems a bit overkill heh
00:08 preaction eh, i generally already have Test::Deep because i'm writing tests with it
00:29 PopeFelix joined #mojo
00:32 asarch joined #mojo
00:33 Ptolemarch joined #mojo
00:33 PopeF joined #mojo
00:37 mattastrophe joined #mojo
00:43 mattastrophe1 joined #mojo
00:53 mattastrophe joined #mojo
01:01 jontaylor joined #mojo
01:04 disputin joined #mojo
01:27 Ptolemarch joined #mojo
01:36 Gedge joined #mojo
01:42 zivester joined #mojo
01:44 aborazmeh joined #mojo
02:11 disputin joined #mojo
03:05 cpan_mojo WWW-Crawler-Mojo-0.15 by JAMADAM https://metacpan.org/release/JAMADAM/WWW-Crawler-Mojo-0.15
03:09 CandyAngel joined #mojo
03:34 Ptolemarch joined #mojo
04:02 kaare_ joined #mojo
04:11 PopeFelix joined #mojo
04:13 PopeF joined #mojo
04:27 mattastrophe joined #mojo
04:28 Ptolemarch joined #mojo
04:31 PopeFelix joined #mojo
04:36 mattastrophe joined #mojo
05:21 Phil22 joined #mojo
05:39 mattastrophe joined #mojo
06:06 dhg joined #mojo
06:34 Ptolemarch joined #mojo
06:39 marcusr yay github leetness
06:39 marcusr I also have a lower 3 digit slashdot id :p
06:49 preaction woo!
06:54 marcusr omg blizzard owns candy crush. I'm playing the same franchise as my wife.. :-o
06:59 Grinnz marcusr, whats your ICQ number :P
07:07 pink_mist marcusr: yeah, been big news here in sweden how the makers of that were bought for many many SEKs :P
07:08 pink_mist on a side note, I like how the swedish currency sounds naughty
07:28 Ptolemarch joined #mojo
07:44 osfabibisi joined #mojo
07:50 marcusr Grinnz: I met my wife on icq ;)
07:51 marcusr "tinder for old people".
07:51 Adurah joined #mojo
08:03 jontaylor joined #mojo
08:16 eseyman joined #mojo
08:19 Vandal joined #mojo
08:22 trone joined #mojo
08:23 Ptolemarch joined #mojo
08:24 AndrewIsh joined #mojo
08:36 kes joined #mojo
09:38 sri \o\
09:38 sri /o/
09:46 cpan_mojo Mojolicious-Plugin-RequestBase-0.2 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-RequestBase-0.2
09:51 sh4 joined #mojo
09:52 kes HI. Why after redirect_to mojo still rendering content?
09:54 nic that question is a little... vague
09:54 carneirao joined #mojo
10:00 nicomen kes: it could be because it seems redirect_to just set redirection headers and emits an after_dispatch event, but it doesn't stop rendering, or close the connection. You might need an explicit return out of your controller after a redirect_to call IIRC.
10:00 kes nicomen: thank you
10:03 good_news_everyon joined #mojo
10:03 good_news_everyon [mojo] kraih tagged v6.29 at e70c479: http://git.io/vldk4
10:03 good_news_everyon left #mojo
10:03 kes There one more interesting thing: Mojolicious::Controller:325 - code always make path absolute even if we do relative redirections
10:05 good_news_everyon joined #mojo
10:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vldIV
10:05 good_news_everyon mojo/master 0ebd061 Sebastian Riedel: bump version
10:05 good_news_everyon left #mojo
10:29 Ptolemarch joined #mojo
11:23 Ptolemarch joined #mojo
12:45 cpan_mojo Swagger2-0.62 by ASHIMEMA https://metacpan.org/release/ASHIMEMA/Swagger2-0.62
13:08 ajr_ joined #mojo
13:10 berov joined #mojo
13:12 aborazmeh joined #mojo
13:14 dod joined #mojo
13:27 dod Hi. I need to test the behavior of a user agent when a connection is cut. How can I setup a mojolicious web server that cut connection while handling a get (or post) request ?
13:29 Ptolemarch joined #mojo
13:30 nic one way is to construct a very long running transaction and use kill -9
13:31 nic it's slightly easier if they're on separate boxes cos then you can use iptables to properly simulate net failure
13:31 dod Well, I could also exit the server in the middle of the handler ...
13:32 nic that's what kill -9 is doing -- simulating a processing crash
13:33 nic but it sounded like you wanted to simulate a net failure
13:34 dod I'm not sure what really happens. wouldn't a net failure result in a time-out on the user agent side ?
13:35 * nic used to simulate 'disaster' by pulling the power cable out of the back of old servers :)
13:35 dod Well, my server is on the other side of the Atlantic ...
13:35 nic sounds like you want iptables then
13:36 dod Anyway, I'll try the exit (or kill -9 ) and then iptables if I do not get the behavior I want
13:36 dod nic: thanks for the advices
13:36 nic np
13:40 sri umm, why not just close the connection?
13:42 sri Mojo::IOLoop->stream($c->tx->connection)->close
13:42 dod sri: thanks, that looks much simpler :-)
13:46 dod for the record https://github.com/shopify/toxiproxy can also be used to simulate bad networks (but stream()->close is still simpler ;-) )
13:48 punter joined #mojo
13:49 hernan605 joined #mojo
13:54 ashimema joined #mojo
14:00 asarch joined #mojo
14:23 Ptolemarch joined #mojo
14:26 marty joined #mojo
14:26 eseyman joined #mojo
14:40 zivester joined #mojo
15:05 * jberger got a letsencrypt beta invite
15:05 jberger \o/
15:06 nic woohoo!
15:07 nic otoh, the beta programme is about to finish
15:09 kes is there a flag to disable rendering cached templates?
15:10 nic why is that useful?  (just asking rather than saying it's not)
15:11 kes I am developing
15:11 kes and want to see actual results not chached
15:12 sri kes: perhaps you should rethink if mojolicious is really the right framework for you, every day you are fighting another feature
15:12 kes sri: =)
15:12 nic kes: are you using morbo -- that's one of the things it gives you
15:12 kes I run application under PSGI
15:15 kes sri: there are lack of info how to complete this or that. So I ask.
15:15 kes nic: can I turn off caching without morbo?
15:17 nic with hypnotoad you can restart the server between requests, or use an fs watcher to simulate morbo's behaviour
15:18 Ptolemarch joined #mojo
15:19 jberger would calling warmup again work?
15:20 jberger per the documentation that's only for __DATA__ templates anyway
15:20 Grinnz_ that wouldn't recache templates, just find new ones
15:20 Ptolemarch joined #mojo
15:20 Grinnz_ if i'm reading correctly
15:22 Grinnz_ https://metacpan.org/pod/Mojolicious::Renderer#cache i think you'd want to clear this
15:22 Grinnz_ (if you're using EP templates)
15:23 kes Grinnz_: I have saw that...
15:27 kes no one word how to disable it
15:27 jberger kes: I think its fair to say that you are in uncharted waters
15:27 jberger explore at will
15:27 csson kes: https://metacpan.org/pod/Mojo::Cache#max_keys
15:28 jberger csson++
15:30 Grinnz_ how strange... i'm getting a failure of the OUTLINE_TAG feature of Template Toolkit but only on two freebsd tests out of many
15:30 Grinnz_ http://www.cpantesters.org/cpan/report/91f759d8-7e1b-11e5-80a2-a8d1dfbfc7aa
15:31 Grinnz_ the module versions look up to date...
15:32 * Grinnz_ will probably just remove that test, but it's peculiar
15:32 jberger I can run it if you want
15:34 Grinnz_ i wonder if it is a bug in 5.20.0/5.18.2
15:35 arthas joined #mojo
15:36 PopeFelix joined #mojo
15:36 kes csson: I have so that. But how to access that value from app or controller?
15:36 Grinnz_ kes: app->renderer->cache->max_keys
15:39 kes Grinnz_: thank you
15:42 jberger Grinnz_: 5.20.2 on freebsd tested just fine
15:44 * Grinnz_ writes off as "isolated peculiarity"
15:50 PopeFelix joined #mojo
15:51 lluad joined #mojo
15:55 kes it is maybe another stupid question. There some special rules to use ?: operator in template?
15:55 kes <%= title ? title .' | ' : '' %>
15:56 kes give me error: Use of ?PATTERN? without ...
15:56 Grinnz_ EP is just perl code
15:57 Grinnz_ maybe put () around it, parser is getting confused
15:58 * Grinnz_ remembers Moo inlined non-lazy defaults running into this issue in generated code
15:59 kes that not help. Is there a way to view generated perl from template?
15:59 jberger hmmm I got "Search pattern not terminated or ternary operator parsed as search pattern"
15:59 Grinnz_ yeah how it will parse it or error out depends on perl version
16:00 kes his is perl 5, version 22, subversion 0 (v5.22.0)
16:00 kes works fine
16:00 kes v5.20.2
16:00 kes error (((
16:00 Grinnz_ 5.22 is when ?? as a regex was removed
16:01 Grinnz_ is title a helper?
16:01 kes % title 'Login';
16:01 Grinnz_ try title()
16:01 kes at index.html.ep
16:01 Grinnz_ that might prevent it from interpreting it as a regex
16:02 jberger that worked for me
16:02 jberger as did $c->titiel
16:02 jberger $c->title
16:02 jberger perl -Mojo -E 'a("/" => { title => "hello", inline => q[<%= title() ? title . " | " : "" %> ]})->start' get /
16:02 kes title() helps
16:02 Grinnz_ it's the old "this token might be an operator or might be a function parameter"
16:03 kes in template it is a function?
16:03 Grinnz_ yes thats how helpers are available like that
16:03 kes does "% title 'Login'; " creates a function?
16:03 pink_mist no?
16:03 lb it calls the title helper function
16:04 pink_mist that's not how you make functions in perl. you want sub title { ... }
16:04 Grinnz_ i think "creates" was just a bad word choice
16:04 Grinnz_ but yeah that is title('Login')
16:04 Grinnz_ or $c->title('Login')
16:05 kes oh... I think (from example - default myapp) it is created on the fly, but it is a helper
16:06 Grinnz_ https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#title
16:06 kes and on the http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Layouts
16:06 kes it shown as stash variable
16:06 zivester joined #mojo
16:07 kes and I again do wrong assumption... ((
16:07 Grinnz_ as i linked, all the helper does is get or set the stash value
16:08 Grinnz_ the stash variable would be directly available as $title in templates
16:10 kes yeah, I see now
16:11 PryMar56 joined #mojo
16:15 jnbek joined #mojo
16:20 cpan_mojo Mojolicious-Plugin-SimpleAuthorization-0.02 by KWAKWA https://metacpan.org/release/KWAKWA/Mojolicious-Plugin-SimpleAuthorization-0.02
16:20 jberger in my example you see that I set the title in the stash then use the title "accessor" in the template
16:20 jberger its just for ease of use
16:21 jberger since title might not be set in the stash, you'd have to do the "stash 'title' || 'default'" because of the way that $title would only be localized if present
16:22 jberger so having the function makes it "title || 'default'"
16:23 Grinnz_ ooh, template toolkit avoids this problem, because undefined vars will just result in empty string
16:24 Grinnz_ and the DEFAULT directive can be used for that, though i dont really like that syntax
16:25 Grinnz_ too much separation
16:29 jberger a fairly common mojo problem is that people want to do $stash_value and then make that stash value optional
16:30 jberger if you do it with $app->defaults then its ok, but if you do it just by not setting it, then, well, you get a compile error
16:31 jberger perl -Mojo -E 'app->defaults(foo => "bar"); a("/" => { inline => q[<%= $foo %>] })->start' get /
16:31 sri and if you use <%= stash('foo') // 'bar' %> you're wasting memory, since you now need two versions of the template
16:32 jberger ah, good point
16:32 jberger I always forget about that one
16:56 cpan_mojo Mango-1.21 by ODC https://metacpan.org/release/ODC/Mango-1.21
17:00 Grinnz_ havent been any complaints about Minion::Backend::File being removed yet? surprising
17:02 mikegrb joined #mojo
17:04 odc what?
17:04 odc i complain now!
17:04 Grinnz_ hahah
17:04 batman jberger: happy birthday! <3
17:04 Grinnz_ the answer is of course, "maintain it yourself" :P
17:05 batman finally you're as old as me ;)
17:05 odc has anyone expressed interest in that? @ Grinnz_
17:05 Grinnz_ odc: as i said nobody's even complained it's gone heh
17:06 odc heh
17:06 odc :(
17:06 odc oh well, no big deal (as long as you don't change the api too much)
17:06 Grinnz_ i would suggest if someone were to maintain it as a separate dist, to put a warning near the top "ONLY FOR TESTING"
17:07 disputin joined #mojo
17:07 odc what was the problem with ::File? (apart from being slow)
17:07 Grinnz_ it became unbearably slow in the thousands of jobs
17:08 dod joined #mojo
17:08 odc i see
17:09 odc i'll have to remember that...
17:12 odc is the SQLite backend performing better?
17:12 odc i would guess so
17:12 Grinnz_ i am not sure, theres still a problem with forking i have to isolate
17:13 odc the one related to EV ?
17:13 Grinnz_ but the indexes help a lot as the size grows
17:13 shadowpaste "kes" at 217.168.150.38 pasted "is generated action for form OK?" (17 lines) at http://paste.scsys.co.uk/500955
17:13 Grinnz_ no, a DBD::SQLite issue
17:13 odc ah
17:13 sri in benchmarks the SQLite backend performs extremely well, just the fork issue is holding it back
17:14 pink_mist huh, I thought one of the main touted features of sqlite was its solid forking
17:14 pink_mist guess not
17:14 pink_mist *was it being very solid in the face of forking (might be a better turn of phrase)
17:15 Grinnz_ if you fork before you open any connections it's fine
17:16 Grinnz_ the WAL mode makes it very concurrent, at least as much as a single file DB can be
17:17 stephen joined #mojo
17:25 jberger batman: thanks
17:25 jberger 0x20
17:25 sri jberger: happy birthday! \o/
17:26 * jberger dances
17:26 pink_mist oh, happy birthday!
17:27 * jberger orders long noodles for lunch, because $superstitious_asian_mother_in_law
17:27 cstamas joined #mojo
17:30 batman jberger :)
17:30 Grinnz_ sounds like a good lunch either way!
17:30 batman do i dare ask what long noodles result in..?
17:33 Grinnz_ kes: trailing slashes are generally unimportant
17:34 Grinnz_ for route urls
17:36 Grinnz_ kes: the ->get('/') is redundant really (i only do that when i have a ->get and a ->post etc that share stash values)
17:39 kes I may wrong, but for apache it is important. The trailing stash shows what we server: directory or file
17:39 kes *serve
17:45 kes Grinnz_: ok. I will ignore trailing / and will use without it
17:47 gryphon joined #mojo
17:53 jberger long noodles for long life
17:54 jberger oh yes I like noodles, though, I like the thai flat noodles best
17:54 jberger so interesting story now
17:54 jberger I just tried to sign up for an account to order lunch from a restaurant (why do they even need a login) after signing up, I couldn't log in so I hit password reset which sent me my password in clear text in an email and the reason I couldn't log in was that they had silently truncated my password
17:55 jberger yeah, not giving them my password
17:55 jberger s/password/credit card number/
17:55 Grinnz_ lol
17:56 Grinnz_ reasons i'm glad i use keepass now
17:56 jberger lastpass here
17:56 jberger which is what generated the password that was too long
17:56 Grinnz_ i had a problem with the TP-link router i bought and i'm pretty sure it was silently truncating the admin password i set
17:57 Grinnz_ but it was impossible to tell what the problem was, since obviously there's no reset password function on a local router web interface
17:57 genio I'm not really a fan of generated passwords.  I prefer long sentences with proper punctuation, etc.
17:57 Grinnz_ i just had to factory reset the router over and over until a password stuck :|
17:57 genio yet people still don't allow spaces in passwords in most apps.
17:58 Grinnz_ i guess if i was smart, i would try to do the login from a different computer while still being logge din on the first
17:58 Grinnz_ BUT WHATEVER
17:59 Grinnz_ signs people don't know what they're doing with password restrictions: any limit on length or character usage :P
18:00 jberger my lastpass passwords are long phrases from $work_of_literature
18:00 jberger Grinnz_: that and sending the password to the user in clear text for "recovery"
18:00 Grinnz_ of course.
18:01 genio I agree with a lower limit on length, not an upper.
18:01 Grinnz_ yeah thats what i meant by limit
18:02 jberger all passwords should be 1-2-3-4-5
18:03 genio let's just go by the honor system.  Nobody needs passwords
18:03 Grinnz_ that's called "IP-based authentication"
18:04 * Grinnz_ still lols that that's an option in that horrible CGI::Session module
18:15 jes joined #mojo
18:18 jberger hahaha and the main host for the site (restaurant_name.carry-out.com) is http://carry-out.com
18:18 jberger which you should really check out
18:19 jberger this is just some kid, it has to be
18:22 shadowpaste "kes" at 217.168.150.38 pasted "why action for POST does not work" (8 lines) at http://paste.scsys.co.uk/500958
18:22 Grinnz_ jberger: lol
18:22 Grinnz_ kes: the parent route limits it to GET only, change it to ->any
18:22 trone joined #mojo
18:23 kes Grinnz_: thank you
18:25 kes forget where I have saw... can anybody remind me command to see which queries the application can serve
18:26 Grinnz_ not sure, but the development not found page lists them :P
18:28 kes hmm... it seems I must to switch mode
18:36 kes I have see +/ POST on the developers not found page
18:37 kes I have do manually action="/login/" and it is work! =)
18:37 kes so trailing / has matter!
18:38 Grinnz_ i have several routes like that, it does not matter for any of htem
18:44 kes yes, I misspell ((
18:44 kes but why "  +/  POST" is still generated?
18:47 lluad joined #mojo
18:48 kes I answer my question: because I do $login->post('/'). It just will not be matched during query...
18:49 kes ok. Thank to all.
18:49 kes time to go home...
18:51 kes (it will be cool to highlight patterns that will never match О:-) )
18:58 Grinnz it's not that the pattern doesn't match, it's just that / alone is sort of an outlier in that it's representative of an empty path
19:03 nic joined #mojo
19:11 neilhwatson joined #mojo
19:57 espent joined #mojo
20:29 asarch joined #mojo
20:43 Trelane Am I missing a really easy way to see what the stack trace was if $t->get_ok('/'); doesn't return ok?
20:46 preaction $t->get_ok( '/' )->or( sub { diag $_[0]->tx->res->body } ); perhaps?
20:49 jberger Trelane: you might find MOJO_USERAGENT_DEBUG=1 or MOJO_DAEMON_DEBUG=1 helpful too
20:54 hernan605 joined #mojo
20:58 mattp joined #mojo
20:58 dhg joined #mojo
21:02 Grinnz_ HTTP responses don't have stack traces :))
21:02 espent_ joined #mojo
21:13 Trelane so that works, but it seems like I should be able to do some magic to turn that back into handy plain text
21:14 Grinnz_ turn what?
21:14 Trelane the HTML that is generated when there's a 500
21:14 Grinnz_ you mean strip the HTML tags?
21:14 Grinnz_ (easier said than done)
21:15 Grinnz_ you can always do tx->res->dom and then find what you awnt in the dom, but that means you'll be depending on the html format of course
21:21 espent joined #mojo
21:26 sri ->all_text looks funny
21:26 sri perl -Mojo -E 'a({inline => "% die;"}); say g("/")->dom->all_text'
21:27 Grinnz_ you inevitably end up with some stuff you didn't think you'd get with that, heh
21:29 Grinnz_ could always use something like https://metacpan.org/pod/HTML::FormatText::Html2text
21:30 sri this doesn't looks so bad :)
21:30 sri perl -Mojo -E 'a({inline => "% die;"}); say g("/")->dom->at("#trace")->find("tr")->map("all_text")->join("\n")->say'
21:31 sri without the second "say" ;p
22:07 Lucas1 joined #mojo
22:37 Grinnz_ any better option than Net::OAuth::Client for doing OAuth 1.0? it's apparently a lot more complicated than OAuth 2
22:39 Grinnz_ i was thinking about adding the ability to post tweets and such user-authed activities to my mojo-based Twitter api client, but unless i can find a neat way to do OAuth 1.0 i won't bother
23:07 Grinnz_ eh, twitter describes the process pretty well, I can figure it out
23:10 Grinnz_ next decision: release the base class and various API clients together, or release each API client as a separate dist so i can add things to them easier
23:11 Grinnz_ the base class doesnt do much of anything though so that seems kind of silly
23:38 asarch joined #mojo
23:43 jberger I don't remember oauth 1 being that hard
23:43 jberger I mean they are all strange
23:43 jberger But generally
23:50 Grinnz_ oauth 2 is really simple though, at least all the times i've used it so far
23:51 Grinnz_ oauth 1.0 seems to have a bunch of extra metadata going on

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