Camelia, the Perl 6 bug

IRC log for #mojo, 2011-12-13

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

All times shown according to UTC.

Time Nick Message
00:07 vervain joined #mojo
00:15 ccushing joined #mojo
00:33 metaperl joined #mojo
00:45 rafl joined #mojo
00:46 tempire memowe: there is a distinction, but it's regional
00:53 ccushing I'm poking around the docs right now, is DBIC welll supported?
00:54 tempire you can use any orm with mojolicious
00:54 tempire it's orm-agnostic
00:54 tempire or orm-gnostic
00:55 tempire maybe ormtastic
00:55 ccushing well, with cat and  dancer there were adapters I suppose my question is more of... does the glue exist, or am I writing my own
00:56 tempire there is some glue
00:57 tempire some people use Mojolicious::Plugin::Database
00:59 tempire Although it's just a matter of preference, 'cause it's only one line of code.
01:03 ccushing so it doesn't have all the threadsafe and reconnect logic provided by the other adapters
01:27 tempire You could put DBIx::Connector in an attribute.  That would give you reconnect.
01:27 tempire Here's a wiki entry on the topic: https://github.com/kraih/mojo/wi​ki/Hypnotoad-prefork-web-server
01:28 sri threadsafe is a non-issue, nobody uses perl threads
01:31 j3nnn1 joined #mojo
01:38 preflex_ joined #mojo
01:39 ccushing hmm
01:44 tempire threads are web scale.
01:44 ccushing lulz
01:55 yaxar joined #mojo
02:09 noganex_ joined #mojo
02:34 xaka joined #mojo
02:55 jnap joined #mojo
03:11 mattastrophe joined #mojo
03:13 yaxar joined #mojo
03:34 Psyche^ joined #mojo
03:35 elb0w joined #mojo
03:35 elb0w Sometimes I hate how well made Mojo is
03:35 yaxar joined #mojo
03:35 elb0w I really wanted to learn python/ruby but theres no framework there I want to work with
03:39 Psyche^ joined #mojo
03:47 tempire You could learn python for statistics
03:47 tempire http://greenteapress.com/thinkstats/
03:57 tempire wow
03:57 tempire http://attasi.com/labs/ipad/
03:59 MojoGuest442 joined #mojo
03:59 MojoGuest442 From: http://www.google.com.hk/url?sa=t&rct=j&​amp;q=extjs++demo&source=web&cd=9&am​p;ved=0CGUQFjAI&url=http%3A%2F%2Fdev.xan​tus.org%2F&ei=OsnmTqTSN-aciAe8msznCA&amp​;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&​sig2=AuViHutVvmjJY2O5TLi23g&cad=rjt (1 hits)
04:05 plu sri: sorry that I forgot to update the github issue :(
04:43 yaxar_ joined #mojo
04:44 xaka joined #mojo
04:53 gshank joined #mojo
04:59 guest6131 joined #mojo
04:59 yaxar hi all
05:05 gshank joined #mojo
05:06 mire_ joined #mojo
05:34 koban joined #mojo
05:51 gshank joined #mojo
06:23 Alias joined #mojo
06:24 Vandal joined #mojo
07:12 sugar joined #mojo
07:39 batman joined #mojo
07:43 marcus goood morning
07:44 marcus plu: the github issue is resolved now, since sri rewrote without named captures
07:44 plu yea
07:44 plu I think I just fixed the bug in perl :)
07:45 plu https://gist.github.com/1471109
07:45 marcus sweet
07:45 plu still waiting to recompile blead without debug symbols to run the testsuite again to see if it breaks something
07:45 marcus rjbs says we can probably get it into next 5.14 release
07:45 plu cool :)
07:46 plu testsuite is running, I bet I broke EVERYTHING
07:59 berov joined #mojo
08:02 plu \o/
08:02 plu Failed 1 test out of 2172, 99.95% okay. porting/authors.t
08:26 abra_ joined #mojo
08:28 dm joined #mojo
08:36 spleenjack joined #mojo
08:38 elb0w joined #mojo
09:08 AmeliePoulain joined #mojo
09:24 d4rkie joined #mojo
09:25 memowe tempire: good to know, thanks!
09:26 memowe plu++ #regex
09:40 mire_ joined #mojo
10:10 preflex_ joined #mojo
10:15 kaare joined #mojo
10:21 metaperl joined #mojo
10:21 Vandal joined #mojo
10:22 d4rkie joined #mojo
10:46 d4rkie joined #mojo
11:05 marcus https://github.com/mateuszkmiecik/mojolicious-blog # mojolicious blog engine.
11:07 marcus this one looks like a great example
11:08 judofyr joined #mojo
11:13 plu :)
11:18 diegok Hi, how do I change the connect timeout?, I was using Loop->connect_timeout but it's deprecated now. The docs says "Note that the loop timeout can be changed dynamically at any time to adjust responsiveness." but fails to say how to do it :-(
11:30 sugar joined #mojo
11:34 marcus diegok: $self->ioloop->stream($self-​>tx->connection)->timeout() or so?
11:34 marcus diegok: mojolicio.us/perldoc/Mojolicious/Controller#write
11:36 diegok hm... let me see :)
11:36 marcus sri: https://metacpan.org/module/Mojo::IOLoop#recurring docs seems outdated?
11:39 diegok marcus: I was looking into stream->timeout. But docs only talk about setting a cb for the timeout event -> http://mojolicio.us/perldoc​/Mojo/IOLoop/Stream#timeout
11:40 marcus diegok: that is the stream event
11:40 marcus timeout even
11:41 diegok yes
11:41 marcus there's a timeout method as well below
11:41 marcus which sets the timeout
11:41 diegok yes, just saw the code. There is a timeout attribute.
11:41 marcus my $timeout = $stream->timeout;
11:41 marcus $stream     = $stream->timeout(45);
11:41 marcus Maximum amount of time in seconds stream can be inactive before getting closed automatically, defaults to 15. Note that this attribute is EXPERIMENTAL and might change without warning!
11:41 * marcus hides from the nopaste police
11:42 diegok we should document it next to that frase from IOLoop doc I've pasted I think.
11:42 diegok ^ point on this direction
11:43 diegok what do you think?
11:43 purl I think diegok should try flossing more often!
11:43 marcus diegok: yeah, I already added some docs to the 'stream' method
11:43 diegok :)
11:53 cosmincx joined #mojo
11:57 kd joined #mojo
11:57 kd ok mojolicious-block sucks
11:57 kd so I git clone it.  Waht next
11:57 kd what next?
11:57 purl next is the only platform the code refers to
11:57 kd perl Makefile.PL doesn't work
11:57 kd cpanm . doesn't work
11:58 kd come on, have some standards
11:58 vervain What is mojolicious-block?
11:58 kd -blog
11:58 kd sorry, misspelling
11:58 vervain cat README
11:58 purl i guess cat README is just a newline
11:58 kd -bash: morbo: command not found
11:59 plu that comes with Mojolicious
11:59 kd so how do I bootstrap it
11:59 kd that should be documented
11:59 plu cpanm Mojolicious
11:59 plu well, open a bug for mateuszkmiecik
11:59 vervain kd - should they document how to turn on your computer too?
11:59 plu :)
11:59 kd vervain: no, that would be stupid
12:00 vervain It's all relative my friend.
12:00 kd I refer you to a conversation I had in #catalyst about 5 years ago
12:00 kd we are currently repeating that conversation.
12:01 kd right now I can tell you I'm right, you need to treat me like a reasonable person, but an idiot
12:01 kd if something interesting comes to my attention, I should be able to explore that interest while applying a minimum of thought, otherwise you will lose me
12:01 vervain kd - I assure you that you did not have a conversation with me 5 years ago.
12:01 kd no not with you.  I think the conversation was with marty
12:02 kd no, marcus
12:02 marcus hi kd
12:02 kd hi marcus
12:02 plu kd: https://github.com/mateuszkmi​ecik/mojolicious-blog/pull/1
12:02 plu :)
12:02 marcus kd: it only depends on Mojolicious
12:02 kd so that's fine, where's the Makefile.PL
12:03 kd aside from that it looks lovely
12:03 crab why does it need a Makefile.PL?
12:03 vervain There isn't one... it doens't need one... it's not a module.
12:03 kd so that I can use the normal toolchain
12:03 marcus it would be nice if it had a cpanfile tho
12:03 crab to do what?
12:03 purl do, or do not. there is no try.
12:03 marcus crab: install Mojoliciou
12:03 kd to make a normal user use the normal toolchain
12:03 marcus +s
12:03 marcus or if it bundled mojolicious in inc.
12:04 marcus https://github.com/miyagawa/cpanfile
12:04 marcus I'm thinking of adding a mojolicious generate command for it
12:04 kd catalyst may be bloated and stuff, but there are some good ideas there
12:04 marcus kd: mojo has a mojo generate makefile
12:04 marcus to make a makefile.pl
12:05 marcus kd: but this is basically a single file mojolicious example, and it only depends on mojolicious
12:05 kd well if this nice script has drawn my attention it should make it trivial to draw my attention into that infrastructure as well
12:06 kd anywah I have to go to bed.  We can continue this conversation in the not too distand future if you like
12:06 marcus kd: welcome back at any time.
12:06 vervain kd: mojolicious-blog came out of a simple programming exercise taken on by a volunteer with (I believe) a three day time limit... it was for fun... but you come in here swinging a bat and criticizing.
12:06 marcus kd: fwiw, I made the other student add a makefile to his project.
12:06 marcus kd: but I was just so impressed by this example (made without any assistance), that I approved it anyways.
12:06 kd ok
12:07 memowe O HAI. I see you're already discussing about the Mojolicious blog thing. :)
12:07 marcus kd: https://github.com/yaxar/irclogbotperl (other example)
12:08 marcus I'm really impressed that a 17 year old with no contact to the community was able to put that together in a couple of days
12:08 kd yes that is good
12:08 marcus think it says a lot about the mojolicious learning curve
12:08 kd yep
12:08 * vervain applauds!
12:08 vervain ya!
12:08 kd you should have approved pending a Makefile.PL
12:08 memowe The author isn't here?
12:09 marcus memowe: don't think so
12:09 crab the author isn't here afaik
12:09 * kd directs critisism at marcus then rather than $author
12:09 judofyr I think I talked to hm yesterday
12:09 memowe I'll write an email. Maybe we could merge the best ideas and generate world domination with mojolicious blogs. :)
12:09 kd please ask him to put a makefile.pl in there then, then it will have my 100% approval
12:09 kd rather than a mere 98% now :)
12:10 kd ok, bed time &
12:10 crab what would the Makefile.PL actually do?
12:10 marcus crab: depend on Mojolicious, I guess
12:10 vervain G'Night
12:10 crab just declare that Mojolicious is a dependency?
12:10 marcus yea
12:10 kd allow the end user to cpanm .
12:11 crab ah.
12:11 kd and then update the readme:  # install cpanm \n cpan. . \n (existing line of Makefile)
12:11 kd ok so maybe I will clone and make a pull request
12:12 crab great.
12:12 vervain +!
12:12 vervain +1 ;_)
12:12 plu kd: he merged it already :) https://github.com/mateuszkmiecik/mojolicious-blog
12:14 marcus at least now there's a install instruction. And it is actually a command less than perl Makefile.PL ; cpanm --installdeps .
12:17 marcus I think the best part about this blog example is that thanks to <%= escaping by default, he didn't even create a XSS hole :)
12:17 plu :)
12:18 Andrei666 joined #mojo
12:23 MojoGuest146 joined #mojo
12:23 MojoGuest146 From: http://www.google.com.hk/url?sa=t&amp;rct=j&​amp;q=extjs++demo&amp;source=web&amp;cd=9&am​p;ved=0CGUQFjAI&amp;url=http%3A%2F%2Fdev.xan​tus.org%2F&amp;ei=OsnmTqTSN-aciAe8msznCA&amp​;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&amp;​sig2=AuViHutVvmjJY2O5TLi23g&amp;cad=rjt (2 hits)
12:23 MojoGuest449 joined #mojo
12:23 MojoGuest449 From: http://www.google.com.hk/url?sa=t&amp;rct=j&​amp;q=extjs++demo&amp;source=web&amp;cd=9&am​p;ved=0CGUQFjAI&amp;url=http%3A%2F%2Fdev.xan​tus.org%2F&amp;ei=OsnmTqTSN-aciAe8msznCA&amp​;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&amp;​sig2=AuViHutVvmjJY2O5TLi23g&amp;cad=rjt (3 hits)
12:49 vervain How can I use perldoc to get a list of pragmas e.g. like http://perldoc.perl.org/index-pragmas.html
12:55 marcus vervain:        See "Pragmatic Modules" in perlmodlib.
12:55 d4rkie joined #mojo
12:59 noganex joined #mojo
13:07 marcus memowe: I would like mojolicious blog world domination
13:07 marcus memowe: does that mean you're working on a blogging engine as well?
13:07 vervain Wicked... thanks marcus... you may have noticed the hornets nest I stirred up asking in #perl. ;-)
13:07 marcus I kinda liked the idea of using dropbox as a source for blog posts
13:08 marcus vervain: no
13:08 vervain It basically got philosophical... what is pragmata. ;-)
13:20 TheAthlete joined #mojo
13:22 crab marcus: i wrote something based on blosxom called loathsxome
13:23 crab marcus: and i use it, but recently i've been more and more annoyed that it isn't mojo-based, because it makes it more painful to work on when i want to change something.
13:23 marcus mm
13:23 crab so i've finally decided to rewrite it to use mojolicious (possibly -lite).
13:23 marcus I would actually like to make something hosted that can provide blogs for more than one person
13:23 marcus and still work on the filesystem
13:23 marcus which is why I liked the idea of the dropbox based thingie
13:24 marcus but not as much the implementation
13:24 marcus (http://calepin.co/)
13:24 crab whose idea is it to use dropbox?
13:24 crab ah
13:25 crab is it open source? (or do you mean it doesn't work well?)
13:31 marcus it's open source
13:31 marcus the underlying system
13:35 TheAthlete left #mojo
13:37 elb0w joined #mojo
13:48 foomator joined #mojo
14:01 jnap joined #mojo
14:01 stephan48 marcus: memowe worked/works on bootylite
14:07 crab hmm. i wouldn't mind writing something like that.
14:10 amoore joined #mojo
14:21 d4rkie joined #mojo
14:22 sugar joined #mojo
14:25 metaperl joined #mojo
14:28 metaperl|2 joined #mojo
15:01 Foxcool joined #mojo
15:04 arpadszasz joined #mojo
15:06 inokenty joined #mojo
15:12 koban left #mojo
15:32 TheAthlete joined #mojo
15:33 d4rkie joined #mojo
15:53 MojoGuest602 joined #mojo
15:53 MojoGuest602 From: http://blog.kraih.com/perl-is-ready-for-html5 (71 hits)
15:53 MojoGuest602 vv
15:56 TheAthlete left #mojo
15:57 MojoGuest602 hi
16:03 KayT3 joined #mojo
16:07 GitHub144 joined #mojo
16:07 GitHub144 [mojo] kraih pushed 1 new commit to master: http://git.io/e5fCLQ
16:07 GitHub144 [mojo/master] fixed recurring example - Sebastian Riedel
16:07 GitHub144 left #mojo
16:08 sri marcus: that blog example is great
16:09 sri diegok: Mojo::UserAgent->connect_timeout
16:09 sri the connect timeout itself is now an argument to Mojo::IOLoop->client
16:11 Andrei666 joined #mojo
16:12 Andrei666 hello, can i use TIHASH to tie a controller to $self->{stash} and change the behavior of the stash?
16:12 Andrei666 *tiehash
16:13 sri why?
16:14 Andrei666 i send from 2 different controller variables with the same name like $self->{stash} = { foo => 'bar' } ;
16:14 crab you are probably doing something horribly wrong.
16:14 Andrei666 and in the second controller something like $self->{stash} = { foo => 'second controller' }
16:14 MojoGuest621 joined #mojo
16:14 MojoGuest621 From: http://www.google.co.jp/url?sa=t&amp;rct=j&amp​;q=mojolicious%20websocket&amp;source=web&amp;​cd=20&amp;ved=0CGMQFjAJOAo&amp;url=http%3A%2F%​2Fdev.xantus.org%2F&amp;ei=zHnnTr7jFZDUmAWqvLm​fCg&amp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
16:14 * sri agrees with crab
16:15 Andrei666 and i get the same text in both of those controllers
16:15 Andrei666 instead of having different texts
16:15 crab first, you should not do $self->{stash} = {} and wipe out everything in the stash.
16:15 crab but maybe that was just on irc and not in your code?
16:15 Andrei666 ahm
16:15 Andrei666 it's in the code..
16:16 crab don't do that.
16:16 Andrei666 crab: do you have an alternative to that?
16:16 crab mojo sets internal variables in the stash to determine how to process requests. zap the stash, and you break everything.
16:17 crab an alternative to breaking the stash? well... don't break it.
16:18 crab what are you actually trying to do?
16:18 crab what are your two controllers, specifically?
16:20 Andrei666 i have a page, that contains several tabs, and each tabs is a controller, with an actions, and in those actions i will have same name for variables but with different values, and I need to keep the stash for each individual controller but also for the page that renders the cotnrollers
16:20 Andrei666 like a big stash..
16:21 Andrei666 and unfortunately the variable value...overwrites each other variable with the same name
16:25 inokenty (please give me back 'before_render' hook for "making adjustments to the stash right before rendering". It is really necessary thing. Or show me the way how to add some values to stash before rendering a template)
16:26 sri inokenty: give me a real use case that is not possible in any other way :)
16:27 sugar hmm... sub action {... return $self->render(key => value)}
16:27 inokenty Ok, I'll do this soon )
16:27 sri before_render has been around for months, and not a single person could do that
16:28 crab or actually did it, anyway.
16:28 sri chances are you just used it wrong, before_render is a global thing, i can't think of any non crazy use cases myself
16:28 crab Andrei: i don't understand what "each tabs is a controller" means.
16:28 crab Andrei: are you gluing the template output from multiple controllers together into a single HTML page?
16:29 Andrei666 yes
16:30 sugar Andrei666: use helpers, in them call needed controllers, and in template get data from those helpers
16:31 Andrei666 thanks, i'll try this idea and hopefully this will be the solution for my problem...
16:34 MojoGuest49 joined #mojo
16:34 MojoGuest49 From: http://blog.kraih.com/perl-is-ready-for-html5 (72 hits)
16:37 sri marcus: http://blog.macromates.com​/2011/textmate-2-0-alpha/ # \o/
16:38 Andrei666 sugar: have you tested this solution?
16:38 Andrei666 sugar: is it viable?
16:39 sri helpers should be your first choice when it comes to sharing code between controller
16:39 sri next to bridges
16:41 judofyr sri: what are your thoughts on helpers? I think they suck hard because they are all application-wide (even when you only use them in e.g. 2 controllers) and all stuck in one place
16:41 sri judofyr: what are the alternatives?
16:41 purl the alternatives are worse
16:41 judofyr sri: not sure :/
16:42 sri exactly
16:42 crab wow, a relevant answer from purl.
16:42 sri botsnack!
16:42 purl thanks sri :)
16:42 judofyr sri: one pattern I've used is to just create another class, and then add a helper: App::MyThing->new(controller => $self, @_)
16:42 marty moin
16:43 judofyr sri: so I do "my $foo = $self->my_thing(more => 'options');"
16:43 judofyr and $foo->something
16:43 sri judofyr: that's a hell of a lot of boilerplate
16:43 judofyr indeed
16:43 Andrei666 judofyr: it's exactly what i'm doing
16:43 Andrei666 and it's harder
16:43 judofyr but it's way better than adding 100 lines of code to App.pm
16:44 sri judofyr: make plugins
16:44 sri app specific pligins are fine too
16:44 judofyr sri: ehm, that is *more* boilerplate :)
16:45 sri not really
16:45 sri your class needs to be instantiated in every action
16:45 judofyr I need a ->plugin() too
16:45 crab i have real trouble understanding generic examples of things like this
16:45 Andrei666 sri: very true, that's what i'm doing now..and it annoyng
16:45 judofyr and? I consider that a good thing. I can split my class into several other methods.
16:46 crab judofyr: so if you're happy with it, keep doing it. what's the problem?
16:46 sri judofyr: if you like to do that, then feel free to ignore helpers
16:46 sri crab: :)
16:46 judofyr crab: just asking around if there's a better approach ;)
16:47 judofyr but so far I like mine best :)
16:47 sri we've had discussions about the helper design for months here, it slowly evolved into what we have today
16:47 judofyr yeah, I think it's probably the most pragmatic solution
16:48 judofyr because you can build lots of other stuff on top if it
16:48 judofyr sri: I *very* much like that you don't have "one helper class per controller" as in Rails
16:48 judofyr )at least not when Rails allows you to access helpers in *other* helper-classes by default :S )
16:49 judofyr (*
16:51 sri crab: you still need to commit something to core btw. ;p
16:52 xaka joined #mojo
16:52 sugar Andrei666: yes, in our projects we use helpers widely
16:59 Maximdd123 joined #mojo
17:02 Maximdd123 left #mojo
17:05 Andrei666 could somebody point to a documentation for implementing custom helpers
17:06 inokenty You can read a DefaultHelpers.pm
17:06 xaka Andrei666: http://mojolicio.us/perldoc/Mojolici​ous/Guides/Rendering#Adding_helpers
17:09 Andrei666 inokenty: yes I'm reading that
17:10 Andrei666 xaka: thanks, the problem is that i'm using a non lite mojo app
17:10 Andrei666 and i don't know where should i declare helpers...in such a way that they'll be available for the whole app
17:11 xaka Andrei666: the difference are little. you have "start" subroutine in your app. at the call time just do "$self->helper(name => code)" and you've done
17:12 xaka Andrei666: $self->helper(debug => sub { my $message = shift; warn "DEBUG: $message" })
17:30 Andrei666 i have a helper that calls different controllers,
17:31 Andrei666 how do i call the helper from the template?
17:34 sri Andrei666: you don't, that's the point
17:34 sri you might also want to take a look at bridges for shared logic
17:34 sri controllers call helpers, bridges call controllers
17:37 Andrei666 sri: thanks, i'll have a look
17:41 metaperl joined #mojo
17:53 mateu left #mojo
18:25 elb0w left #mojo
18:25 memowe marcus: I think it wouldn't be a problem to use Dropbox with Bootylite. I thought about that, but never tried.
18:27 memowe marcus: would be great if you try and write about that in the Bootylite wiki. :)
18:27 sri bootylite looks quite good
18:27 sri memowe++
18:27 memowe yay. :)
18:27 memowe now: salsa time. happy night!
18:29 sri pizza time
18:30 batman joined #mojo
18:32 yaxar joined #mojo
18:33 xaka have you seen new twitter web ui? do you like that the profile panel is on the left side instead of right (or even hidden)?
18:37 jnap joined #mojo
18:57 metaperl|2 joined #mojo
19:00 metaperl joined #mojo
19:11 judofyr joined #mojo
19:12 batman joined #mojo
19:25 batman joined #mojo
19:31 tempire huh
19:31 tempire I've never bothered to look @ perldoc perlvar
19:31 tempire some nifty goodness in there
19:38 sri indeed
19:41 sri stuff like $^F is often overlooked, but it's what makes zero downtime restarts in hypnotoad possible
20:39 MojoGuest881 joined #mojo
20:48 cosimo joined #mojo
20:51 marcus https://github.com/ivanvpenchev/Mojoforum
21:09 xaka marcus: any ideas why he uses ", undef, 'DONE'" everywhere where "do" call happens? it doesn't work until you remove it
21:09 xaka btw, looks cool
21:10 marcus Xaka: no, had not tried it yet. I am on an ipad atm.
21:12 tempire I'm sold.  I don't know why I haven't been using twitter bootstrap for everything.
21:16 marcus Xaka: i opened a ticket to ask.
21:17 xaka marcus: why not in russian? ;)
21:26 sri tempire: https://github.com/popular/watched # just noticed it's now the most popular repo on github
21:26 gshank joined #mojo
21:27 tempire It's exactly what I've been looking for.  I remember seeing it a long time ago, it just didn't click.
21:27 tempire don't have to worry about front-end details ever again for boilerplate
21:38 * tempire sprinkles glitter on everyone
21:38 * marcus shines.
21:50 lammel2 joined #mojo
22:13 rem_lex|pivo joined #mojo
22:17 augensalat Hi!
22:17 augensalat perl -MMojo::Asset::File -E 'say Mojo::Asset::File->new(path => "Mojo.pm")->size'
22:17 augensalat 3134
22:18 augensalat perl -MIO::File -MMojo::Asset::File -E 'say Mojo::Asset::File->new(handle => IO::File->new("Mojo.pm"))->size'
22:18 augensalat 0
22:18 augensalat I assume, this is not the desired behaviour...?
22:23 sri augensalat: what would be the use case?
22:25 j3nnn1 joined #mojo
22:26 augensalat That's a bit hard to explain. But I found out, that Mojo::Asset::File can take a file handle and then noticed, that the response had a Content-Length of 0...
22:26 sri well, we only do stuff is there's a sensible use case
22:26 sri *if
22:29 augensalat Well ... I use it. ;) In my app the file is already opened to safely check if it is really readable. So I already have the file handle - no need to open the file again.
22:29 mattastrophe joined #mojo
22:30 sri that sounds all wrong
22:30 sri why would you open a file to check if you can read it?
22:32 augensalat Counter question: why is there a handle attribute in Mojo::Asset::File?
22:33 augensalat -f works on file handles too, so it is not hard to fix
22:33 augensalat s/-f/-s/
22:33 sri that's not the point
22:33 sri i'll make it work if it is needed
22:34 sri just because we can do something doesn't mean we should
22:34 augensalat I need it. I can make it work, if you accept a patch.
22:34 sri everything without a sensible use case is maintenance overhead
22:34 augensalat Come on. It's clearly a bug, isn't it?
22:35 sri as far as i can see it's just not meant to be used like that
22:36 sri this would be a new feature
22:37 augensalat But the handle attribute is there. It is not new.
22:38 sri nowhere in the documentation does it say you can use it like that, you're just making assumptions
22:38 sri really, this is the wrong argument, all you need is a sensible use case
22:40 augensalat OK. Forget it.
22:40 purl augensalat: I forgot it
22:41 sri don't act like i'm unreasonable, all i'm asking for is that if we add something new it should be useful
22:41 xaka augensalat: where your handle comes from? is it part of some external library? why do you link it with Mojo::Asset::File?
22:43 augensalat A handler for serving static files, which has to do a couple of additional permission checks. At the end there is the opened filehandle.
22:49 sri maybe one of the other core devs has an opinion, i'm not convinced
22:51 augensalat one more bug - same place: If the $asset->path eq "0", size is also 0
22:54 gshank joined #mojo
22:54 * augensalat actually has no use-case for filename "0"
22:56 sri nothing makes me lose interest faster than a snarky comment
23:00 metaperl joined #mojo
23:03 chansen__ joined #mojo
23:19 metaperl joined #mojo
23:24 jwang joined #mojo
23:39 jnap joined #mojo
23:40 mire_ joined #mojo
23:46 vervain Coffee or beer... coffee or beer... coffee or beer... oh the humanity!
23:55 sri beer, clearly

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