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

IRC log for #mojo, 2014-01-10

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

All times shown according to UTC.

Time Nick Message
00:02 marty that reminds me.  I have to swap out my homegrown validation checks and start using validation built into Mojolicious.
00:04 marty jason_:  what specific variable from that example are you seeing that is being used in the same way as your example?
00:04 jason_ $validation
00:09 marty $validation is declared inside a sub and is not passed to the template.
00:09 jason_ so if i define my variable inside the sub it will be usable in the template?
00:10 marty you have to use the stash to pass variables to your templates.
00:11 marty If you want a global variable that is accessible to all temples then you should use defaults.    http://mojolicio.us/perldoc/Mojolicious#defaults
00:13 HtbaaPi joined #mojo
00:13 jason_ okay, but im still not clear how to set $c = @@ index.html.ep
00:13 jason_ to do $c->stash('myvar')
00:14 marty more stash examples.   http://mojolicio.us/perldoc/Mojolicious/Lite#Stash_and_templates
00:15 jason_ oh ok
00:15 jason_ thx
00:20 good_news_everyone joined #mojo
00:20 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Li62VQ
00:20 good_news_everyone mojo/master 6be45bc Sebastian Riedel: use slightly rounded corners
00:20 good_news_everyone left #mojo
00:23 dvinciguerra joined #mojo
00:25 * sri kinda would like to do something else with the striped blue table design on the not found and exception pages... but is not sure what
00:25 jack joined #mojo
00:30 jberger joined #mojo
00:35 dsteinbrunner joined #mojo
00:46 good_news_everyone joined #mojo
00:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ivPumw
00:46 good_news_everyone mojo/master 5eb0a8c Sebastian Riedel: more consistent margins for tables without hidden information
00:46 good_news_everyone left #mojo
00:53 jberger_ joined #mojo
01:00 laouji joined #mojo
01:13 dsteinbrunner joined #mojo
01:28 elvis joined #mojo
01:28 batman joined #mojo
01:40 rem_lex|pivo joined #mojo
01:41 ka2u joined #mojo
01:55 d4rkie joined #mojo
01:55 laouji joined #mojo
02:16 jberger joined #mojo
02:21 laouji joined #mojo
02:31 amirite joined #mojo
02:46 d4rkie joined #mojo
02:48 klapperl joined #mojo
02:49 amirite joined #mojo
02:49 amirite joined #mojo
04:09 marty_ joined #mojo
04:17 irq joined #mojo
04:32 preflex_ joined #mojo
04:46 laouji joined #mojo
04:55 ralesk_ joined #mojo
04:59 ka2u joined #mojo
05:04 laouji_ joined #mojo
05:12 good_news_everyone joined #mojo
05:12 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/w38N3w
05:12 good_news_everyone mojo/master 0ed0178 Sebastian Riedel: more consistent margins
05:12 good_news_everyone left #mojo
05:18 stl joined #mojo
05:21 good_news_everyone joined #mojo
05:21 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/SZhlDw
05:21 good_news_everyone mojo/master eb8802d Sebastian Riedel: align exception context correctly
05:21 good_news_everyone left #mojo
06:01 Adurah joined #mojo
06:48 firnsy hypnotoad hot deployment FTMFW!!!
07:00 moritz firnsy: indeed, I love it too
07:02 laouji joined #mojo
07:03 Tiger joined #mojo
07:19 Vandal joined #mojo
07:28 stl joined #mojo
07:39 da5id joined #mojo
07:47 dod joined #mojo
07:51 dpetrov_ joined #mojo
07:59 dod joined #mojo
08:02 laouji joined #mojo
08:06 irq joined #mojo
08:09 KindTwo joined #mojo
08:21 laouji joined #mojo
08:33 odc joined #mojo
08:39 trone joined #mojo
09:17 maxhq joined #mojo
09:22 batman is there a max size for the server when uploading files?
09:23 batman found it! 10485760
09:26 batman can i just increase that value in a before_dispatch hook? like $c->tx->req->max_message_size(100e6) if time % 10; ?
09:30 batman i don't get how to render an error page on 413 *digging deeper*
09:34 basiliscos joined #mojo
09:35 batman do i need to hook into the "finish" event for $tx?
09:36 Dandre Hello,
09:38 Dandre Is there anyway to have deferent namespaces for I18N plugin. I mean one namespace for each plugin in an application.
09:39 Dandre Can I simply install (or initialise) a I18N plugin in my plugins register method?
09:39 batman no, that won't work
09:39 batman Dandre: why do you want that?
09:47 Dandre batman: I have an application that contains several plugins for maintenability. I want to put all I18N in each plugin to make them self containing
09:47 batman oh! i thought you meant the other way around.
09:48 Dandre and also if one plugin is used in more than one app I want to make the I18N only once
09:48 Dandre I don't know how to do that
09:48 denisboyun joined #mojo
09:50 batman Dandre: i don't think that will work, since the i18n is stored in the controller stash, which means that there can only be one pr. request
09:58 denisboyun joined #mojo
09:59 Dandre Ok I'll try to find something to extend search path
10:03 batman sri: can i change max_message_size pr request?
10:04 batman http://p.thorsen.pm/1447b6bde7bf # this does not seem to work
10:08 tudorconstantin joined #mojo
10:10 batman better example: http://p.thorsen.pm/078975621488
10:18 fhelmber_ joined #mojo
10:18 batman oh. does not look like the controller logic has started at all before the 413 response
10:20 dvinciguerra joined #mojo
10:38 bzero joined #mojo
10:40 mire__ joined #mojo
10:48 denis_boyun_ joined #mojo
11:01 nic sri: numbered tests are great
11:01 nic There's the editing convenience of having the first 2 chars unique
11:01 nic and I'm the person running them most often (sequentially)
11:01 nic and my tests work fine run concurrently or with --shuffle
11:01 nic so "bullshit" doesn't apply here
11:02 nic Well, I know some of the actual tests are bull, but the filenames are not among the problems
11:04 batman i agree with sri
11:06 bowtie_ joined #mojo
11:15 chansen there is nothing wrong with having tests named sequentially
11:15 batman there's nothing from prefixing all tests with "aaa" either.
11:16 batman s/from/wrong/
11:16 batman just looks weird
11:17 chansen I usually keep a logical order in my tests using numeric prefixes
11:18 chansen like this <https://github.com/chansen/p5-time-moment/tree/master/t>
11:19 chansen For example all 1xx tests constructors
11:19 batman i hear what you are doing, but not why it's a good idea.
11:20 batman ...it really isn't any good reason for it
11:20 batman s/it/there/
11:22 chansen I just said, it's a logical order, if that's not a good reason ...
11:25 hrupp all my tests are named .t . I think thats the best convenience
11:31 batman hrupp++ # :)
11:32 hrupp batman: :) , news about M::S::Tcp ?
11:34 batman what's that?
11:34 purl that is the issue.  I would like to have the catalyst stuff just as adaptors for the plack stuff but there's enough trouble there to not encourage the work to do so :(
11:35 hrupp Mojo::Server::Tcp
11:35 hrupp you've created
11:35 batman hrupp: ah! it's working, but it will break anytime...
11:36 batman i need an event in Mojo::Server when a new connection comes in
11:36 batman the event is not added to mojo
11:38 hrupp Can you tell me when thats done ?
11:38 batman i will probably forget
11:38 batman can't you ask sri..?
11:39 batman not sure if he wants a pull request or if he thought it was a bad idea...
11:39 hrupp ah you need an event by mojo...
11:40 hrupp I thought you need it to implement in your code
11:43 hrupp sri: do you remember about batmans Mojo::Server::TCP question to add an event to mojo ?
11:43 hrupp and what was your meaning about it ?
11:50 amirite joined #mojo
11:54 batman i think the event should be added here: https://metacpan.org/source/SRI/Mojolicious-4.66/lib/Mojo/Server/Daemon.pm#L180
12:38 dsteinbrunner joined #mojo
13:15 fridudad joined #mojo
13:17 hrupp joined #mojo
13:33 KindTwo joined #mojo
13:54 asarch joined #mojo
14:09 zivester joined #mojo
14:29 D4RK-PH0ENiX joined #mojo
14:29 mire__ joined #mojo
14:35 ka2u joined #mojo
14:35 dvinciguerra joined #mojo
14:36 denisboyun joined #mojo
14:47 d4rkie joined #mojo
14:47 bluescreen joined #mojo
14:49 sh4 joined #mojo
15:17 azerus joined #mojo
15:26 sri hrupp: no, and i don't see a good reason to add it
15:28 rem_lex joined #mojo
15:29 jack joined #mojo
15:30 * sri wonders if the latest pull request should be rejected out of principle for having no description
15:31 chansen sri: be nice =)
15:33 sri https://github.com/kraih/mojo/pull/578
15:34 sri it's not about being nice, i simply don't want to encourage bad patches
15:36 amirite joined #mojo
15:40 chansen Isn't the title descriptive enough in this case?
15:47 gryphon joined #mojo
15:48 zackiv31 joined #mojo
15:52 good_news_everyone joined #mojo
15:52 good_news_everyone [mojo] kraih pushed 2 new commits to master: http://git.io/qdo_MA
15:52 good_news_everyone mojo/master e8cdcb0 Chris Seymour: Syntax highlight the Perl for readability.
15:52 good_news_everyone mojo/master 5881f9c Sebastian Riedel: Merge pull request #578 from iiSeymour/patch-1...
15:52 good_news_everyone left #mojo
16:10 marty joined #mojo
16:10 marty joined #mojo
16:22 nornagest joined #mojo
16:27 suy Sorry if I miss something obvious, but I'm failing to run post_json_ok from this example:  http://mojolicio.us/perldoc/Test/Mojo#post_ok   I can't find it in the source either.
16:47 good_news_everyone joined #mojo
16:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/uYWhag
16:47 good_news_everyone mojo/master af380c0 Sebastian Riedel: fixed old post_json_ok example
16:47 good_news_everyone left #mojo
16:51 suy sri: thank you again :)
17:05 mire__ joined #mojo
17:16 amirite_ joined #mojo
17:37 Dandre left #mojo
17:37 Dandre joined #mojo
17:43 dod joined #mojo
17:48 beyondcreed joined #mojo
18:24 hummeleBop joined #mojo
19:10 amirite joined #mojo
19:35 dpetrov_ joined #mojo
19:36 azerus hey I'm having some trouble finding something in the docs. I am sending a request using $.getJSON() from jQuery with the data parameter as "hello", but I'm unaware how to utilize that parameter in my routes...
19:37 azerus where does the data go
19:39 Adurah The server.
19:39 purl rumour has it the server is confused.  What is the client sending to it?  Is it legal
19:39 azerus -.-
19:40 azerus I get the request, I'm just unaware how to access the data that was sent
19:41 azerus im new to perl / mojo
19:41 Adurah Isn't it $self->param in the controller?
19:41 azerus I know I can do $self->param() but how do i get the data without a specific parameter name
19:42 Adurah I'd assume that with no argument it'd just give you all of it.
19:42 azerus okay
19:42 Adurah Might requre a list context, though.
19:48 azerus i just get back null
19:48 azerus when i use param()
19:49 Adurah Then uh... something like $self->tx->res->data, feel free to dumper the part before data.
19:50 Adurah Or, req instead of res.
19:50 azerus Undefined subroutine &Mojo::Message::Request::data call
19:51 Adurah Then, I guess the docs would know better.
19:51 azerus yeah i cant find it
19:51 Adurah Did you try req?
19:51 azerus yeah...
19:52 Adurah dumper on.
19:55 azerus eh
19:57 Adurah http://mojolicio.us/perldoc/Mojo/Message Nothing there helps?
19:57 Adurah http://mojolicio.us/perldoc/Mojo/Message/Request Rather, that.
19:58 azerus nope
19:59 azerus I guess its possible $.getJSON() data parameter is not really sending the data?
19:59 azerus http://api.jquery.com/jQuery.getJSON/
19:59 Adurah Web dev tools in FF/Chrome should help.
19:59 Adurah I use Tamper Data in FF.
20:00 azerus yeah its just sending ?hello
20:01 azerus so not like ?varName=varVal
20:01 azerus just ?varVal
20:01 azerus is that just improper syntax to be avoided?
20:01 azerus or can i send data that way
20:01 azerus if so, what is the appropriate way to handle it in Mojolicious
20:02 Adurah It's unusual, but should be doable. I'd just dumper crap from here.
20:02 azerus i dont know what dumper is
20:03 Adurah Data::Dumper.
20:03 purl somebody said data::dumper was written entirely in Perl, so it ought to work anywhere that Perl does! :-) or a good alternative to Storable. or or YAML for when you don't want my eyeballs poked with lots of {[ ]},s or use Data::Dumper;die Data::Dumper->new([$x])->Indent(1)->Terse(1)->Sortkeys(1)->Dump;
20:03 Adurah Though, Mojo makes use of it as a method called dumper.
20:03 Adurah Not sure what objects, though.
20:04 azerus if i set a varName in the request it works fine
20:05 azerus so $.getJSON("/ajax", "test=have fun", function(json) { .....
20:05 Adurah Yeah, sounds about right.
20:05 azerus ill just do that to avoid having to debug and figure it out ^^;;
20:06 Adurah Do what's expected instead of doing what you want? As you see fit. :P
20:06 azerus Day 3 for me, just testing the limitations :-p
20:07 azerus 4 days ago i never even touched perl
20:07 azerus 2 days ago no Mojolicious
20:08 Adurah What prompted you to look at perl?
20:08 azerus I'm in the process of conceptualizing a program, getting a feel for the framework and language and ill probably end up rewriting everything once every piece of the puzzle is clear to me
20:08 azerus well, the vmware vSphere API is in perl :-p
20:09 azerus the compiled binaries they've provided B L O W for CLI
20:09 azerus so I'm creating a web interface to control the environments
20:10 Adurah Fun.
20:10 azerus yeah, i'm having a good time with it :D
20:10 azerus i like the framework so far
20:11 Adurah It's quite nice, gets things done.
20:12 azerus was gonna use cgi
20:15 sri batman: btw. i don't appreciate you pushing that kinda stuff on me, to my knowledge you've not even made a real proposal yet
20:18 good_news_everyone joined #mojo
20:18 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/6E2ABA
20:18 good_news_everyone mojo/master 140a273 Sebastian Riedel: smaller methods
20:18 good_news_everyone left #mojo
20:30 good_news_everyone joined #mojo
20:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/wzUJww
20:30 good_news_everyone mojo/master 3fa2963 Sebastian Riedel: fixed memory leak again
20:30 good_news_everyone left #mojo
20:35 azerus is there a reason my data is not being displayed in the same order i send it using $self->render(json => ...
20:37 azerus also, can I change the default Server in the response Header?
20:39 tianon because the JSON spec doesn't specify that order must be preserved - it just happens that a large number of implementations do preserve order; add to that the fact that Perl hashes are intentionally non-deterministically ordered and you've got the general idea
20:39 azerus thank you
20:40 azerus function over fashion in other words
20:40 azerus speed
20:40 tianon definitely, especially since the spec doesn't require otherwise :)
20:42 dvinciguerra joined #mojo
20:42 Adurah In Perl 5.18+'s case, it's security.
20:44 dpetrov_ joined #mojo
20:48 meshl joined #mojo
20:50 basiliscos joined #mojo
21:01 voegelas joined #mojo
21:03 denisboyun joined #mojo
21:06 stokachu what should i use if i create a post with ua->post and the response body are parameters? is there a utility function within mojo that'll parse just the parameters returned? no host or scheme are provided
21:07 stokachu i tried with res->body_params but it isn't showing anything
21:08 stokachu this is the code i have so far https://dpaste.de/huTz
21:08 stokachu the body response is oauth_token=342342&oauth_token_secret=432432423
21:11 amirite joined #mojo
21:16 stokachu ah i see i can create a Mojo::Parameters->new(oauth_token=32432&oauth_token_secret=43423)
21:18 batman sri: sorry, i did not mean to push it on to you. i just couldn't remember what you said the last time :/
21:19 batman sri: it's actually not a big deal for me. would be really cool to do, but not my primary concern these days.
21:20 * batman back to watching movie...
21:22 sri looks like nobody really cares about an accept event then
21:24 sri hrupp: so the answer is it will never be done
21:25 icenine joined #mojo
21:25 Adurah Unacceptable.
21:25 * sri puts Adurah on ignore
21:25 Adurah Such manners.
21:27 batman sri: would you consider a patch if i start messing around with it again? do you need a benchmark as well, or just a patch if so..?
21:27 Adurah He's not in a mood to ask such questions, It seems.
21:27 batman s/patch/pr/
21:28 sri batman: no i won't, you have to go through a core dev vote
21:28 batman sri: that's fine. thanks.
21:28 * batman will do his best to remember the answer
21:30 batman Adurah: as long as you make sure to run the tests before upgrading, my module works though.
21:30 batman it's just that the module is not playing by the rules
21:31 batman Adurah: if you really think it should happen, then prod other core devs as sri said.
21:31 batman same to hrupp ^
21:31 dpetrov_ left #mojo
21:31 sri Adurah doesn't care, he trolls
21:31 Adurah I care about certain things, but sri is right in this situatino.
21:31 batman https://github.com/jhthorsen/mojo-server-tcp # oh crap. no tests :P
21:31 Adurah *situation
21:32 batman :)
21:32 batman marcus: i really like /me in convos now actually
21:32 sri i'm not in a bad mood btw., just expected a little more
21:32 batman was a bit confusing in the beginning but ✧ is growing on me :)
21:33 Adurah /me is a CTCP, methinks.
21:33 batman sri++ # expecting more
21:38 dwierenga joined #mojo
21:56 dvinciguerra joined #mojo
22:01 dsteinbrunner so I have noticed the on the dev exception template the text that says tap for more does not toggle
22:01 dsteinbrunner changing to tap for less
22:01 dsteinbrunner I started whipping up some code for this
22:02 dsteinbrunner but I have a couple of questions, first I only ever see two areas that have this but the template has three
22:04 sri i pasted a oneliner recently that results in all three
22:04 dsteinbrunner and currently the js code for the page is minimal and I'm not sure of the best way to add the code… inline function, external js file, skip the function and just have redundant  code for each
22:04 sri not sure i would like "tap for less"
22:05 dsteinbrunner well I'm expecting more when I tap it
22:05 dsteinbrunner and I get less
22:05 dsteinbrunner and I'm confused
22:06 dsteinbrunner well… it happened once
22:06 dsteinbrunner now it just seems like something that needs fixing
22:06 sri i think of it more as a skeumorphic handle thingy you move around
22:08 sri just saying, my vote would prolly be -1, no idea what the others think
22:11 sri pretty sure i'm not the only one seeing it that way though, it's been like that for 3 years and you're the first to say anything at all about it
22:12 dsteinbrunner well I have a way with nitpicking details
22:12 dsteinbrunner which has its pros and cons
22:13 sri oh, you don't seem to know me at all :)
22:13 dsteinbrunner oh… I can tell you have it in you also
22:15 sri batman: i would have expected at least some kind of explanation, since exposing an accept event seems completely pointless now that we expose Mojo::Daemon::acceptors
22:16 sri my $daemon = Mojo::Daemon->new(listen => [], acceptors => [Mojo::IOLoop->server(...)]);
22:16 dsteinbrunner batman: tap for less FTW, right?
22:16 dsteinbrunner come to my rescue
22:16 dsteinbrunner ;-P
22:17 Adurah Why are you debugging on a touchscreen anyway?
22:17 dsteinbrunner ha
22:17 sri dsteinbrunner: you've not considered the inconsistency with the third "tap for more"</nitpick>
22:18 dsteinbrunner I looked for the showcase example and I'm not seeing it
22:19 sri first of all, i hope you're using github master
22:20 sri since the templates changed completely
22:20 sri http://irclog.perlgeek.de/mojo/2014-01-08#i_8089702
22:21 dsteinbrunner I'm working with the latest release
22:21 dsteinbrunner I'll get master
22:21 meshl what is the easiest way to "inject" a scalar in the stash for all requests?
22:23 meshl rephrased: is there such a way?
22:23 Adurah Yes.
22:25 amirite joined #mojo
22:25 meshl using the under sub, right?
22:26 Adurah I don't know what under has to specifically do with it...
22:26 Adurah I'd just edit the stash.
22:26 bowtie_ joined #mojo
22:27 meshl where?
22:27 Adurah Your own controller makes sense.
22:28 Adurah But... you're thinking in terms of a lite app, and I'm not.
22:28 meshl the under sub seems to be a perfect location (at least in a Lite app)
22:28 meshl yes
22:28 Adurah Probably.
22:30 sri http://mojolicio.us/perldoc/Mojolicious/Controller#stash
22:31 meshl appreciate your help sri, danke
22:49 trone joined #mojo
23:03 good_news_everyone joined #mojo
23:03 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/k9Qd2Q
23:03 good_news_everyone mojo/master 6dae38a Sebastian Riedel: get rid of duplicated code
23:03 good_news_everyone left #mojo
23:22 dvinciguerra_ joined #mojo
23:29 dsteinbrunner joined #mojo
23:54 marty joined #mojo

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