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

IRC log for #mojo, 2015-10-22

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

All times shown according to UTC.

Time Nick Message
00:00 genio sri: I replied with his example.  if I'm not helping, feel free to tell me to STFU
00:00 sri there is no need to be rude
00:01 genio sorry, I didn't mean that in a rude way
00:02 genio I only meant that if I'm adding to the confusion (which is not what I'm trying to do) please don't hesitate to tell me to go away
00:03 sri didn't think so, that was just a general reminder :)
00:04 sri also to myself... since after losing a lot at hearthstone i'm about ready to smash my phone against the wall ;p
00:07 good_news_everyon joined #mojo
00:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWshp
00:07 good_news_everyon mojo/master ed6ffa5 Sebastian Riedel: more snowman tests
00:07 good_news_everyon left #mojo
00:17 Grinnz http://i.imgur.com/XSIqoBP.jpg
00:17 good_news_everyon joined #mojo
00:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWGeA
00:17 good_news_everyon mojo/master 58cd44e Sebastian Riedel: fix punycode bug in Mojo::URL (closes #856)
00:17 good_news_everyon left #mojo
00:18 Grinnz https://metacpan.org/source/DBOOK/Mojolicious-Plugin-TemplateToolkit-0.002/t/lite_app.t embrace the snowmen!
00:19 sri ☃☃☃☃☃
00:22 zivester joined #mojo
00:29 aborazmeh joined #mojo
00:50 cpan_mojo Mojo-IRC-Server-Chinese-1.7.5 by SJDY https://metacpan.org/release/SJDY/Mojo-IRC-Server-Chinese-1.7.5
01:06 caeles joined #mojo
01:06 bzero joined #mojo
01:06 allison joined #mojo
01:06 skaji joined #mojo
01:06 worklapperl joined #mojo
01:06 esh joined #mojo
01:06 lestrrat joined #mojo
01:06 dysfun joined #mojo
01:06 crab joined #mojo
01:06 renormalist joined #mojo
01:06 gabiruh joined #mojo
01:06 cstamas joined #mojo
01:06 stephan48 joined #mojo
01:06 Snelius joined #mojo
01:06 bowtie joined #mojo
01:06 oalders joined #mojo
01:06 KindOne joined #mojo
01:06 jwang joined #mojo
01:06 spicyjack joined #mojo
01:06 Nemix joined #mojo
01:06 Adura joined #mojo
01:06 Andreas joined #mojo
01:06 genio joined #mojo
01:06 Repaster joined #mojo
01:06 Grinnz joined #mojo
01:06 espent joined #mojo
01:06 dabudabu joined #mojo
01:06 Dandre joined #mojo
01:06 rwp joined #mojo
01:06 mikegrb joined #mojo
01:06 cfedde joined #mojo
01:06 meshl joined #mojo
01:06 omega joined #mojo
01:06 bjakubski joined #mojo
01:06 charsbar joined #mojo
01:06 phillipadsmith joined #mojo
01:06 mishanti1 joined #mojo
01:06 jantore joined #mojo
01:06 ribasushi joined #mojo
01:06 BinGOs joined #mojo
01:06 lupi joined #mojo
01:06 garu joined #mojo
01:06 Gedge joined #mojo
01:06 Phil22 joined #mojo
01:06 janus` joined #mojo
01:06 abracadaniel^ joined #mojo
01:06 ashleydev joined #mojo
01:06 stokachu joined #mojo
01:06 jnbek joined #mojo
01:06 Bender joined #mojo
01:06 dustinm joined #mojo
01:06 ashimema joined #mojo
01:06 y1mmm joined #mojo
01:06 SmokeMachine joined #mojo
01:06 nic joined #mojo
01:06 mantovani joined #mojo
01:06 jberger joined #mojo
01:06 noganex joined #mojo
01:06 dave joined #mojo
01:06 lluad joined #mojo
01:06 Onigiri joined #mojo
01:06 kivilahtio joined #mojo
01:06 aborazmeh joined #mojo
01:06 diegok joined #mojo
01:06 yt7fms joined #mojo
01:06 al joined #mojo
01:06 bc547 joined #mojo
01:06 salva joined #mojo
01:06 fvox joined #mojo
01:06 odc joined #mojo
01:06 theo joined #mojo
01:06 Grinnz_ joined #mojo
01:06 Lucas1 joined #mojo
01:06 tianon joined #mojo
01:06 elik joined #mojo
01:06 vytas joined #mojo
01:06 sivoais joined #mojo
01:06 da5id joined #mojo
01:06 tyldum joined #mojo
01:06 sri joined #mojo
01:06 buu joined #mojo
01:06 batman joined #mojo
01:06 kmx joined #mojo
01:06 zz_Foxcool joined #mojo
01:06 coolo joined #mojo
01:06 ssm joined #mojo
01:06 hahainternet joined #mojo
01:06 kwa joined #mojo
01:06 robinsmidsrod joined #mojo
01:18 disputin joined #mojo
01:27 asarch joined #mojo
01:36 jnm_theMailman joined #mojo
01:50 nnutter joined #mojo
02:10 noganex_ joined #mojo
02:39 inokenty-w joined #mojo
02:48 good_news_everyon joined #mojo
02:48 good_news_everyon [mojo] kraih tagged v6.25 at 2b9cc32: http://git.io/vWG4v
02:48 good_news_everyon left #mojo
02:49 good_news_everyon joined #mojo
02:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWG4O
02:49 good_news_everyon mojo/master 4a7479b Sebastian Riedel: bump version
02:49 good_news_everyon left #mojo
02:59 Lee joined #mojo
03:02 kaare joined #mojo
03:09 davido_ joined #mojo
03:39 jberger Dammit cubs
03:39 jberger Well trivia for you
03:40 jberger On back to the future day, the cubs got eliminated from the playoffs
03:40 jberger Rather than winning the world series as they were supposed to have done
03:56 Zoffix joined #mojo
03:59 melo joined #mojo
04:56 BLOKDAK joined #mojo
05:01 irqq joined #mojo
05:19 davido_ joined #mojo
05:44 Grinnz joined #mojo
05:53 marcusr joined #mojo
06:22 batman sri: this test is failing: https://ssl.thorsen.pm/paste/78f34bbc968f because of https://metacpan.org/source/SRI/Mojolicious-6.25/lib/Mojo/URL.pm#L145
06:23 batman am i not supposed to define a different base->path()?
06:25 batman i got an open issue to marcus regarding this as well: https://github.com/marcusramberg/Mojolicious-Plugin-RequestBase/pull/2
06:33 memowe joined #mojo
06:33 memowe \o/
07:05 irqq joined #mojo
07:07 irqq_ joined #mojo
07:09 irqq__ joined #mojo
07:31 damaya joined #mojo
07:33 eseyman joined #mojo
07:46 Vandal joined #mojo
07:59 trone joined #mojo
08:04 berov joined #mojo
08:12 meshl joined #mojo
08:14 ans joined #mojo
08:14 ans v6.11
08:14 ans [error] Can't use string ("App::Model") as a HASH ref while "strict refs" in use at /home/site/webartex/local/lib/perl5/Mojo/Base.pm line 59.
08:14 ans I see you use Carp there, but this string is not in eval
08:20 damaya joined #mojo
08:22 bpmedley ans: Do you have example code?
08:22 bpmedley Also, would you consider the latest version?
08:22 nic ans: What's the smallest example you can construct that exhibits the problem?
08:23 ans Heh, that is the problem. i am trying to find where it is failing but cant )
08:23 ans It is a big project.
08:23 ans I only has 500 from nginx and this error
08:23 cpan_mojo Mandel-0.28 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mandel-0.28
08:23 bpmedley ans: Can you run the app via the CLI and reproduce?
08:23 nic hmm, there's an env var you can set that might help.  PERL5OPT="-MCarp=always" might do it
08:26 nicomen nic: is that something new? I thought one needed to use PERL5OPT="-MCarp::Always"
08:26 inokenty joined #mojo
08:26 ans Oh, if it were on the developer server ). It is the main machine for now and i can`t reproduce this on dev
08:26 ans When i find the error i`ll try to make the minimal example
08:26 nic ans: What nicomen said
08:27 nicomen ans: you could try to be a human stacktracer ;)
08:28 nicomen /home/site/webartex/local/lib/perl5/Mojo/Base.pm line 59 <-- what method is called? then grep the code and find possibly callers, then continue further one step at a time
08:29 nicomen at some point perhaps a ->new is forgotten
08:30 bpmedley ans: Another possibility is to use Devel::Trace
08:30 bpmedley If you can reproduce via the CLI
08:32 nicomen also, if you have the exact URL that triggers this error, you should be able to do a PERL5OPT=-MCarp::Always MOJO_MODE=production /path/to/script/myapp.pl <relative_url> # and perhaps be able to reproduce
08:32 nicomen (on the production server)
08:33 nic nicomen: don't you need a 'get' before the url?
08:33 nicomen yes of course! ;)
08:33 nic team work :)
08:33 nicomen ;)
08:36 nic That's a good technique, but you can't do it in one hit if, for example, you need to be authenticated
08:36 nic A sneaky technique I use is to run a daemon in parallel to the live server (on port 3000 for example) to investigate such problems
08:36 nic but if you have sensible sysadmins, they won't let you do that of course
08:51 nicomen hehe
08:51 nicomen I think my suggestions _without_ the get <relative_url> would be exactly what you said ;)
08:52 nicomen *suggestion
08:52 nicomen done that too if you require several steps, for instance like you said authentication
08:52 nic I'd replace the "get $url" with "daemon"
08:54 nic (and of course the point of mentioning that is it then lets you pick up new (debug) env vars)
09:21 murre joined #mojo
09:32 gaunt_ joined #mojo
09:36 vanHoesel joined #mojo
09:44 jontaylor joined #mojo
10:08 dvinciguerra joined #mojo
11:13 asarch joined #mojo
12:16 ajr_ joined #mojo
12:32 ashimema hi all.. looking to implement my first minion queue :)
12:33 Zoffix \o/
12:33 ashimema any particular for's or against's on which back end to choose?
12:34 ashimema like.. start with DBD::Deep and move onto Postgres if you need to scale.. very thumb in the air advice?
12:34 ashimema or only use DBD::Deep if you can't install the latest postgres?
12:35 CandyAngel I've only used DBD::Deep..
12:35 ashimema I'm failing to really understand why you may choose one over the other ;)
12:35 vanHoesel joined #mojo
12:35 nic ashimema: If you're fluent in postgresql, jump straight in with pg
12:35 ashimema I was thinking of starting with DBD::Deep.. though I do have a postgres running for my app already so it wouldn't be a burden
12:36 nic but if setting up pg is a learning curve, play with DBM::Deep first, to learn Minion
12:36 CandyAngel If you already have Pg running, go with that
12:37 ashimema cheers guys :)
12:37 ashimema ooh.. 'tables created automagically'.. very clever..
12:39 sri batman: you know how it works, find the appropriate spec sections
12:40 * nic needs a sprinkle of automagical
12:42 nic Note to self: before creating an app attribute, check it doesn't clash; in particular, never again create $app->ua   :(
12:43 nic Is there some tool that would list at runtime all the methods it reckons I'm overriding?
12:47 hernan605 joined #mojo
12:50 ashimema likely a silly postgres question.. is there a way to specify the schema to connect to in the connect string..  thinking of keeping my minion tables in a separate schema to the rest of my app tables (which are so far managed by DBIx::Class::DeploymentHandler)
12:51 ashimema I'm not seeing it in the postgres docs.. wondered if anyone here has their minion in a particular schema.. or do you all just go with the default dbuser = dbname = schemaname
12:51 sri only way i know is to change the default schema
12:51 sri like http://mojolicio.us/perldoc/Mojo/Pg#connection
12:52 ashimema brill.. thought there might be an 'on connect' emitter..
12:52 ashimema cheers sri
12:53 sri unshift @{app->minion->backend->pg->subscribers('connection')}, sub {...};
12:53 sri that might be necessary
12:54 sri to be faster than the migration, which also uses the event
12:54 ashimema I tihnk you just predicted my next question perfectly :)
12:56 sri i guess it would be comfortable to have an easier way to change search_path in Mojo::Pg
12:56 sri not sure what that would look like though
12:57 sri i've been thinking about using different schemas for different tests, to avoid race conditions with parallel tests
12:57 ashimema I think having the on connect event is how most orm's i've worked with do it.. might be nice to have a bit of sugar but I can't imagine it wuold actually win us much :)
12:57 sri app->pg->search_path('foo');
12:58 ashimema very tidy
12:58 sri or rather $t->app->pg->search_path(['foo', 'bar']) in the begining of your test
12:58 ashimema I'm still a bit of a pg noob to be honest.. learning fast.. but also learning lots of other stuff at the same time ;)
12:58 ashimema oh.. that would be nice
13:03 sri oh, TIL about the pg_temp schema
13:03 sri every postgres session has a temporary schema :o
13:04 sri which is pg_temp_nnn can be referenced with pg_temp
13:04 sri +and
13:04 zivester joined #mojo
13:05 hernan605 joined #mojo
13:05 sri http://www.postgresql.org/docs/9.5/static/runtime-config-client.html
13:05 sri search_path is actually the first setting here
13:06 sri so $pg->search_path() would be very much in line with the offical api
13:06 sri odd that DBD::Pg doesn't have it
13:08 sri <3 PostgreSQL
13:08 sri stuff like search_path just makes so much sense
13:18 Zoffix :(   Mojo::Reactor::EV: I/O watcher failed: Unknown encoding 'UTF-8' at [...] Mojo/Path.pm line 92.
13:18 Zoffix So much for my attempt to fetch a page during $SIG{__DIE__} I guess :)
13:19 Zoffix Actually, it's $SIG{__DIE__} trigger during compile time that only has the issue
13:22 sri any opinions on this search_path patch for Mojo::Pg? https://gist.github.com/anonymous/bff84ece3f7be588f74b
13:23 Zoffix Fixed it: by adding encode 'UTF-8', '42'; in a BEGIN {} before I assign to $SIG{__DIE__}
13:35 sri committed it for now https://github.com/kraih/mojo-pg/commit/55e1a55ddff3ef0e5861d47b3308f77de1229376
13:35 sri not sure if it stays, so feedback would be very welcome
13:37 sri crab: anything obvious i'm doing wrong?
13:37 zeke joined #mojo
13:46 cpan_mojo Acme-Excuse-1.001001 by ZOFFIX https://metacpan.org/release/ZOFFIX/Acme-Excuse-1.001001
13:49 mishantil joined #mojo
13:49 kivilahtio joined #mojo
13:49 omega joined #mojo
13:49 Onigiri joined #mojo
13:49 dustinm joined #mojo
13:49 Gedge joined #mojo
13:50 janus joined #mojo
13:50 Phil22 joined #mojo
13:50 y1mmm joined #mojo
13:50 ashleydev joined #mojo
13:50 SmokeMachine joined #mojo
13:50 lupi joined #mojo
13:50 hernan605 joined #mojo
13:50 charsbar joined #mojo
13:50 noganex joined #mojo
13:50 dave joined #mojo
13:50 Zoffix joined #mojo
13:50 stokachu joined #mojo
13:50 abracadaniel joined #mojo
13:50 jnbek joined #mojo
13:50 memowe joined #mojo
13:50 bjakubski joined #mojo
13:50 inokenty joined #mojo
13:50 phillipadsmith joined #mojo
13:51 ribasushi joined #mojo
13:52 ashimema joined #mojo
13:52 gryphon joined #mojo
13:52 Bender joined #mojo
13:53 Lee ^ shouldn't that be exit 255
13:54 jberger joined #mojo
13:54 Lee unless the excuse counts as 0 also :D
13:54 mishanti1 joined #mojo
13:55 trone joined #mojo
13:55 jberger exit in a die handler?!
13:55 jberger Eeeeeep
13:56 Zoffix :)
14:00 jantore joined #mojo
14:03 marty joined #mojo
14:04 batman sri: so how do you expect "location /foo { proxy_pass http://localhost:8000; }" urls to look like?
14:05 batman i would be very surprised if they didn't contain the "/foo" part :/
14:09 sri expect? why would we guess?
14:09 sri just test it
14:10 melo1 joined #mojo
14:11 damaya joined #mojo
14:14 jb360 joined #mojo
14:15 bobkare joined #mojo
14:19 abra joined #mojo
14:35 melo1 joined #mojo
14:35 jberger joined #mojo
14:35 gryphon joined #mojo
14:35 inokenty joined #mojo
14:35 hernan605 joined #mojo
14:35 y1mmm joined #mojo
14:35 Gedge joined #mojo
14:35 asarch joined #mojo
14:35 dvinciguerra joined #mojo
14:35 gaunt_ joined #mojo
14:35 Grinnz joined #mojo
14:35 kaare joined #mojo
14:35 cfedde joined #mojo
14:35 mikegrb joined #mojo
14:35 rwp joined #mojo
14:35 Dandre joined #mojo
14:35 dabudabu joined #mojo
14:35 espent joined #mojo
14:35 Repaster joined #mojo
14:35 genio joined #mojo
14:35 Andreas joined #mojo
14:35 Adura joined #mojo
14:35 Nemix joined #mojo
14:35 jwang joined #mojo
14:35 KindOne joined #mojo
14:35 oalders joined #mojo
14:35 bowtie joined #mojo
14:35 Snelius joined #mojo
14:35 stephan48 joined #mojo
14:35 cstamas joined #mojo
14:35 gabiruh joined #mojo
14:35 renormalist joined #mojo
14:35 crab joined #mojo
14:35 dysfun joined #mojo
14:35 lestrrat joined #mojo
14:35 esh joined #mojo
14:35 worklapperl joined #mojo
14:35 skaji joined #mojo
14:35 allison joined #mojo
14:35 bzero joined #mojo
14:35 caeles joined #mojo
14:35 abra joined #mojo
14:35 bobkare joined #mojo
14:35 jantore joined #mojo
14:35 trone joined #mojo
14:35 jnbek joined #mojo
14:35 abracadaniel joined #mojo
14:35 Zoffix joined #mojo
14:35 noganex joined #mojo
14:35 Phil22 joined #mojo
14:35 janus joined #mojo
14:35 Onigiri joined #mojo
14:35 omega joined #mojo
14:35 zeke joined #mojo
14:35 vanHoesel joined #mojo
14:35 ans joined #mojo
14:35 Vandal joined #mojo
14:35 eseyman joined #mojo
14:35 marcusr joined #mojo
14:35 diegok joined #mojo
14:35 yt7fms joined #mojo
14:35 al joined #mojo
14:35 bc547 joined #mojo
14:35 salva joined #mojo
14:35 fvox joined #mojo
14:35 theo joined #mojo
14:35 Grinnz_ joined #mojo
14:35 Lucas1 joined #mojo
14:35 tianon joined #mojo
14:35 elik joined #mojo
14:35 vytas joined #mojo
14:35 sivoais joined #mojo
14:35 da5id joined #mojo
14:35 tyldum joined #mojo
14:35 sri joined #mojo
14:35 buu joined #mojo
14:35 batman joined #mojo
14:35 kmx joined #mojo
14:35 Foxcool joined #mojo
14:35 coolo joined #mojo
14:35 ssm joined #mojo
14:35 hahainternet joined #mojo
14:35 kwa joined #mojo
14:35 robinsmidsrod joined #mojo
14:35 Grinnz because we all love benchmarks, https://github.com/kostya/benchmarks#json
14:36 Grinnz Cpanel::JSON::XS beat the python C impl hehe
14:39 batman sri: still think the leading_slash() stuff is strange :/ http://direct.thorsen.pm/tp3
14:40 BLOKDAK So does Cpanel have a real bullpen nowadays?  (as in competent programmers)
14:46 Zoffix ¯\_(ツ)_/¯
14:50 Grinnz ¯\(°_o)/¯
14:50 jnm_theMailman joined #mojo
14:52 sri batman: specs!!!
14:53 jnm_theMailman_ joined #mojo
14:54 pink_mist BLOKDAK: their Cpanel::JSON::XS is certainly written by competent people. I could not say any more than that.
14:56 batman sri: no idea where to begin
14:57 batman where in the spec did you find that you have to look at leading slash?
14:59 fvox joined #mojo
15:01 batman i also don't understand how it's possible for a mojo app to continue beyond https://metacpan.org/source/SRI/Mojolicious-6.25/lib/Mojo/URL.pm#L147
15:01 batman when doesn't the request url have a leading slash?
15:03 pink_mist Mojo::URL doesn't deal with only request urls
15:03 pink_mist it deals with any url
15:03 batman i know
15:03 zivester joined #mojo
15:03 pink_mist so http://example.com/ doesn't have a leading slash
15:03 pink_mist foo.png doesn't have a leading slash
15:04 pink_mist both valid URLs
15:04 pink_mist the latter would need a base to work from though, if you wanted to resolve it
15:04 batman pink_mist: i don't agree: perl -MMojo::URL -le'print Mojo::URL->new(shift)->path->leading_slash' http://example.com/
15:04 batman pink_mist: either way, what does that have to do with to_abs() ?
15:05 pink_mist batman: I wasn't looking at the code you linked, so the only context to your question I had was your actual question, which I answered
15:05 d4rkie joined #mojo
15:05 pink_mist foo.png then
15:05 batman but "so http://example.com/ doesn't have a leading slash" is a false statement
15:05 meshl joined #mojo
15:05 pink_mist it starts with 'h'
15:06 pink_mist so it doesn't have a leading slash
15:06 pink_mist the PATH portion of it however
15:06 pink_mist that one does
15:06 batman pink_mist: when did Mojo::URL have a leading_slash() attribute??
15:06 pink_mist batman: stop fgs
15:07 pink_mist batman: you already showed me that your question was incomplete and so the http://example.com/ example I gave wasn't a true answer to your question
15:07 pink_mist stop harping on it
15:07 pink_mist it's irrelevant.
15:07 pink_mist I did give you a different answer though.
15:09 mantovani joined #mojo
15:10 jberger batman: perl -MMojo::URL -E 'my $url = Mojo::URL->new(q[foo/bar])->base(Mojo::URL->new(q[bat.com/baz]))->to_abs; say $url'
15:10 garu joined #mojo
15:10 jberger making a relative url absolute
15:11 batman jberger: i get that, just not sure when it's useful in a real world example.
15:11 jberger that is a very different question than "i also don't understand how it's possible for a mojo app to continue beyond "
15:11 batman jberger: i'm in the context of "in a mojo app" and handling a request.
15:12 pink_mist a request should already have the full path resolved by the user's useragent, so it should be irrelevant for you
15:13 * batman gives up.
15:13 batman hope marcus takes my pr
15:13 nicomen I think at least FCGI::Engine ends up sending a non-leading slash URL btw
15:14 nicomen or no, that was the one that sent unencoded utf8, I think perhaps varnish mangles the urls?
15:15 nicomen had to add: $c->req->url->path( "/" . $path ) unless $path =~ m{ \A / }gmx;
15:15 nicomen to an app in before_dispatch because of something being naughty in front :-/
15:15 garu_ joined #mojo
15:20 nicomen nginx it was
15:20 BinGOs joined #mojo
15:20 lluad joined #mojo
15:20 bw joined #mojo
15:21 sri batman: you arguing makes no sense at all
15:21 batman that's why i gave up
15:21 sri if you want to do that join the w3c/whatwg working groups
15:22 batman too bad i didn't get any answers though, so i could build a better argument another day
15:22 sri if you want to argue about it with me, the only way would be a conflicting spec section
15:22 jberger speaking of working groups: http://w3c.github.io/csvw/
15:24 batman i wonder if anyone here is running a mojo app behind a reverse proxy on a different /mount/point than /...
15:24 jberger batman, can I sum up your question with "will $c->req->url->leading_slash ever be false?" is that what you are asking?
15:25 batman jberger: that is one of the things i'm curious about, yes
15:26 jberger ok then, that's a very different question than I understood from your original about Mojo::URL->to_abs
15:26 jberger I don't know the answer, nicomen is that the question you were answering?
15:26 PryMar56 joined #mojo
15:27 batman jberger: though the code is wrong. you're missing ->path
15:27 jberger yes
15:27 jberger sorry
15:28 jberger "will $c->req->url->path->leading_slash ever be false?"
15:28 batman so if i had added "path" to "when doesn't the request url have a leading slash?" then it would be understandable...?
15:28 sri batman: it started with this https://tools.ietf.org/html/rfc1808#section-5.1
15:28 sugar joined #mojo
15:28 sri there is no one spec that covers it all
15:29 sri you can go over half a dozen rfcs and the html5 spec
15:29 batman sri: thank you!
15:30 sri https://github.com/kraih/mojo/blob/master/t/mojo/url.t#L685
15:30 batman right, so Mojo::URL is correct according to rfc1808. that's cool
15:30 sri those are also in the tests
15:30 sri correct according to half a dozen rfcs and the html5 spec actually
15:30 sri unless there's undiscovered bugs
15:31 batman then i don't get how a reverse proxy is supposed enable mojo to generate the correct url :/
15:31 batman i've tried quite a lot of different nginx setups
15:33 batman it works like a charm if you have .html, but not if you use "pretty urls", like /x/foo instead of /x/foo.html
15:33 sri that's a different topic
15:33 batman as documented by the tests
15:33 batman did you visit http://direct.thorsen.pm/tp3 ?
15:34 batman (the server is not there anymore)
15:34 sri which reminds me of another topic
15:34 batman sri: just wondered if you looked at it before shouting "specs!!!!"
15:34 sri now that internal templates have names
15:34 sri https://gist.github.com/anonymous/6c0bf5e9730ec92655f2
15:35 sri Rendering template "mojo/development.html.ep"
15:35 sri could that use a better name?
15:35 sri in the contect of it being a fallback for "exception.html.ep" and "not_found.html.ep"
15:35 sri s/c/x/
15:38 nicomen jberger: no, I think I might just added confusion, I just saw mention of leading slash and wether there were any times a mojo app would ever not get it. with the nginx setup at my preiovus company the leading slash was stripped
15:41 fvox joined #mojo
15:41 disputin joined #mojo
15:42 batman nicomen: did you ever proxy anything else than "/" ?
15:44 nicomen batman: well all paths except the frontpage are not /, but I guess you meant something like "/" (frontend) =>  "/some_path" (backend) ?
15:44 nicomen or the opposite "/foo" (frontend) => "/" (backend) ?
15:44 batman what i meant is location /foo/bar { proxy_pass http://localhost:3000/; }
15:45 nicomen ah right
15:45 nicomen I think we did yes
15:46 batman i would very much appreciate if you could share how you accomplished that
15:47 nicomen I think we used the request_base plugin
15:47 jberger :P
15:49 nicomen https://metacpan.org/pod/Mojolicious::Plugin::RequestBase
15:49 batman nicomen: https://github.com/marcusramberg/Mojolicious-Plugin-RequestBase/pull/2
15:49 nicomen ah dang
15:51 nicomen batman: does your pull request pass this?
15:51 nicomen https://gist.github.com/nicomen/dd12511cf4ac012fb733
15:52 * crab scrolls up to figure out what sri was asking him about
15:52 crab if anyone has the suitable context handy, please feel free to point me to it
15:53 sri where are the Mojo::JSON docs wrong? Oo https://github.com/rurban/Cpanel-JSON-XS/issues/37#issuecomment-150268881
15:53 nicomen batman: Actually thinking of it, missing a leading slash (that nginx like to do), was fine, until we needed to redirect to something based on $req->url->path I think
15:53 sri crab: https://github.com/kraih/mojo-pg/commit/55e1a55ddff3ef0e5861d47b3308f77de1229376
15:54 sugar joined #mojo
15:54 sri was wondering if maybe i'm overlooking something with the search_path stuff
15:56 sri perhaps there's a reason DBD::Pg doesn't do it natively
16:00 Grinnz sri, think he's just confused...
16:07 sri Grinnz: yea
16:08 sri Grinnz: shouldn't your test just do "is "$time", $decoded->{time}"?
16:09 Grinnz yeah, i just realized that, changing now :)
16:09 sri :)
16:10 asarch joined #mojo
16:11 sh4 joined #mojo
16:38 damaya joined #mojo
16:54 damaya joined #mojo
17:15 HtbaaPi is there a way to get the session id from a user?
17:17 HtbaaPi or should I just generate an ID and store that if it's not set
17:17 pink_mist you store it in their session cookie and read it back out when you need it, yes
17:19 HtbaaPi pink_mist: thanks. Was thinking perhaps just like PHP sessions Mojolicious session cookies would have an ID as well :)
17:20 pink_mist having an ID is only useful when you want to associate it with a backend db afaik, and that's not something you have by default, and it'd make too many assumptions to try to provide one
17:20 pink_mist afaik
17:25 HtbaaPi yeah I guess that's true
17:25 HtbaaPi also, PHP sessions are stored on disk so it makes sense it has some sort of identifier
17:25 HtbaaPi thanks, I'm now storing an unique ID inside my session cookie
17:26 Grinnz_ yeah thats the easiest way to associate to a DB session store
17:27 Grinnz_ just remember, while the session cookie is protected from tampering, anything you put in the session cookie is not encrypted so dont put sensitive info there
17:27 hernan605 joined #mojo
17:35 irqq_ joined #mojo
17:36 glauber joined #mojo
17:41 trone joined #mojo
17:51 fvox joined #mojo
17:52 sh4 any authorization example?
17:57 hernan605 joined #mojo
18:04 jberger sh4: there are several in the documentation
18:18 disputin joined #mojo
18:30 sri so, i guess there are no obvious problems with Mojo::Pg::search_path?
18:31 sri i do wonder if search_path should be a string though
18:31 sri that would mean no automatic quoting though
18:32 sri hmm, it is stored as a string by postgres
18:33 sri suppose it's more like an env var that way
18:38 sri interesting, quoting actually messes the value up
18:40 sri https://github.com/kraih/mojo-pg/compare/e72675ca0682fa1066a615bad401abfec8cbee0c...master
18:41 sri i'd really like to hear from postgres experts about this
18:42 sri if i use a placeholder in the ->do() call, the quotes actually become part of the value
18:52 sri quoting rules are odd here http://www.postgresql.org/docs/9.5/static/sql-set.html
18:54 sri so yea, placeholder is definitely wrong
18:54 sri array is reasonable
18:54 sri as a list of identifiers
18:54 * sri shrugs
19:00 genio ok, so I finally started using Mojo::JSON::Pointer and yea, it does make things a bit nicer
19:04 sri wow :o https://pragprog.com/book/swperl/modern-perl-fourth-edition
19:04 genio I see butterflies.  uh oh
19:05 Grinnz_ it doesn't have googly eyes, so it's ok.
19:05 sri first perl book from pragprog i believe
19:05 sri if someone wants to pitch a mojo book, now might be the time ;p
19:05 damaya joined #mojo
19:09 Grinnz_ ohnoez: http://www.makemegoogly.com/R1MR8
19:12 sri lol
19:15 fvox joined #mojo
19:16 glauber joined #mojo
19:18 disputin joined #mojo
19:21 damaya joined #mojo
19:27 Ulti left #mojo
19:44 genio I don't see anything but is there a is_url() function somewhere? Importing data into Atlassian Jira keeps failing because foo isn't a valid URL (they don't exactly publish their concept of a valid URL)
19:44 irqq_ joined #mojo
19:48 neilhwatson joined #mojo
19:48 jberger genio: what does your url look like?
19:49 genio some are obviously not URLs (old system had no restriction on what went in this field).  "n/a" for instance.    some have  "It's here: https://..."   so, I'd need to find the URL in those cases
19:49 Grinnz_ "n/a" can be a URL, it's just a relative one
19:49 genio but with thousands of issues having multiple URL fields it's going to be no fun
19:50 Grinnz_ if you're looking for full URLs, you want to look for the protocol
19:50 genio Grinnz_: Not according to whatever Atlassian Jira uses to validate it
19:50 Grinnz_ URI::Find does this sort of thing
19:50 Grinnz_ but i dunno if it would cover the cases you need
19:51 jberger genio: you might check is_abs
20:04 genio They really put this in a URL field: 'WPD 1107-23516 ITI: Evaluate Standard Bill Rate for Proposals task'
20:04 Grinnz_ lol
20:05 Grinnz_ when you're dealing with user input... anything is possible at zombocom
20:05 genio I was going to split on spaces, but some actual URLs have spaces that weren't encoded.
20:06 genio this is turning out to be more annoying than I thought at first
20:07 Grinnz_ hah
20:08 genio 'wiki'     'usual place'     'n/a'   'Unknown; my understanding is that this was sent already'   examples of things people apparently think are URLs
20:11 ajr_ joined #mojo
20:18 genio hahaha.  I give up:  'C:\\Repositories\\TTF_Document_Review_Archive\\Administration\\TFDW Webinars'
20:19 pink_mist C:\\ is clearly the scheme
20:23 asm35 joined #mojo
20:24 asm35 left #mojo
20:26 sri C: is the scheme
20:26 sri everything else is just scheme specific data
20:27 sri think data:foobar :)
20:27 pink_mist ah, good point =)
20:27 pink_mist I was more thinking: mailto:foo@bar.com
20:27 genio right.  But, these issues are for people to view and they should be able to view the file location this URL is pointing to.  let me just put a local drive path there. :)
20:28 genio That does nobody any good whatsoever
20:28 pink_mist sure it does :P it does the one who wrote it in the first place good :P and he would have very little latency also likely :P
20:28 pink_mist and wonder why everyone else is having problems :P
20:31 Grinnz_ C: is actually not the scheme, which is why URI::file has such fun with win32
20:32 Grinnz_ the URL form of that would be file:/C:/Repositories/etc
20:32 Grinnz_ (or file:/// if you prefer)
20:34 genio They have lots of relative paths to _somewhere_ in here too:   'TTF Doc. Review/Other'  'TTF Doc. Review - 10046.7.4LTR_PRP_wT_2.02_Dev_Workplan_.pdf'
20:34 Grinnz_ hah
20:34 Grinnz_ i would just say "put a real URL here or it's not getting handled"
20:34 genio people--
20:44 genio I'm just going to go with if it begins with https?:// and has no spaces, it's a URL.  forget all the others.
20:49 genio 2% have valid URLs by that metric.  \o/
20:51 pink_mist you might consider making it a case insensitive match?
20:52 genio I did
20:52 Grinnz_ lol
20:53 pink_mist 2% is surprisingly low 0_o
20:53 genio free form text entry
20:54 genio There is lots of <a href="actual_url" ... etc.     "location: https://..."    So, a much larger percent _has_ a valid URL somewhere in it, there's just no good way to find them
20:56 Grinnz_ genio: URI::Find might be usable for that
20:57 Grinnz_ it "should" find URLs which are surround in quotes, etc
20:58 Grinnz_ just check each one it returns with for the http or https scheme
20:59 Grinnz_ another complication: if it's pasted as an <a href=..> tag then it probably has to be HTML-unescaped
20:59 Grinnz_ heheh
21:01 cpan_mojo Paws-0.17 by JLMARTIN https://metacpan.org/release/JLMARTIN/Paws-0.17
21:02 sri oh, ruby gets a .? operator before perl :/
21:06 sri would have been so nice to have $foo->?bar equivalent to (defined $foo ? $foo->bar : undef)
21:06 lb oh lordy yes
21:07 lb rik says it's complicated, iirc
21:08 Grinnz_ that operator would be really nice
21:08 sri i think they couldn't reach consensus on exact semantics
21:08 sri like $foo containing a class name vs an object
21:08 sri all i want is undef
21:09 pink_mist same
21:09 Grinnz_ ^
21:12 lb at least we'll always have eval { $foo->bar->baz->omg->yikes->yeahweredeadnow }
21:16 disputin joined #mojo
21:18 sri wow, web apps are starting to look very native on android https://developers.google.com/web/updates/2015/10/splashscreen
21:19 Grinnz_ nice
21:36 meshl joined #mojo
22:20 sri allright, looks like there's not that much to look out for with search_path http://www.postgresonline.com/journal/archives/279-Schema-and-search_path-surprises.html
22:23 punter joined #mojo
22:47 mishantil joined #mojo
23:19 d4rkie joined #mojo
23:23 disputin joined #mojo
23:50 jnm_theMailman joined #mojo
23:52 jnm_theMailman left #mojo

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