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

IRC log for #mojo, 2014-07-10

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

All times shown according to UTC.

Time Nick Message
00:02 berov this is currently just a few lines above and in the same plugin - still completeley understand what you mean
00:02 berov as we started I would like to suggest something at leas as functionality to be taken from ado and put into mojo
00:03 berov this it https://metacpan.org/source/BEROV/Ado-0.51/lib/Ado/Plugin.pm
00:03 berov adding ability Plugins to have theyr own configuration fies
00:03 berov files
00:05 berov the functionality from Ado::Plugin to go to Mojolicious::Plugin
00:05 berov then Mojo:: Plugins
00:05 berov if they want
00:05 berov can have their own configurations
00:06 berov example: https://metacpan.org/source/BEROV/Ado-0.51/etc/plugins/auth.conf
00:06 sri that does not look like something you'd find in mojolicious
00:07 sri i have no opinion on the functionality, but the implementation has to get a -1 from me
00:08 sri "$self->app($app);#!Needed in $self->config!" is a total red flag... we don't do workarounds in core
00:08 sri https://metacpan.org/source/BEROV/Ado-0.51/lib/Ado/Plugin.pm#L28
00:08 sri using other plugins without exposing their configuration options is another red flag
00:09 berov not sure I understand the last
00:09 powerman left #mojo
00:10 sri we have multiple config plugins in core, you don't even make the json one available
00:10 sri so you'd have two layers of configuration files that worked completely different
00:10 sri total no go
00:11 berov aha now I think I got it
00:11 berov yes this is kind of hardcodded
00:13 berov will have to think more
00:13 berov still, no matter how bad is my implementation
00:14 berov since I tried to do it it is a flag other may need it
00:15 berov I wanted to avoid a big monolitic config file
00:15 berov and this is a small app yet
00:15 berov what when people want to build a big application?
00:16 berov they will have to edit a big configuration file
00:26 berov using https://metacpan.org/source/SRI/Mojolicious-5.12/lib/Mojolicious/Plugin/JSONConfig.pm
00:26 berov is easily detectable
00:27 berov I already : has=>'ext'
00:27 berov so it is easy to switch the config module depending on the file extension used
00:28 dvinciguerra joined #mojo
00:29 berov well yes, an app will have to stick with one config format only
00:29 davido__ joined #mojo
00:30 berov Imeant has ext => 'conf';
00:39 Averna joined #mojo
00:47 sri hope the minion api is complete now :S https://github.com/kraih/minion/commit/bf52e13f3e8dbe4cf407236823e0f96811eb7021
00:48 sri it should be enough for a pretty decent dashboard app
00:59 marty joined #mojo
01:45 klapperl_ joined #mojo
01:59 al joined #mojo
02:04 laouji joined #mojo
02:14 basic6_ joined #mojo
02:15 meshl Question about downloading a CSV file from Mojo: I do $self->res->headers->content_disposition("attachment; filename=$filename.csv"); - but the browsers removes the CSV extension and saves as a TXT file. How do I make the browser recognize it is actually a CSV file?
02:16 meshl Do I need to add the line: $self->res->headers->content_type('text/csv'); ?
02:21 meshl I tried that and the browser still removes the extension...
03:06 disputin joined #mojo
03:25 gatitskiy joined #mojo
03:30 KCL_ joined #mojo
03:40 tianon joined #mojo
03:46 jberger meshl: be sure to try a few different browsers
03:52 bpmedley meshl: Have you tried RenderFile?
04:00 basic6 joined #mojo
04:07 garu joined #mojo
04:15 garu joined #mojo
04:22 sujithm joined #mojo
04:42 davido_ joined #mojo
05:33 sri tempire: if pluggable backends went away you could also maintain a fork based on the current file backend
05:52 laouji joined #mojo
06:15 gatitskiy joined #mojo
06:20 sri phew... getting there https://github.com/kraih/minion/commit/dd7c71878ce7c1036f2ab62f268451a0f39d896c
06:27 sujithm joined #mojo
06:30 dod joined #mojo
06:58 rawler joined #mojo
07:01 eseyman joined #mojo
07:01 denis_boyun joined #mojo
07:07 basiliscos joined #mojo
07:22 Insane joined #mojo
07:27 Insane hi all, I want to use properties from myapp.conf at helper, so I did this: http://pastebin.com/ufjGq51w but hypnotoad fails to process request - Can't locate object method "plugin" via package "Cto::Sd" at /home/.../Helpers.pm line 152
07:27 Insane what I did wrong?
07:28 crab that's very strange
07:29 crab i would call ->plugin('config') in startup and just use $app->config in your register and not call ->plugin()
07:29 _eugen joined #mojo
07:31 Insane hm
07:33 Insane hehe, it works, thz!
07:34 Vandal joined #mojo
07:41 gatitskiy joined #mojo
07:41 trone joined #mojo
07:47 Insane crab, is some situations like syntax error or worng data hypnotoad is failing with server error page and writing perl error message to production.log, I could replace default server error page, but could I catch perl syntax error with this page to show them on it and log in application log?
07:54 denis_boyun_ joined #mojo
08:03 dpetrov_ joined #mojo
08:07 dod joined #mojo
08:14 sujithm joined #mojo
08:19 denis_boyun joined #mojo
08:24 sujithm joined #mojo
08:31 laouji_ joined #mojo
08:36 dod joined #mojo
08:39 edestler joined #mojo
08:50 john joined #mojo
08:58 crab i don't understand your question
08:58 fhelmber_ joined #mojo
09:00 dod joined #mojo
09:02 Eke- joined #mojo
09:19 tomboh joined #mojo
09:21 denis_boyun joined #mojo
09:51 Insane crab, i found what i needed, but still have question... i've created before_render hook wich dumps data into log if [Thu Jul 10 12:41:22 2014] [debug] Line Num: 64
09:51 Insane o.o
09:51 Insane ...if $args->{'exception'}, and it runs 3 times for one request without any redirects
09:52 Insane here is hook source: http://pastebin.com/5TUmx2Yq
09:53 D4RK-PH0ENiX joined #mojo
09:54 Insane why does this hook run 3 times?
09:57 crab dunno
10:01 mr-fooba_ joined #mojo
10:12 al joined #mojo
10:12 frustrating_chat joined #mojo
10:13 diegok joined #mojo
10:17 condor66 joined #mojo
10:28 bpmedley Insane: Do you wan to wrap your route in an eval and show an exception page if there is a die?
10:39 chankey joined #mojo
11:13 gatitskiy joined #mojo
11:19 meshl joined #mojo
11:24 ryozi joined #mojo
11:24 d4rkie joined #mojo
11:31 meshl joined #mojo
11:31 neilhwatson joined #mojo
11:42 condor66 hi all, I have a subroutine at the start of my .pl file and then I don't call it from anywhere but it still gets execute by mojo, would you know why?
11:42 condor66 outside of controller...
11:48 d4rkie joined #mojo
11:48 condor66 my bad, I was calling it with delay->on(finish =>, it look slike the subroutine on finish of the delay is called earlier than my delay finishes processing all the requests results... is that normal?
11:49 lipizzan joined #mojo
11:58 jberger condor66: you have to call begin for each process, that builds the counter which knows when to advance
11:58 dvinciguerra joined #mojo
12:04 Eke- joined #mojo
12:06 condor66 jberger: http://pastebin.com/RkV0cBxk - I'm calling being on line 147 and have on(finish) defined at 106
12:10 condor66 but I see check_bids_asks is invoked before I have $orderbooks{'bitfinex'}{'bids'}[0][0] defined (it comes ok when I print it from inside the delay - line 100)
12:22 condor66 am I making a silly mistake here somwhere?
12:24 Eke|| joined #mojo
12:24 punter joined #mojo
12:48 sujithm joined #mojo
12:52 mr-foobar joined #mojo
12:59 bobkare joined #mojo
13:01 r0b3rt joined #mojo
13:03 Lingo joined #mojo
13:06 dod joined #mojo
13:15 Eke- joined #mojo
13:22 powerman joined #mojo
13:27 Skinny joined #mojo
13:31 powerman sri: I'm on 5.08, is it correct if after starting and finishing 10 simultaneous $ua->get, Mojo::IOLoop->start doesn't exits in next several seconds until inactive_timeout() happens?
13:32 powerman I'm also have production code which in similar case result in:
13:32 powerman Can't call method "_error" on an undefined value at /usr/lib64/perl5/vendor_perl/5.16.3/Mojo/UserAgent.pm line 113.
13:32 powerman Can't call method "_handle" on an undefined value at /usr/lib64/perl5/vendor_perl/5.16.3/Mojo/UserAgent.pm line 114.
13:32 powerman but I'm unable to turn it into small example yet :(
13:35 powerman btw, I think this happens because $ua destroyed after finishing last ->get
13:35 Lingo joined #mojo
13:36 powerman (I mean $ua is lexical and goes out of scope after last ->get, i.e. I destroy it intentionally when it doesn't needed anymore)
13:40 Lingo_ joined #mojo
13:45 sujithm joined #mojo
13:50 btyler joined #mojo
13:56 basiliscos1 joined #mojo
14:03 Lingo__ joined #mojo
14:03 dvinciguerra joined #mojo
14:04 marty joined #mojo
14:05 g1tlh joined #mojo
14:07 * g1tlh is confused by mixing timeouts with stuff and (not) reading stuff coming down serial ports
14:09 tyzzarol joined #mojo
14:09 g1tlh specifically whilst I have not problems with serial ports and mojo as such, I want to add variable timeouts to the waiting for input and my brain is starting to explode trying to make this happen
14:09 bluescreen joined #mojo
14:14 tyzzarol anybody knows why $self->param() inside bridge always returns undef ?
14:14 tyzzarol http://paste.kde.org/py7wotu4o
14:15 tyzzarol although in controller action chain after bridge param receives normal value
14:21 Lingo__ joined #mojo
14:23 powerman tyzzarol: I'm not sure, but I suppose param() filled after final route match, while bridge's handler called earlier - check $c->req->query_params, it probably should work in bridge
14:24 tyzzarol powerman, same powerman as on habr? -_-
14:24 powerman yes :)
14:24 tyzzarol heh
14:28 sh4 joined #mojo
14:28 tyzzarol powerman, таки не работает, попробую что-то еще
14:28 tyzzarol но все равно спасибо
14:30 powerman tyzzarol: of course it doesn't work! you checking param which isn't GET/POST one, but comes from route's :placeholder
14:30 powerman bridge handler runs before final route's match, so it can't see placeholder's value
14:31 tyzzarol but how then make acl based on parameter in route if not via bridge?
14:32 powerman you can try $r->under('/search/:campaign')->to(campaign => 'aaa', cb=>sub{…})->any()->to('main#search');
14:35 disputin joined #mojo
14:35 tyzzarol powerman, you saved me, triple thanks!
14:48 dod joined #mojo
14:55 dod joined #mojo
15:04 dvinciguerra joined #mojo
15:14 * sri still would like feedback on the minion backend api http://mojolicio.us/perldoc/Minion/Backend#SYNOPSIS
15:22 mattastrophe joined #mojo
15:30 KCL joined #mojo
15:45 meshl joined #mojo
16:07 btyler_ joined #mojo
16:13 gatitskiy joined #mojo
16:21 dod joined #mojo
16:25 * tempire sees no issue with the backend api
16:26 tempire methods are obviously named
16:26 * tempire plans on converting some existing systems to minion over the next month
16:27 * tempire will certainly use the file backend for tests
16:27 sri tempire: one problem is that there have been requests for more non-blocking methods
16:28 sri 15 methods with one being blocking/non-blocking is a rather big api already
16:29 tempire I missed that conversation. What non-blocking methods are people wanting?
16:29 sri so, a iine needs to be drawn
16:29 sri *line
16:29 sri in the wishlist thread on the list
16:30 sri https://groups.google.com/d/msg/mojolicious/mIRRwNwDLSE/2PjIqAdxir8J
16:32 tempire I agree about worrying about it once a web interface exists.
16:33 disputin joined #mojo
16:34 tianon joined #mojo
16:36 gatitskiy joined #mojo
16:37 sri tempire: worrying about the complexity or lack of non-blocking methods?
16:38 sri a web interface would most likely use the entire api... like the job command currently does... so non-blocking variants would mean 15 methods with blocking and non-blocking variants
16:40 sri and that still doesn't cover super real-time use cases
16:40 sri like if you want to stream state changes for all jobs
16:41 tempire the lack of non-blocking methods
16:43 sri non-blocking versions of all methods are never ever going to happen
16:43 sri it's either what we have now, or pure mongodb
16:45 sri for the record... i'm still not convinced a file based backend is even necessary... so far i've seen no evidence whatsoever
16:45 powerman left #mojo
16:46 gatitskiy joined #mojo
16:50 Kripton joined #mojo
16:54 sri interesting to see more people interested in non-blocking methods than pluggable backends... i guess so far it looks like mongodb only will win
17:02 lipizzan Using Mojo::DOM, I'm trying to pluck all_text from ...    <div class="prop-mod prop-summary">, but the space seems to result in failure?
17:02 lipizzan I'm....     say $dom->find('prop-mod prop-summary')->pluck('all_text');
17:03 sri http://mojolicio.us/perldoc/Mojo/DOM/CSS#SELECTORS
17:04 lipizzan ok, I'm reviewing, but I actually try...   say $dom->find('div.prop-mod prop-summary')->pluck('all_text');
17:06 good_news_everyon joined #mojo
17:06 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Jfm1aA
17:06 good_news_everyon mojo/master d44a213 Sebastian Riedel: fixed formatting of selector list
17:06 good_news_everyon left #mojo
17:07 sri lipizzan: do you know how classes work in html?
17:10 lipizzan <@sri>:  maybe not so much. Mostly I thought it a naming tag for uniqueness.
17:10 sri they are a whitespace separated list of classes
17:11 rem_lex|pivo joined #mojo
17:11 sri not one value
17:11 Adurah joined #mojo
17:11 mattastrophe joined #mojo
17:12 sri so if you need to match on two classes, you use two class selectors
17:17 g1tlh I am still (unsuccessfully) trying to associate a timer with a serial port read (and not anything else, if it can be avoided) with Mojo::IOLoop. The problem is not the read/writing, that all works fine. It is getting the time to stop, and signal the serial reader with something to indicate "timeout". Can anyone help?
17:18 meshl joined #mojo
17:19 gatitskiy joined #mojo
17:26 gatitskiy joined #mojo
17:34 genio g1tlh: pastebot up what you have somewhere so we can take a look
17:36 lipizzan maybe there's some typos in http://mojolicio.us/perldoc/Mojo/DOM/CSS#SELECTORS  ?  I think examples #4 & #5 reference "foo" in the code example, when it should be "bar"?
17:42 Eke- joined #mojo
17:42 disputin joined #mojo
17:45 meshl joined #mojo
17:51 cfedde joined #mojo
17:53 cfedde joined #mojo
17:53 cfedde joined #mojo
17:54 cfedde joined #mojo
18:03 abhishekisnot joined #mojo
18:08 berov joined #mojo
18:13 sri tempire: do you actually have a use case for more non-blocking methods?
18:14 tempire No
18:14 tempire Which is why I'm not concerned about it, even if someone's made a request.
18:15 sri tempire: oh, rereading your earlier comment... i think i misunderstood you
18:15 sri i thought you meant you were worried about it
18:16 sri but i guess you meant we should worry about it later... when it actually becomes a problem
18:16 tempire yes
18:16 sri ok, that makes more sense :)
18:27 kyshtynbai joined #mojo
18:41 sri on the plus side, celery backends are *a lot* uglier than minion backends https://github.com/celery/celery/blob/master/celery/backends/mongodb.py
18:52 disputin joined #mojo
18:54 sri those are only for storing results though... looks like celery actually uses an external library with its own backend implementations for distributing jobs :o
18:56 sri which is quite a bit more complicated https://github.com/celery/kombu/blob/master/kombu/transport/mongodb.py
18:59 sri the redis backend alone is twice as big as minion
19:09 meshl joined #mojo
19:25 sforsyt joined #mojo
19:26 sforsyt does anyone know of a way to get SublimeText3 to play nice with Morbo?  I tried setting {"atomic_save": false} in Preferences, but that did not fix it
19:34 denis_boyun joined #mojo
19:38 sforsyt On Windows7 _x64, morbo seems to be setting myapp.pl to read only , both sublimeText and Vim fail to write to it while running
19:46 basic6_ joined #mojo
19:52 disputin joined #mojo
19:56 sforsyt left #mojo
20:28 meshl joined #mojo
20:37 sujithm joined #mojo
21:19 bluescreen_ joined #mojo
21:24 neilhwatson joined #mojo
21:29 * sri was considering the addition of SOCKS support to Mojo::UserAgent... but it seems IO::Socket::Socks is not there yet
21:41 disputin joined #mojo
21:43 DaTa joined #mojo
22:03 meshl joined #mojo
22:11 basiliscos joined #mojo
22:16 basic6 joined #mojo
22:22 nishttal2 joined #mojo
22:23 nishttal2 I'm facing a weird problem today.. I work at my home & work machine.. synchronize code with git.. up until now my mojolicious app would work fine at both computers.. but today.. the exact same code is working on my work machine but not on my home machine
22:24 nishttal2 there are no errors in the console
22:25 nishttal2 and the browser console says.. POST http://localhost:3000/snap/cost?sid=53bf107a27d08e12ff010000 500 (Internal Server Error)
22:27 nishttal2 never mind .. :-|
23:14 dvinciguerra joined #mojo
23:41 disputin joined #mojo
23:41 d4rkie joined #mojo

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