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

IRC log for #mojo, 2014-09-02

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

All times shown according to UTC.

Time Nick Message
00:13 d4rkie joined #mojo
00:18 good_news_everyon joined #mojo
00:18 good_news_everyon [mojo] kraih tagged v5.36 at 3403673: http://git.io/mOajHA
00:18 good_news_everyon left #mojo
00:21 cpan_mojo Mojolicious 5.36 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-5.36
00:21 good_news_everyon joined #mojo
00:21 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/CEVP5A
00:21 good_news_everyon mojo/master db74ebc Sebastian Riedel: bump version
00:21 good_news_everyon mojo/master 3cd4f55 Sebastian Riedel: fixed typo in test
00:21 good_news_everyon left #mojo
00:26 davido___ joined #mojo
00:30 d4rkie joined #mojo
00:31 bobkare joined #mojo
01:05 laouji joined #mojo
01:24 klapperl_ joined #mojo
01:29 briandfoy joined #mojo
01:43 cpan_mojo Mango 1.09 by Sebastian Riedel - http://metacpan.org/release/SRI/Mango-1.09 (depends on Mojolicious)
02:06 noganex_ joined #mojo
02:18 woz joined #mojo
02:24 laouji joined #mojo
02:33 dj_goku joined #mojo
02:58 Eke- joined #mojo
02:58 pete I have an 'assets/' directory I'd like morbo to be serving. Where in the docs should I look for guidance? Mojolicious::Static doesn't look like the right solution, or I've misunderstood. There are hints that if I name 'assets' to something else, I get static file serving for free
02:58 pete I'm finding it surprisingly difficult to Google for this
02:59 laouji joined #mojo
02:59 preaction pete: Mojolicious::Static is indeed what you want
03:00 preaction moving it into "public/" is the best option though, since that's already in the list of static directories
03:02 pete OK, great, that Just Worked
03:03 pete What takes precedence? Routes or static files?
03:04 r0b3rt joined #mojo
03:06 preaction i want to say routes
03:06 tardisx joined #mojo
03:07 tardisx joined #mojo
03:10 tardisx joined #mojo
03:15 laouji joined #mojo
03:16 tardisx joined #mojo
03:17 jberger I'm pretty sure it's static files
03:19 jberger http://mojolicio.us/perldoc/Mojolicious/Lite#Static-files
03:19 pete Hrm, calling a controller UI is interesting
03:19 jberger "[static files] have a higher precedence than routes for GET and HEAD requests."
03:19 woz joined #mojo
03:19 pete I can't then use 'ui#thing', because it wants to find Ui
03:20 pete And then when looking for templates, if I cahnge that explicitly, it wants u_i/
03:20 jberger that is interesting
03:20 pete Can I easily change the namespace or whatever it is for the controller itself?
03:21 jberger try ->to(controller => 'UI', action => 'thing')
03:21 pete something like ... __PACKAGE__->moniker('ui')?
03:22 pete jberger: So that's equivalent to 'UI#thing'
03:22 jberger yeah, I don't remember when the name canonicalizing happens tho
03:22 pete Thus: Template "u_i/statistics.html.ep" not found
03:22 pete I can like with putting these in u_i
03:22 pete s/like/ive/
03:23 jberger irksome tho
03:23 tardisx joined #mojo
03:24 pete Each piece of magic is making me a little uncomfortable from a "how would I hack this" perspective ;-)
03:25 pete What I'm building isn't public-facing though, so meh
03:26 jberger https://github.com/briandfoy/pimp/tree/plum
03:26 jberger Argh
03:26 jberger wrong room
03:26 pete also that's a 404
03:26 jberger ok well then no worries
03:26 jberger :-)
03:27 jberger pete: the camelizing and decamelizing isn't magic
03:28 pete No, sure
03:28 jberger http://mojolicio.us/perldoc/Mojo/Util#decamelize
03:28 jberger it just is a little unfortunate for abbreviations
03:30 pete Feels weird to be on IRC with people from a whole new timezone
03:31 firnsy_ pete are you from the future?
03:31 pete I am
03:31 jberger pete: are you skynet?
03:31 pete actually, yeah, unless you're in Australia, I am from Tuesday morning
03:32 firnsy_ yay another aussie \o/
03:32 pete no no
03:32 firnsy_ lame
03:32 pete None of that Southern Hemisphere bullshit
03:32 jberger we seem to have a fair number of Aussies here
03:33 jberger o/ from Chicago
03:33 * pete is in BAngkok
03:33 jberger well that's about half a world away then!
03:36 pete Do I need to explicitly wire in my controllers?
03:36 pete Or are they meant to be auto-discovered by file search?
03:36 jberger meaning, how do you define your routes?
03:37 pete Well I know I can use ->route(blah to explicitly declare them
03:37 pete I'm just wondering if I need to, or if they're meant to be magically appearing against likely URLs
03:38 marty joined #mojo
03:38 jberger no, you have to wire them up
03:38 pete OK
03:39 jberger there have been some auto discover hacks published from time to time, but just do it the "Right Way" TM
03:39 pete I would prefer to be explicit
03:41 * pete remembers he has a team who he can lean on to codereview his work
03:43 sujithm joined #mojo
03:59 woz joined #mojo
04:24 irq joined #mojo
04:27 r0b3rt left #mojo
05:00 woz joined #mojo
05:20 laouji joined #mojo
05:37 dp_ joined #mojo
05:50 Eke- joined #mojo
05:54 mr-foobar joined #mojo
05:56 sujithm joined #mojo
06:02 woz joined #mojo
06:27 basiliscos joined #mojo
06:31 jamesaxl joined #mojo
06:41 meshl joined #mojo
06:42 KCL joined #mojo
06:42 fhelmber_ joined #mojo
06:47 basiliscos joined #mojo
06:52 rawler joined #mojo
07:04 woz joined #mojo
07:06 Vandal joined #mojo
07:06 batman jberger: i commented here: https://github.com/jberger/Mojolicious-Command-nopaste/commit/1efbdaf109466b84d559fdfa62814e3fcae41da9
07:07 batman anyone got input on the welcome screen after adding a new connection for convos? https://cloud.githubusercontent.com/assets/45729/4114657/fdf96b50-326b-11e4-87a8-2d6bab8f3563.png
07:09 batman sri, jberger, marcus? ^
07:21 trone joined #mojo
07:41 sujithm joined #mojo
07:44 woz joined #mojo
08:12 dod joined #mojo
08:18 bodgix_wrk joined #mojo
08:21 d4rkie_ joined #mojo
08:33 edestler joined #mojo
09:29 Averna1 joined #mojo
09:57 Averna joined #mojo
10:17 sujithm joined #mojo
10:19 Dandre joined #mojo
10:51 trone joined #mojo
11:04 neilhwatson joined #mojo
11:16 Kripton joined #mojo
11:22 rawler joined #mojo
11:32 Akron joined #mojo
11:32 meshl joined #mojo
11:32 Kripton_ joined #mojo
11:41 d4rkie joined #mojo
11:42 Kripton joined #mojo
11:59 jberger batman: a few of your comments were fixed by the time i shipped
11:59 jberger But when to connect is an interesting one
12:01 jberger Also, i don't think that Mojo::IRC necessarily needs to understand irc url with channel
12:01 jberger Because it doesn't have any auto join
12:06 jberger Unless you would add a join-on-connect
12:07 lipizzan joined #mojo
12:11 good_news_everyon joined #mojo
12:11 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/wcOH0Q
12:11 good_news_everyon mojo/master fc69d66 jamadam: fixed typo in comment
12:11 good_news_everyon mojo/master f5598d4 Sebastian Riedel: Merge pull request #670 from jamadam/master...
12:11 good_news_everyon left #mojo
12:12 Dandre joined #mojo
12:15 batman jberger: that's true... i won't add auto join.
12:15 batman or at least i don't want to :)
12:15 trone joined #mojo
12:25 rawler joined #mojo
12:28 howitdo joined #mojo
12:57 laouji joined #mojo
13:30 * batman wonder if there's something we could use the extra space in convos for...
13:30 batman between the text and the sidebar
13:31 batman i'm considering using it for media
13:32 batman not very important right now. just got distracted for a second :)
13:34 batman s/media/linkembedder/
13:58 preaction joined #mojo
14:35 zivester joined #mojo
15:10 zakovyrya joined #mojo
15:13 zakovyrya Hello everyone. I’m writing web-service using Mojo and was wandering if it’s possible to install a handler for 404 Not Found.
15:13 zakovyrya Documentation mentions get ‘/missing’ route, but I don’t think it’s working as expected - I still get the default “not found” development page.
15:17 genio zakovyrya: http://mojolicio.us/perldoc/Mojolicious/Controller#render_not_found
15:18 zakovyrya genio: Thanks, but I meant a handler which will kick-in in case of unknown route
15:19 zakovyrya genio: I would like to return a json response with some dynamically generated message
15:23 zakovyrya I guess I can just use “after_dispatch” hook
15:24 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Catch-all-route
15:25 zakovyrya sri: Cool, that’s what I need. Thanks.
15:33 genio I thought you were looking for a custom    not_found.json.ep   template or something
15:33 zakovyrya genio: Nope, I did not. Thanks for the effort though.
15:40 fhelmber_ joined #mojo
15:43 davido_ joined #mojo
15:44 tempire I'm on the fence about submitting a grant
15:45 tempire er, proposal for a grant
15:45 genio Money's always nice, but do you have the time to devote to the project for the grant?
15:45 tempire I have the time. But I don't want to commit to doing something specific with the content.
15:47 mr-foobar joined #mojo
15:51 fhelmber_ joined #mojo
15:56 disputin joined #mojo
16:00 disputin joined #mojo
16:03 disputin joined #mojo
16:05 batman tempire: do what you do best: make awesomeness.
16:05 batman I would give money to that :)
16:05 batman Kickstarter instead of grant..?
16:06 batman "Async awesomeness and everything in between"
16:06 good_news_everyon joined #mojo
16:06 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/kf33tQ
16:06 good_news_everyon mojo/master d36f69a Sebastian Riedel: templates are tokenized into blocks, not actual lines
16:06 good_news_everyon left #mojo
16:06 marty joined #mojo
16:08 sri tempire: i guess a grant only works if you want the result to be somewhat open, that has not stopped some very successful books in the past though
16:09 sri this one comes to mind http://linuxcommand.org/tlcl.php
16:09 sri or this one http://www.tcpipguide.com/buybook.htm
16:15 sri of course no starch press is awesome
16:16 fhelmber_ joined #mojo
16:46 dod joined #mojo
17:00 abhishekisnot joined #mojo
17:03 good_news_everyon joined #mojo
17:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/86FoIw
17:03 good_news_everyon mojo/master c046fd2 Sebastian Riedel: simplify multiline handling
17:03 good_news_everyon left #mojo
17:04 sri the AST structure is really not very elegant... but the special cases make cleaning it up a bit tricky
17:06 davido__ joined #mojo
17:31 Eke- joined #mojo
17:37 sri it's funny seeing new specs use Link headers http://tools.ietf.org/html/draft-prudhommeaux-http-status-2nn-00
17:44 * phillipadsmith prepares to be abused...
17:44 phillipadsmith So, I'm most likely doing something really stupid with Mojo::Template and/or Mojo::Loader here: https://gist.github.com/phillipadsmith/eec54c485d084b6c1655#file-gistfile1-pl-L63
17:45 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.03001 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.03001
17:46 marcus sri: tcpip-guide has the best design ever ;)
17:47 phillipadsmith the error I'm getting is "Subroutine parse_list redefined at template line 2, <DATA> line 119" … so I'm guessing that's not the right place to put that kind of parsing logic.
17:51 disputin joined #mojo
18:12 disputin joined #mojo
18:15 batman phillipadsmith: make it an anon sub: my $parse_list = sub { ... }; $parse_list->(...);
18:15 batman or pass it on as an argument to $mt->render()
18:18 phillipadsmith batman: I was wondering about the anon sub approach; thanks for that -- I'll give it a try
18:18 batman go crazy :)
18:18 phillipadsmith batman: although, passing it as a argument to Mojo::Template sounds like it would look cleaner
18:18 phillipadsmith i.e., get the sub out of the __DATA__ block
18:19 batman yeah, you should move as much logic as possible out of the template... (imho)
18:19 phillipadsmith batman: so, I would just pass a reference to the sub into ->render() ?
18:19 batman helpers for the win ($parse_list would be some sort of a helper)
18:19 * phillipadsmith goes to read the docs again
18:19 phillipadsmith Many thanks, batman. Appreciate the pointers. :)
18:20 batman i would guess % my ($row, $parse_list) = @_;
18:20 batman $mt->render($template, $row, \&parse_list);
18:21 batman that way, you can actually declare sub parse_list {...} in your perl code
18:21 * phillipadsmith tries that
18:24 phillipadsmith batman++
18:25 disputin joined #mojo
18:28 berov joined #mojo
18:42 KCL_ joined #mojo
18:42 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.03002 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.03002
18:53 disputin joined #mojo
19:10 briandfoy I'm wondering if there's already a Mojo pattern for what I'm thinking about. Joel got me started on a very basic example last night with ::Command
19:10 briandfoy I have a sequence of events that build on each other: resolve fetch build install
19:10 briandfoy I'm making a Mojo app to handle that
19:11 briandfoy each succeeding step implies all of the previous ones
19:11 briandfoy so, if I do ./my_mojo_app build, it also does the resolve and fetch
19:12 briandfoy is there a pattern where something like MyMojoApp::Command::install can call all of the previous commands.
19:12 briandfoy and share the common data?
19:12 briandfoy something clever. I know I can brute force it. :)
19:16 jamesaxl joined #mojo
19:17 sri briandfoy: i've not seen something like that yet
19:18 sri marcus: it's from 2005 ;p
19:18 sri still and awesome book though
19:18 marcus sri: looks like 1998 :)
19:19 marcus But tcp/ip is even older =]
19:21 sri you know, i just wanted to look up the maypole page from that time... but it actually wasn't that shitty
19:21 sri https://web.archive.org/web/20040925000248/http://maypole.perl.org/
19:23 marcus Running Instiki?
19:23 marcus No Kwiki
19:23 cpan_mojo Mojolicious-Plugin-AttributeMaker 0.03003 by HAMMER - http://metacpan.org/release/HAMMER/Mojolicious-Plugin-AttributeMaker-0.03003
19:24 marcus I like how maypole's main selling point is Class::DBI::Loader
19:38 basiliscos joined #mojo
19:42 sri briandfoy: i guess it's doesn't have to be too bruteforce-ish... $self->app->commands->run(foo_command => @args)
19:44 rwf Is their an elegant to handle a large Mojo::IOLoop::Stream which requires multiple "read" events?  Just have to manually manage some begin/end markers with the stream content?
19:45 disputin joined #mojo
19:45 sri mojo eval -v 'app->commands->run("eval", "-v", "app->moniker"); app->moniker'
19:45 sri :)
19:46 rwf s/their/there/
19:54 disputin joined #mojo
19:55 chansen joined #mojo
20:15 woz joined #mojo
20:17 Kripton_ joined #mojo
20:17 zbodi joined #mojo
20:18 risugg joined #mojo
20:22 jamesaxl joined #mojo
20:29 sri briandfoy: oh, since the app instance is the same the whole time you should be able to share data through it ;)
20:30 sri $self->app->config->{command_stuff} = {...}; $self->app->commands->run(some_other_command => @args);
20:35 disputin joined #mojo
20:45 woz joined #mojo
21:25 woz joined #mojo
21:30 neilhwatson joined #mojo
21:30 * jzawodn now a big fan of Mojo::IOLoop and friends after re-writing a query system to add concurrency
21:36 zbodi left #mojo
22:06 sri \o/
22:08 jzawodn wrapping my head around ::Delay was quite helpful
22:23 good_news_everyon joined #mojo
22:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vPySqg
22:23 good_news_everyon mojo/master faf74b4 Sebastian Riedel: optimize a few more variations of successive text lines
22:23 good_news_everyon left #mojo
22:44 noganex joined #mojo
22:49 good_news_everyon joined #mojo
22:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ZrcSfg
22:49 good_news_everyon mojo/master 7510b27 Sebastian Riedel: skip the last token
22:49 good_news_everyon left #mojo
23:13 cpan_mojo Ado 0.61 by Krasimir Berov - http://metacpan.org/release/BEROV/Ado-0.61 (depends on Mojolicious::Plugin::DSC)
23:58 tardisx joined #mojo

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