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

IRC log for #mojo, 2015-05-01

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

All times shown according to UTC.

Time Nick Message
00:16 jb360 joined #mojo
01:17 punter joined #mojo
01:18 klapperl_ joined #mojo
01:26 Zoffix joined #mojo
01:46 buu jberger: What comment is that?
01:58 asarch Ok, Slackware uses SlackBuilds to add new software (compiled by hand unlike other distros) to the system. The database package, located a /var/log/packages, are plain text files with the package name + package version as the name of the file (e.g. perl-5.18.1-i486-1)
01:59 shadowpaste "asarch" at 217.168.150.38 pasted "Skerpt from perl-5.18.1-i486-1" (66 lines) at http://paste.scsys.co.uk/475497
02:01 asarch I opened the file and parsed every line of the file and, in a big var, created the <a href="file:///usr/bin/pod2html">usr/bin/pod2html</a> file link for every file that the package contains
02:02 asarch So I get a nice list in HTML code with the URL so I can simply point and clic to inspect the file that the package description contains in the browser
02:02 asarch ...theorically because, I tried with Firefox, Google Chrome, IE, it doesn't work
02:03 asarch I can select the url but when I clicked nothing happens
02:04 asarch Even with a CGI script in all languages I know I get the same result, I can select the link but it doesn't open the file
02:04 asarch Why? :-(
02:06 asarch If I right click the link and copy its address and use that address in a new tab, it works
02:08 preaction what would it do? execute pod2html?
02:11 asarch Actually I use that Mojo application to quickly check some DocBook style sheets
02:11 asarch I just want to check the content of a specific installed file from a specific package
02:12 asarch So, instead of doing: ls /var/log/packages | grep docbook | xargs grep docbookx.dtd | xargs less in a shell
02:12 asarch I could use the Mojo application from any point in my LAN
02:18 asarch Although, I think that in another different machine, the URL <a href="file:///usr/bin/pod2html">usr/bin/pod2html</a> could not exist...
02:20 mattastrophe joined #mojo
02:22 noganex joined #mojo
03:49 disputin joined #mojo
03:49 misty_g3ar joined #mojo
03:53 basic6 joined #mojo
03:59 disputin joined #mojo
04:12 irq joined #mojo
04:53 ashimema got a feeling I'm missing a trick somewhere..
04:54 vmbrasseur joined #mojo
04:54 ashimema can two different mojo apps listen on the same port an filter on domain?
04:54 ashimema that was a silly question.. there are lots of ways to do it..
04:54 ashimema it's too early.. ignore me
04:55 kaare joined #mojo
04:59 ashimema toadfarm appears to be what I was looking for
04:59 ashimema :)
05:20 ashimema exit
05:23 coolo voice driven irc client? :)
05:23 Adura ИO ∩
05:44 polettix joined #mojo
06:16 bpmedley_ joined #mojo
06:21 arpadszasz joined #mojo
07:12 wariat joined #mojo
07:24 trone joined #mojo
07:27 ashimema joined #mojo
07:48 ashimema I'm fed up of using system perl.. would anyone here like to recommend one of the it seems many approaches to moving away from it.. perlbrew, plenv, carton..?
07:49 ashimema or direct me at a comparison article so I stand a better chance of working it out myself ;)
08:08 ToApolytoXaos joined #mojo
08:12 batman ashimema: plenv
08:12 batman ashimema: carton is not a competitor. it's just a way to make sure you use the exact versions of the different modules with a given project
08:14 batman https://github.com/tokuhirom/plenv#plenv-vs-perlbrew
08:14 Vandal joined #mojo
08:15 batman ashimema: note that using toadfarm and carton might not result in what you expect. the reason is that the first version of a library loaded into the perl process will be the one that all your project use.
08:16 batman this is impossible, if both apps are loaded into the shared toadfarm application: MyApp require Mojolicious 5.00 and YourApp require Mojolicious 6.00
08:22 dod joined #mojo
08:22 amon joined #mojo
08:26 AndrewIsh joined #mojo
08:28 dod joined #mojo
08:29 berov joined #mojo
09:08 memowe joined #mojo
09:08 jb360 joined #mojo
09:15 fhelmber_ joined #mojo
09:18 polettix joined #mojo
10:08 pink_mist another option is Perl::Build
10:09 cereal_ joined #mojo
10:40 storskegg joined #mojo
10:41 ashimema Cheers guys..
10:42 ashimema Very helpful indeed.
10:43 ashimema What i'm currently thinking is using toadfarm to run up multiple instances of the same app actually.
10:43 ashimema making it multi-tenant in effect
10:43 ashimema same app with different config loaded per 'instance' called by toadfarm..
10:44 ashimema all living inside the same plenv
10:44 ashimema does that sound reasonable..
10:57 sh4 joined #mojo
11:00 punter joined #mojo
11:03 storskegg joined #mojo
11:05 storskeg_ joined #mojo
11:32 stable_kernel joined #mojo
11:34 stable_kernel Good day! I am student from Moscow Russia, I know perl (7/10) and study web. Can some one please help me to study mojo?  I can work on your project  and I can translate to Russian what you need.
11:34 polettix joined #mojo
11:43 stable_kernel Also I can help you with traveling in Russia)
11:44 stable_kernel hm.... What is the best way to study in online?
11:51 depesz left #mojo
11:56 Kripton joined #mojo
12:05 mattastrophe joined #mojo
12:11 mattastrophe joined #mojo
12:17 asarch joined #mojo
12:19 neilhwatson joined #mojo
12:22 jberger ashimema: I still prefer perlbrew
12:22 jberger its local lib integration is so nice
12:22 jberger that's for development
12:23 jberger for deployment I would probably use perl-build
12:40 stable_kernel joined #mojo
12:56 gryphon joined #mojo
12:58 ajr_ joined #mojo
13:26 ZoffixWork joined #mojo
13:29 polettix joined #mojo
13:32 memowe joined #mojo
13:34 nf joined #mojo
13:40 storskegg joined #mojo
13:50 AirDisa joined #mojo
13:52 harry joined #mojo
14:03 harry batman: hi
14:23 batman harry: Hey.
14:23 batman I just down very quickly my thoughts.
14:23 batman I'm waiting on the bus...
14:23 batman *wrote down
14:24 batman The SLEEP(60) hack is very cool :)
14:24 batman Crap. All these typos when I'm on my phone :/
14:25 mst I want a phone with a bloody keyboard again
14:25 mst I'm tired of not being able to touch type
14:26 harry there are some accessories for keyboardless phones
14:26 batman mst:)
14:26 batman harry: Not very handy, when you hold your phone with your hands :)
14:26 batman Hehe
14:26 cfedde maybe that new microsoft 3D interface will finaly solve that problem.  Just wear your Oculus headset everywhere.
14:26 mst the last phone I truly loved was my N900
14:27 batman harry: the reason I'm mentioning the table name was simply because I thought it wouldn't make much sense if other libraries would use them.
14:27 batman But... I'm not sure if I care :)
14:28 harry probably just pubsub_ is better than mojo_pubsub_
14:29 batman harry: maybe. But if you don't care, then I will stop worrying :)
14:29 harry I chose mojo_pubsub just to have same naming convention as in Mojo::mysql::Migrations
14:29 batman harry: That is consistent.
14:30 mst I think if anybody else wants to share it, they can submit a patch to make the name configurable
14:30 mst if they actually care
14:30 batman mst: yeah.
14:31 batman harry: let's keep the table names as is.
14:42 batman harry: Could you point me to where in the code that makes the publisher not a listener?
14:43 harry line 25: $self->mysql->db->query
14:43 harry publisher takes new db connection and immediately releases it
14:48 batman harry: Oh! So line 23 is just for debugging?
14:48 harry and starting listening connection if not yet started
14:49 * batman reads again
14:49 harry and executing migrations script if necessary
14:50 stable_kernel joined #mojo
14:50 harry probably _db method should be renamed to something more descriptive
14:50 batman harry: So where in _db() do you return if you're a publisher?
14:51 batman To me, it seems like you're going through an awful lot of code if you're publishing...
14:52 lluad joined #mojo
14:55 mattastrophe joined #mojo
14:56 harry batman: yes, but only when called for the first time
14:57 nf joined #mojo
14:59 batman harry: Because $self->{db} is set?
14:59 batman What if I only want to publish? What use is
14:59 harry yes
15:00 batman ...$self>{db} then?
15:00 disputin joined #mojo
15:01 harry probably there is rare case where only publish is needed, and there is no need to start subscriber connection
15:02 harry but can be also a rara case where migrations are not yet executed
15:05 batman I will try to refactor that sub. I'll send you a gist later...
15:06 batman What about TEXT instead of VARCHAR?
15:09 batman harry: ^^
15:17 batman ah. i see your commits now :)
15:18 kaare joined #mojo
15:40 nf joined #mojo
15:42 wariat_ joined #mojo
15:46 AirDisa_ joined #mojo
15:54 batman harry: there's a lot of tidy diff here as well, but this is how i would do it: https://gist.github.com/jhthorsen/41c83039e26e068a655f
15:54 batman unfortunately, i don't have mysql with me, so i can't test the code :(
16:18 ajr_ joined #mojo
16:21 polettix joined #mojo
16:36 ajr_ joined #mojo
16:37 misty_g3ar joined #mojo
16:37 harry batman: I've applied your patch with few fixes
16:47 fhelmber_ joined #mojo
16:51 batman harry: thanks :)
16:52 al joined #mojo
16:52 dod joined #mojo
16:53 batman harry: how about calling unlisten() on DESTROY to clean up tables?
16:54 batman no idea if that's a good idea, just throwing the idea out.
16:54 batman hm... you already have the "delete" statements in _init(), so i think we're good
16:56 ZoffixWork joined #mojo
16:57 harry batman: It's not bad idea to unlisten on DESTROY, I will add this
16:57 ZoffixWork Hey, how come this is trying to render 'root/products_handler.html.ep' template and not 'root/products.html.ep'?  $r->get('/products(*category)')->to('root#products_handler', { category => '' })->name('root/products');
16:58 ZoffixWork { category => '' } bit is providing default for *category placeholder, which I assume is the right way to do it, based on the docs
16:58 batman harry: i really don't like doing anything complex in DESTROY, so that's on you if you decide to do it :-)
16:59 batman harry: i'm actually very happy with what you have done now. i only have some questions...
16:59 batman s/actually// # sounds condescending. sorry about that :(
17:00 batman ZoffixWork: because of "root#products_handler"
17:01 ZoffixWork batman, then what purpose does ->name('root/products') serve? I thought templates were guestimated from route names....
17:02 batman ZoffixWork: the purpose is when you do redirect_to() or url_for() and want to use named routes
17:02 batman could be more as well, but that's what i can remember from the top of my head...
17:03 harry batman: very reasonable questions
17:03 ZoffixWork Alright. Thanks.
17:03 harry answers have to be in the pod
17:05 batman ZoffixWork: if you want more details: https://metacpan.org/source/SRI/Mojolicious-6.10/lib/Mojolicious/Renderer.pm#L155
17:05 batman harry: yeah, that would be awesome.
17:06 ZoffixWork Thanks.
17:07 batman harry: after you can provided some answers, i will hit the merge button
17:08 batman harry: i really, really think this is some evil, crazy stuff and i just <3 it :-)
17:08 batman harry++
17:09 * batman is afk for about 20 min
17:26 kaare joined #mojo
17:31 disputin joined #mojo
17:32 ajr_ joined #mojo
17:49 harry batman: I've mentioned needed privileges in the pod
17:54 ashimema back on my plenv playings..
17:55 ashimema I have a .perl-version and a plenv version gives me the version I'm expecting..
17:55 ashimema but running morbo from within that directory still uses the system perl..
17:55 ashimema anyone here happen to have any thoughts as to what I may be getting wrong.
17:56 batman harry: is SUPER higher than SUPERT?
17:58 harry SUPER typo
17:58 AirDisa joined #mojo
17:59 batman oh! i thought SUPERT meant SUPER + TRIGGER, haha
18:04 Anon021 joined #mojo
18:07 disputin joined #mojo
18:24 disputin joined #mojo
18:48 Grinnz https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http/ hahaha good luck
18:54 Grinnz ashimema, you're sure you are running the right morbo executable? not the one installed in system perl?
19:29 AirDisa joined #mojo
19:30 AirDisa joined #mojo
19:32 stephan48 Grinnz: i want some of that stuff they smoke! it seems to be really really good
19:32 melo1 joined #mojo
19:37 AirDisa_ joined #mojo
19:39 fhelmber_ joined #mojo
20:15 dod joined #mojo
20:15 dod joined #mojo
20:31 melo joined #mojo
20:32 dod joined #mojo
20:46 vmbrasseur joined #mojo
20:49 vmb joined #mojo
20:59 AirDisa joined #mojo
21:33 polettix joined #mojo
21:40 depesz joined #mojo
21:41 depesz hi. another stupid question. is there any shortcut for checking if static file exists, before I put link to it in template?
21:41 Zoffix -e ?
21:41 purl it has been said that -e is exists, -x is executable
21:41 depesz Basically, I'd like to add <script src="/js/{current_route}.js"></script>, but only if this file exists in public.
21:42 depesz Zoffix: how can I get filesystem level path to "public" directory?
21:42 Zoffix Find::Bin is the proper way, would be my guess.
21:42 Zoffix I'd just do ../public :)
21:43 depesz I would assume that there has to be some kind of property in mojo that shows directory of public ...
21:43 depesz or maybe project root directory
21:44 Zoffix $c->app->home
21:45 depesz nice, thanks.
21:45 Zoffix That's what I see in the docs, but not sure where it's described. Not seeing it in Mojolicious's pod.
21:45 Zoffix my $path = $c->app->home->rel_file('templates/foo/bar.html.ep');
21:46 Zoffix So in your case, I'd guess it'd be if ( -e $c->app->home->rel_file('public/js/' . $c->route('current') . '.js') ) { ... }
21:46 Zoffix Oh wait, I made $c->route up...
21:47 Zoffix There's $c->current_route, but it looks to give a name. If that works for you, then sure.
21:48 depesz ooh. this looks better: ->static
21:48 depesz but I can't see a way to use it to just check if such file exists
21:49 Zoffix What do you mean?
21:50 Zoffix Is -e not suitable?
21:50 depesz it is, but what if I'll change public directory later on?
21:50 depesz ->static() has paths to static directories.
21:51 Zoffix What is ->static() BTW. What are you calling that on?
21:51 Zoffix Never mind, found it.
21:52 Zoffix But back to it. I don't get what you mean though. In your template, you can add the <script> tag, only if the file exists, when checking with -e
21:53 depesz i think I have it. will paste code when I'll have it ready, for review.
21:58 jberger depesz: http://mojolicio.us/perldoc/Mojolicious/Static#file
21:58 depesz jberger: yeah, but I don't want to load it, while generating html
21:59 depesz it looks like making the asset object will load the file
22:00 jberger yeah, I don't think there is a current way to avoid that
22:04 depesz i think i made it: http://depesz.privatepaste.com/178c1895ea
22:04 depesz what do you think, Zoffix, jberger ?
22:05 Zoffix depesz, what's with our $static?
22:06 Zoffix I'd have $self->app->static->paths up in there instead
22:07 depesz makes sense.
22:07 Zoffix \o/
22:08 depesz basically wanted to "cache" the reference to avoid some method calls
22:08 depesz but I guess it's not all that important.
22:08 jberger yeah, don't cache that
22:08 Zoffix Premature optimization :)
22:09 jberger depesz: note that the version in mojo first splits the file on / then joins wiht file::spec
22:09 jberger that lets you always use unix-y paths
22:09 jberger even on windows
22:10 depesz nice. not that I would ever use windows
22:10 jberger https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Static.pm#L43-L46
22:10 jberger note also that to be complete you should also be searching the DATA handles
22:11 jberger but that depends on your usage (unless you are intending this for cpan)
22:11 depesz jberger: definitely not cpan
22:11 depesz my own personal "fun"
22:11 depesz i'll add the split, though, good idea.
22:12 Zoffix :/
22:12 jberger you might also want to test with -f and -r
22:12 jberger https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Static.pm#L135
22:12 Zoffix I'm pretty sure you can use '/' for paths on Windows
22:12 Zoffix It least with regular open()
22:12 jberger Zoffix: C:\path\to\app/static/file.js is going to work?
22:12 depesz jberger: thanks. will consider. there will be just one user of this (me), so I'm not overly worried, but it could be good, if only to enforce good habits
22:12 Zoffix Not sure what Mojo is doing with dempaths
22:13 Zoffix jberger, I'm gonna try right now :)
22:16 Zoffix jberger, yup: http://i.imgur.com/vI3Abwj.png
22:17 Zoffix What I did run into is apparently ActiveState makes the paths in return values of caller() use '\', regardless of how you start the script, whereas Strawberry uses whatever paths you started script with
22:17 Zoffix (or something like that... I just remember dealing with some failures with Test::Synopsis on that)
22:18 Zoffix Ah, now I remember, this: https://github.com/miyagawa/test-synopsis/issues/14
22:18 Zoffix Other than that, I always used '/' for paths when I had to code for Windblows.
22:20 jberger I know that Sinan Unur has said that that isn't always true
22:20 jberger but I'm no windows guy, so I can't comment
22:20 Zoffix me neither, so I might be wrong too :)
22:29 Zoffix perldoc perlport advises against using hardcoded paths and use File::Spec, so there.
22:35 cpan_mojo Mojolicious-Plugin-SizeLimit-0.003 by GRAF https://metacpan.org/release/GRAF/Mojolicious-Plugin-SizeLimit-0.003
22:55 dave joined #mojo
23:14 Zoffix You know you've had too many beers for coding when you get "inline template 19bd57b6f08f0cd11facc0914a129dca has too many errors" :D
23:15 punter joined #mojo
23:31 dave Fork of Firefox anyone?
23:31 vmbrasseur joined #mojo
23:49 AirDisa joined #mojo

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