Camelia, the Perl 6 bug

IRC log for #mojo, 2013-02-19

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

All times shown according to UTC.

Time Nick Message
00:00 jberger most of the documentation in the individual modules refers only to that module, because it is just an api reference
00:01 jberger this does not mean that you must create your own instances
00:01 jberger the real user guides are the documentation in Mojolicious::Lite and the ::Guides
00:03 al802 thanks jberger, I'll keep this in mind, I was talking the examples to literally.
00:03 jberger yeah, its easy to do
00:04 jberger the key in this case is to notice: https://metacpan.org/module/Mojolicious#sessions
00:04 jberger when you look at the Mojolicious (the class) documentation, that the sessions attribute contains by default an instance of ::Sessions
00:05 jberger so that app->sessions is already populated
00:08 al802 I understand now :)
00:08 marty al802: \o/
00:08 marty jberger++
00:09 jberger glad to help
00:09 al802 thank you again.
00:11 jberger we've all been there at one point or another
00:11 good_news_everyone joined #mojo
00:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/a2​f9a49eca22445b0f0a2977970a9e1d4910715d
00:11 good_news_everyone mojo/master a2f9a49 Sebastian Riedel: added session configuration example
00:11 good_news_everyone left #mojo
00:13 sri is client side SNI broken in the latest IO::Socket::SSL?
00:13 sri https://github.com/kraih/mojo/blob/ma​ster/t/mojo/user_agent_online.t#L209
00:14 sri that test doesn't pass anymore
00:15 bluescreen joined #mojo
00:15 phillipadsmith Howdy… is there a tag helper for the current route?
00:16 jberger current_route?
00:16 phillipadsmith <%= link_for current_route %>
00:16 sri perl -Mojo -E 'my $ua = Mojo::UserAgent->new; my $tx = $ua->get("https://google.de"); say $ua->ioloop->stream($tx->connection)->h​andle->peer_certificate("commonName")'
00:16 sri here's a test case, would be nice if someone could try it from another part of the world
00:16 jberger https://metacpan.org/module/Mojolicious​::Plugin::DefaultHelpers#current_route
00:17 jberger I get *.google.de
00:17 jberger chicago usa
00:17 sri ah
00:17 sri and you have an older version, right?
00:17 jberger hmmm
00:17 sri of IO::Socket::SSL
00:18 jberger oh, I can upgrade
00:18 Molaf_ joined #mojo
00:18 sri it should break when you do
00:18 sri resulting in google.com
00:18 jberger installing 1.84
00:19 jberger *.google.de
00:19 sri Oo
00:20 jberger when I do mojo get google.de its a 301
00:20 jberger are you somehow allowing redirects automatically
00:20 jberger hmmm
00:20 jberger but it only points to www.google.de
00:20 jberger so that shouldn't matter
00:20 jberger I wouldn't think
00:21 sri nope, that isn't it
00:21 al802 london, Fedora 17 i get *.google.de
00:21 * sri has 1.84 too... so it must be a geo thing
00:21 jberger al802, do you have the newest IO::Socket::SSL?
00:21 jberger ok
00:22 jberger is there another site that could demonstrate SNI without being so geo
00:22 sri but why would https://google.de only result in a google.com cert in germany? Oo
00:22 al802 I think I do on that, let me check
00:22 phillipadsmith jberger: maybe I'm misunderstanding what it should do...
00:23 al802 perl-IO-Socket-SSL-1.66-1.fc17.noarch
00:23 phillipadsmith for the route /foo/bar/ it's not even giving me '/foo/bar' is giving 'barname'
00:23 sri sure, i wouldn'd mind another SNI test site, google just seemed like the most constant target
00:24 jberger phillipadsmith, can you prepare a minimal example?
00:24 al802 thnk 1.84 is laterst in koji anyway
00:24 jberger post to gist.github.com or pastie.org or something
00:24 phillipadsmith Will try...
00:24 jberger google is the most tricky though of course
00:24 jberger trying out new things before anyone
00:25 jberger they were the first site I knew that really used geo stuff a lot
00:25 jberger it bit me quite a bit too because somehow it often thought I was in the UK
00:26 jberger always asking if I wanted to use google.co.uk instead
00:26 sri we once used a special SNI test site, but the owner asked us to stop because it put too much load on the site :S
00:26 al802 beware that google.de certificate expires in about 3months
00:26 jberger sri: nice
00:26 jberger that means a lot of interest in mojo eh?
00:27 sri it was pretty weird, those tests are disabled by default :)
00:29 jberger sri: was it https://sni.velox.ch/
00:29 jberger haha
00:29 jberger yeah, cause I found the groups post about it
00:29 jberger :-)
00:30 sri perl -Mojo -E 'my $ua = Mojo::UserAgent->new; my $tx = $ua->get("https://google.co.uk"); say $ua->ioloop->stream($tx->connection)->h​andle->peer_certificate("commonName")'
00:30 sri that doesn't work for me either :S
00:31 al802 works for me
00:31 al802 *.google.co.uk
00:31 jberger if self-signed works, can you host something on the mojolicio.us
00:31 sri i'd rather use real sites
00:32 sri we can have local unit tests for it once server side SNI support is in Mojo::Server::Daemon
00:32 al802 user www.microsoft.com - :)
00:33 jberger actually, microsoft is probably a good choice
00:33 jberger gates is too full of himself to change anything
00:34 al802 it's good because they will also be using 2048bit blah blah too
00:34 al802 but you do need www.
00:35 sri not a good example, www.microsoft.com doesn't require SNI
00:35 al802 What is SNI ?
00:36 al802 Server Name Indication
00:37 jberger how can you tell if its required or not
00:37 al802 so , I don't think good does either?, this is more than mere wild card SSL
00:38 sri by enabling and disabling sni, then compare the results
00:38 sri you get different names usually
00:39 sri https://github.com/kraih/mojo/blob/m​aster/lib/Mojo/IOLoop/Client.pm#L114
00:39 jberger hmmm, can't help you there then
00:39 sri that line is SNI basically
00:39 jberger I'm happy to test other sites if you want though
00:40 sri i found the problem though
00:41 sri SNI is broken in IO::Socket::SSL for os x it seems
00:41 jberger oh
00:41 jberger yeah, linux here
00:41 sri prolly the new SNI detection stuff, someone messed up
00:41 jberger FILE ALL OF THE BUGZ
00:42 al802 maybe verisign have a test site?
00:42 jberger it makes sense that the issuing authorities might have something
00:43 jberger wanna see something kinda ridiculous? https://github.com/jberger/Galile​oSend/blob/master/t/sender.t#L36
00:43 al802 Well they change SSL_verify_mode to PEER from NONE, for me this breaks Net::SMTP::SSL too
00:43 jberger testing the sender side of GalileoSend
00:43 sri perl -MIO::Socket::SSL -E 'say IO::Socket::SSL->new->can_client_sni'
00:43 sri i suspect that's true for you
00:43 jberger 1
00:44 jberger well there's you SKIP: check
00:44 jberger your
00:44 jberger for now at least
00:44 sri ah, OpenSSL 0.9.8r
00:44 sri IO::Socket::SSL disregards everything before 1.0
00:44 sri even though SNI is older
00:44 jberger oh you had an old OpenSSL installed?
00:45 sri default os x
00:45 * jberger checks his
00:45 jberger Installed: 1.0.1c-3ubuntu2
00:46 sri installing a new openssl is pretty much out of the question, the os x version hooks into all kinds of system services (cert management and stuff)
00:46 al802 Another possibility for SNI test solution would be to create our own self signed certs and use localhost
00:47 sri the SNI test case is fine
00:47 sri it's just IO::Socket::SSL that changed
00:47 jberger just add the can_client_sni to SKIP
00:48 sri that doesn't really resolve it, i need to be able to test *all* features
00:48 jberger but it makes no sense to attempt something that cannot succeed, no?
00:49 sri for the time being SNI seems to be unsupported in mojolicious
00:50 jberger doesn't bother me
00:50 jberger I had to look it up too :-)
00:50 sri it's important for interacting with cloud hosting like heroku
00:51 sri when all incoming requests go though the same reverse proxy, SNI is required to find the right cert
00:55 jberger hmmm, guess that is important
00:56 sri anyway, bug report filed
00:59 Akron joined #mojo
01:01 sri Akron: btw. i don't see how RFC3339 support would fit into core currently
01:03 Akron sri: That's okay - I'll go the MojoX way and if html will introduce new crazy datetime stuff, it can be merged. ;)
01:03 Akron sri: Thanks for your answer however.
01:03 * sri nods
01:04 sri i can see it become more interesting with changes in html
01:05 sri fraction of a second is not very well explained in the rfc
01:05 shmuel joined #mojo
01:06 sri guess that means arbitrary precision
01:11 Akron Well - html5 goes pretty much the microformats way, saying: Do what you want. There is a lot of stuff allowed. The granularity thing is usefull as some specs say: We don't support fraction of seconds, offset etc.
01:12 ka2u joined #mojo
01:12 egopro joined #mojo
01:13 Akron sri: Btw. RFC3339 bit me again when reworking the XML generator stuff based on Mojo::DOM I showed you a long time ago. Is now pretty close to release I guess https://github.com/Akron/MojoX-XML .
01:13 Akron I just have to rename it.
01:13 Akron ;)
01:16 * sri vaguely remembers
01:16 Akron We all get older.
01:16 sri i guess MojoX is ok again, i removed the deprecation notice since it had pretty much no effect :)
01:17 sri for my own stuff i just use unrelated cutely names though... like Mango
01:17 sri *cutesy
01:18 Akron Then its MojoX::Date::RFC3339. The XML thing will be renamed to XML::Plumber or something. Not sure yet.
01:18 sri XML::Chef
01:18 hlin joined #mojo
01:18 * sri always connects XML with tag soup ;p
01:20 Akron XML::SwedishChef even.
01:22 Akron I like XML for a lot of stuff. But I really hated XSL-T when I had to do it for work ... Thankfully, never had to do serious stuff with XQuery.
01:25 gryphon joined #mojo
01:41 hlin joined #mojo
01:58 d4rkie joined #mojo
01:59 d4rkie joined #mojo
02:04 mattastrophe joined #mojo
02:06 jpn left #mojo
02:25 Akron bye.
02:40 GabrielVieira jberger: ping
02:40 jberger pong
02:41 GabrielVieira you are Ben van Staveren, right?
02:41 jberger ?
02:41 jberger Joel Berger
02:41 GabrielVieira oops
02:41 GabrielVieira :)
02:41 GabrielVieira sorry
02:41 jberger np
02:41 * jberger didn't think my name was too clever
02:41 jberger :-)
02:42 GabrielVieira :P
02:42 tempire joined #mojo
02:42 GabrielVieira this guy, https://metacpan.org/author/MADCAT/, is online?
02:42 al802 joined #mojo
02:43 al802 sri:
02:43 jberger then again, little did you know that tempire is actually Thomas Empire!
02:43 al802 jberger
02:43 al802 I have my secure cookies working, but I think I found a serious bug
02:44 GabrielVieira jberger: i was confused :) but i was 89% sure that is wasn't you
02:44 jberger GabrielVieira, no one named madcat has ever been on here
02:44 GabrielVieira humm
02:44 al802 basically, I set the cookie as secure and it shows as secure in firefox
02:44 jberger whowas command
02:44 crab no, but ben van staveren used to be here quite often. i forget what his nick was, though.
02:44 al802 then I go to the next page and the cookie is no longer secure
02:44 jberger I did see that he just wrote an article about mango
02:44 moltar joined #mojo
02:44 al802 using live headers the cookie is reset, but this time without secure flag
02:45 jberger al802, I was just commenting on the architecture, I'm not really an expert of the security features, sorry
02:45 GabrielVieira anyone using M::P::Authentication?
02:46 al802 who would be best to deal with this, think is a bug, but need somone to confirm
02:46 GabrielVieira al802: can you show me some code so I could reproduce here
02:46 jberger sri is the one that has final say
02:46 al802 sure 1 sec
02:46 jberger yeah, make a minimal example, that is best
02:46 jberger remember, no pasting in the channel
02:46 jberger gist.github.com is good or pastie.org
02:47 crab how do you set your cookie to secure?
02:48 crab you need to do $app->sessions->secure(1) or so.
02:48 crab so that mojo sets the flag on every cookie
02:48 * sri only trusts test cases, and secure sessions are tested
02:48 jberger crab, from our convo earlier that should be what al802 is doing
02:48 crab sri: trust al802
02:48 crab hey! it's not working!
02:49 geck joined #mojo
02:49 * jberger works on an sri bot
02:49 * sri hides
02:50 jberger sribot build a new PDL from scratch (that works all non-blocking and junk)
02:50 jberger hhmmmm, how long should that take :-P
02:52 al802 ok here is what I do http://mibpaste.com/qctoNE
02:54 * tempire misses purl
02:54 al802 so the cookie is confirmed secure on the initial reponse page, but further pages sets the cookie without the secure bit
02:56 GabrielVieira joined #mojo
02:56 crab well, all i can say is, it works for me.
02:57 crab i just call ->secure(1) unconditionally from startup
02:58 al802 Actually, I think that is the problem, when I set this from the login page, the state gets lost (because the change was within the request)  so it must be done from startup
03:00 crab sri: looking at the new hook order in Mojolicious::dispatch, now the static dispatcher is no longer tried if the before_dispatch hook creates a response already, right?
03:02 sri crab: yea
03:03 sri pretty sure it never was actually
03:03 al802 confirmed, that's the problem
03:03 al802 you must set secure from startup
03:04 TitanOfOld joined #mojo
03:04 al802 I assume this is bacause settings in startup are global to all workers, whereas settings in workers are local
03:06 al802 sorry for the panic! - you can all go back to sleep until next time :)
03:07 preflex joined #mojo
03:10 duncanthrax joined #mojo
03:16 egopro_ joined #mojo
03:23 duncanthrax joined #mojo
03:38 lukep_ joined #mojo
03:56 moltar joined #mojo
03:57 jberger sri: would you accept a patch to ::Command::version to make it more easily subclassable?
03:58 jberger get mojo information as well as other app specific information
04:02 sri jberger: doubt it
04:04 jberger actually the more I think of it, mojo (the command) should provide mojolicious information, and a subclass should just override run
04:04 jberger nm
04:04 sri yea, i'd imagine an app specific version would change basically everything anyway
04:05 jberger I was thinking that one might want to get the mojo info plus the app specific
04:06 jberger in which case the "This version is up to date, have fun" message would be rather misleading if Mojolicious was up to date but the app wasn't
04:06 jberger but I'm rethinking the plan anyway
04:12 sri think i'm generally not in favor of making individual commands more subclassable if there aren't other benefits
04:16 sri things just get messy when subclassing becomes a priority
04:16 sri what i'd rather like to see is more introspection and testability
04:17 al joined #mojo
04:23 jberger yeah, I even gave it a quick try, it gets messy really quickly
04:23 jberger the version check via metacpan come out nicely, but the version report, not so much
04:23 jberger ok nevermind
04:24 jberger anyway, off to bed
04:24 jberger o/
04:27 sri \o
04:32 crab very strange things can happen when a module used in a controller isn't found
04:32 crab e.g. "Action not found in controller" until you restart morbo
04:42 hesperaux Hi all. How do I render an SVG with the appropriate HTTP header?
04:43 hesperaux side question: how do I render an svg from a scalar variable within a page?
04:44 crab side answer: ->render_data($blah)
04:45 crab main answer: $res->headers->header(blah => "foo")
04:46 preflex_ joined #mojo
04:47 hesperaux thanks :)
04:47 crab happy svg-ing!
04:53 hesco I picked up Mojo for first time today (having watched Glen's casts and read a bit about it in the past).  http://mojolicio.us/perldoc/Moj​olicious/Guides/Growing#Testing shows how I can use a Mojo script to run a test which will exercise it.  But I'm wondering if it is somehow possible to integrate my tests with my existing test suite for use with prove and cover?
04:55 crab why not?
04:58 hesco crab: I'm used to running things like so: prove t/*.t; but this page is advising me to run it ./my_mojo_script test t/101-my_mojo_script.t
04:58 hesco No where does my t/101-my_mojo_script.t use or call the path to my my_mojo_script
04:59 hesco If I run it as part of my prove suite when prove gets to that file, however will it know what it is I want to run it against?
05:00 hesco testing it it got my endpoint,
05:01 hesco so I will need to start morbo first to make it available to prove?
05:01 ka2u joined #mojo
05:01 crab hesco: when you do Test::Mojo->new("Appname"), that does the required magic.
05:02 hesco so I need to provide the full path to the Appname, then?
05:03 hesco that gives me: Couldn't find application class
05:03 crab hesco: just make sure you have the path to Appname.pm in @INC
05:04 hesco I've been building lots of back-end Model and View code on this project, but have been sorting out how it is I want to expose the Views.
05:04 crab i.e. use lib 'whatever';, the way your ./my_mojo_script does.
05:04 crab there's no real magic to it. it needs to be able to find the perl module, like any other perl module you use.
05:04 crab use_ok("Appname") might be a good test to add, just to make sure.
05:05 hesco while I want to fold what I'm learning into a module in this code base, so far, I only have a mojo generate app_lite script I'm playing with
05:13 memowe joined #mojo
05:15 rafl joined #mojo
05:18 mfontani joined #mojo
05:19 augensalat joined #mojo
05:19 Foxcool joined #mojo
05:19 ZadYree joined #mojo
05:20 sri joined #mojo
05:20 crab joined #mojo
05:20 plu joined #mojo
05:21 al joined #mojo
05:23 stephan48 joined #mojo
05:31 good_news_everyone joined #mojo
05:31 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/TBaFWA
05:31 good_news_everyone mojo/master 9d054d1 Sebastian Riedel: fixed comment lines in Mojo::Template to cover the whole line
05:31 good_news_everyone left #mojo
05:41 phillipadsmith joined #mojo
05:56 hesco ok, sorted that out with another review of http://mojolicio.us/perldo​c/Mojolicious/Lite#Testing
05:57 hesco prove gives expected behavior, but running test script with perl gives me --help message for some weird reason.
06:03 spleenjack joined #mojo
06:10 hlin joined #mojo
06:22 good_news_everyone joined #mojo
06:22 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ytCf5g
06:22 good_news_everyone mojo/master 495937f Sebastian Riedel: small optimizations
06:22 good_news_everyone left #mojo
06:22 xaka joined #mojo
06:30 good_news_everyone joined #mojo
06:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/o6qwCg
06:30 good_news_everyone mojo/master 6c5b243 Sebastian Riedel: another small optimization
06:30 good_news_everyone left #mojo
06:34 xaka joined #mojo
06:41 dod joined #mojo
06:58 D4RK-PH0ENiX joined #mojo
07:06 Mike-PerlRecruiter_ joined #mojo
07:07 jzawodn joined #mojo
07:12 dod joined #mojo
07:12 fhelmber_ joined #mojo
07:14 Vandal joined #mojo
07:24 egopro joined #mojo
07:26 ladnaV joined #mojo
07:42 ObseLeTe joined #mojo
08:05 hlin joined #mojo
08:05 dod joined #mojo
08:08 dod joined #mojo
08:09 leon joined #mojo
08:13 spleenjack1 joined #mojo
08:13 suy joined #mojo
08:18 dpetrov_ joined #mojo
08:19 ver joined #mojo
08:22 d4rkie joined #mojo
08:26 sherr joined #mojo
09:03 mugenken joined #mojo
09:11 spleenjack joined #mojo
09:12 dod joined #mojo
09:38 lukep joined #mojo
09:45 dhg joined #mojo
09:48 nelio joined #mojo
09:51 daxim joined #mojo
09:59 jpn joined #mojo
10:22 Vandal joined #mojo
10:33 D4RK-PH0ENiX joined #mojo
10:33 HtbaaPi joined #mojo
10:36 dod joined #mojo
10:46 maxhq joined #mojo
10:55 dotan joined #mojo
10:55 ask joined #mojo
10:56 ladnaV joined #mojo
11:04 dotan joined #mojo
11:09 ver joined #mojo
11:32 kitt_vl joined #mojo
11:42 Akron joined #mojo
12:00 SmokeMachine joined #mojo
12:24 bd this is an awesome name for a commit bot
12:33 dod joined #mojo
12:45 ladnaV I'm having trouble with utf8 in test - data from DB in templates have wrong codepage
12:46 ladnaV the app itself have no such problem
12:46 ladnaV how to fix it?
13:11 mst ladnaV: any bug of the form "my tests are doing something different to live" can be fixed by working out -why-, and then making it not different anymore
13:12 mst jberger: perhaps what you really want is to be able to write your own class, and then call 'run' on an instance of the original as well?
13:13 hesco An attempt to run sudo cpanm HTML::FormHandler yields 125 lines in /root/.cpanm/build.log of the form:  Attribute (widget_name_space) does not pass the type constraint because: Validation failed for 'HFH::ArrayRefStr' with value ARRAY(0x....).  I suspect either a bug in HTML::FormHandler, or in its dependency list.  My question is: what can I do to work around it in the mean time?
13:13 lucs joined #mojo
13:28 dhg joined #mojo
13:31 ladnaV mst, I know why - cuz its not an app
13:31 mst ladnaV: that doesn't make any sense.
13:32 mst hesco: run moose-outdated, see if that tells you that you need to upgrade things
13:33 mst ladnaV: the question is: what specific thing about it being "not an app" is changing how your database connection handles utf8?
13:33 ladnaV I don't know
13:33 mst right
13:33 mst so you don't know why. time to debug your code.
13:34 ladnaV I think it Test::Mojo to blame
13:34 mst why do you think that?
13:34 mst what experiment have you done that tells you?
13:35 ladnaV It is the new element
13:36 mst write two small scripts, one that uses Test::Mojo to send a request to the app, and one that doesn't
13:36 mst but otherwise do exactly the same thing
13:36 mst if those behave differently, show us both scripts and maybe we can help you to debug
13:36 ladnaV ok
13:36 mst because currently you're just guessing, which is not a useful debugging strategy
13:42 hesco mst: it answered: MooseX::StrictConstructor, which I just installed and am now trying my original install again
13:50 jberger ladnaV, I can vouch for Test::Mojo and utf8
13:50 jberger Galileo works just fine with utf8 chars (Mojolicious test suite uses them too)
13:51 jberger mst, that is the obvious answer, but ->run prints formatted output and it would show up first
13:51 jberger not first, but separately
13:51 jberger I guess I could put a banner saying "Mojo version says:"
13:51 jberger then "Galileo version says"
13:52 mst or you could patch it to say 'Mojolicious is up to date'
13:52 jberger that was going to be one of my patches
13:53 mst which wouldn't make the code any more complicated
13:53 mst and would make delegation work out fine, AFAICS
13:53 jberger another would be to let you add text to the "Core" heading and the "Optional" heading
13:53 jberger a third would be to make the metacpan call into a method, so you can check the up-to-date status of your own app too
13:54 jberger but yeah, just putting "Mojolicious is up to date" would be a start
13:54 mst there's no reason you can't make the metacpan call into a module
13:54 jberger of course
13:54 jberger I could just copy-paste into my own version module too
13:54 mst and then stick a comment in the original saying "extracted as" and in the extraction saying "extracted from"
13:54 jberger but you know, DRY
13:55 mst there's a balance to be struck between not repeating yourself and not adding extra compatibility requirements to Mojo core
13:56 mst 'DRY' is not in an of itself an unbeatable argument
13:56 jberger of course
13:56 trone Is it possibile give more than 1 name to the same route?
13:56 mst the means I propose allows people to know they may want to patch both
13:57 mst and 'adding a comment' is probably not controversial to sri
13:57 mst whereas the other possibilities you've suggested apparently are
13:57 mst (I make no comment as to whether I agree or disagree; reality is what it is)
14:01 jberger mst, the counter argument is that it makes sense for Galileo::Command::version to only output galileo information
14:02 jberger then you can run mojo version to get mojo information and galileo version to get galileo's
14:02 jberger I think that was sri's point last night
14:02 jberger and once again, this is something I don't have enough will to fight
14:02 jberger which is why I asked what his state of mind on the thing was first
14:03 jberger you never know, he might have said "you know, I've been meaning to make that more subclassable"
14:03 jberger :-)
14:03 jberger as is, I think I will just overload run with my own output
14:03 jberger for now at least
14:04 ObseLeTe joined #mojo
14:04 jberger btw I'm warming to the name pumpkin
14:05 jberger I liked the idea that pumpkin's "advent" calendars could lead up to halloween (I forget which comment thread I read that in)
14:06 jberger I would like at least to see strict as default in pumpkin v1, but I know that's not the fight you are fighting
14:07 jberger just the things that we could do really quickly, tom's unicode recipe, strict/warnings etc
14:07 jberger mst, keep up the good fight, I think we really need this (or something like it)
14:07 jberger you have the clout to lead it
14:07 mst I do have opinions about what the defaults should be
14:08 jberger oh, I know, that was just my $0.02
14:08 mst I'm remaining very quiet about them because if this discussion is allowed to bleed into that, the proposal is stone dead
14:08 jberger probably right
14:08 jberger still, keep up the fight, as I said
14:08 jberger :-)
14:08 jberger PUMPKING'S PERL!
14:08 mst I'm intending to. currently waiting for some private feedback from key influencers
14:09 * jberger smiles
14:12 ladnaV well, I've write 2 scripts which sends requests to app, and they both get the same, correct page
14:12 mst and one of them uses Test::Mojo ?
14:12 ladnaV yes
14:13 mst so now you know your guess was wrong
14:13 ladnaV so I think issue not with get, but with rendering under Test::Mojo
14:13 mst and can try and work out what the real difference is between the working Test::Mojo code and the not working
14:13 mst no
14:13 mst you don't think that
14:13 ladnaV I never suspect GET
14:13 mst you are hypothesising that
14:13 ladnaV look
14:13 mst now you have a hypothesis, you can test it
14:13 mst basic debugging
14:13 judofyr joined #mojo
14:14 Akron trone: No, a new name definition overwrites the old one. name is an attribute. http://search.cpan.org/~sri/Mojolicious-3​.85/lib/Mojolicious/Routes/Route.pm#name
14:14 mst go do that, and once you have two small scripts with one difference, one of which works and one of which doesn't
14:14 mst we can help you work out why so you can fix it
14:15 ladnaV I have UTF8 chars in the template and in DB, the test script got wrong only the one in DB, teplate's is correct
14:15 ladnaV how to test it?
14:15 ladnaV *debug it
14:15 mst as I say - figure out what's different between the Test::Mojo script that works and the one that doesn't.
14:16 ladnaV nothing I guess
14:16 mst ...
14:16 mst there must be something, or they would behave the same way
14:16 mst welcome to being a programmer: your job is to figure out -what- you did differently
14:17 mst if the template's utf8 chars are working fine, I'd look to see if you're setting mysql_enable_utf8/pg_enable_utf8 in one config and not in another
14:17 ladnaV here is the script http://paste.scsys.co.uk/231195
14:18 ladnaV yes, mysql_enable_utf8 is 1
14:18 Akron Maybe the encoding of the testfile is wrong (BOM/no-BOM etc.) And your editor just assumes it's a utf-8 char you are testing against but it is not ...? Test::Mojo imports always utf8 I guess.
14:18 mst are you sure it's 1 in the version that doesn't work?
14:19 mst have you tried doing a Devel::Peek dump of the strings after they come out of the database and before you render them?
14:19 spleenjack joined #mojo
14:20 ladnaV no
14:20 mst well go check both of those.
14:20 mst if it's only the stuff from the db that breaks
14:20 mst you should be debugging the stuff from the db
14:20 mst not the final HTTP response
14:21 mst because once you've found what's different -there- you've almost certainly found the bug
14:21 bluescreen joined #mojo
14:22 moltar joined #mojo
14:22 judofyr ladnaV: you can also check what charset the HTTP response looks like: diag $t->tx->res->content->charset. Test::Mojo will automatically decode the body in content_like using that charset
14:25 dotan joined #mojo
14:25 jberger IIRC Test::Mojo doesn't import utf8, Mojo::Base does
14:25 * jberger checks
14:26 jberger ok, I was right, using Test::Mojo does NOT import utf8 into your scope
14:27 jberger use Mojo::Base -strict; dows
14:27 jberger does
14:27 jberger or use Mojolicious::Lite;
14:27 Akron jberger: Oh - okay. But He tests against Mojolicious::Lite and when he uses it, it's always strict, right?
14:27 jberger yes
14:27 Akron Ah - okay - testing the app directly of course doesn't import anything.
14:28 jberger if the file itself say use Mojolicious::Lite then it should have utf8 pragma
14:28 jberger right
14:28 jberger use Mojo::Base -strict;
14:28 Akron yepp.
14:29 jberger also that only showed up in like 3.40 ish
14:30 nicomen mst: did you see my pm?
14:30 jberger no, it was 3.69: https://github.com/kraih/mo​jo/blob/master/Changes#L143
14:30 jberger late december
14:31 jberger ladnaV, are you using Mojolicious >= 3.69?
14:31 jberger (of course you can still `use utf8;`)
14:31 jberger not its harder to do that in the templates, which is why that came about IIRC
14:32 jberger s/not/but/
14:32 gryphon joined #mojo
14:33 ladnaV jberger, I dont remember
14:33 dod joined #mojo
14:33 jberger mojo version
14:34 ladnaV Mojolicious (3.85, Rainbow)
14:35 jberger ok, and does your test script import any of utf8, Mojolicious::Lite or Mojo::Base -strict?
14:35 dod joined #mojo
14:36 ladnaV jberger, http://paste.scsys.co.uk/231195
14:36 Akron I thought there were to test scripts ...
14:36 Akron I should've followed the whole discussion I guess.
14:36 jberger ok, so yes, you should have utf8 imported then
14:37 Akron ladnaV: You can delete tests => 15, if you are ending with done_testing().
14:37 jberger just a q
14:37 jberger what happens if you omit the first test
14:37 jberger the first content_like test I mean
14:38 Akron Did you check the content-header for the charset encoding?
14:38 ladnaV jberger, utf8 pragma just tells that source in utf8, it have nothing to do with data streams
14:39 jberger correct
14:39 ladnaV so it useless
14:40 jberger but you would have no chance if the test you are checking against wasn't correctly encoded
14:40 jberger knocking down things in order
14:41 Akron Did you try to check against the string directly - without a regex? There can be problems using utf-8 chars in regexes depending on your perl version.
14:41 jberger Now I would say try running the test with MOJO_USERAGENT_DEBUG=1
14:41 ladnaV on fail it prints me whole page in cosole, so I know that its not the issue
14:41 ladnaV ok, I'll repeat again
14:42 ladnaV I have UTF8 chars in the template and in DB, the test script got wrong only the one in DB, teplate's is correct
14:42 ladnaV so encoding of page is correct
14:42 mst so where's the Devel::Peek output from both the test and from other working use of the same code?
14:42 dhg joined #mojo
14:42 ladnaV I'm working on that
14:42 ladnaV they distracting me
14:43 jberger ok, I'll stop
14:45 Akron jberger: He means, you are damn good looking today. :)
14:46 mst ladnaV: then you say "no idea, doing the Devel::Peek thing first" and ignore them until you're done
14:46 mst ladnaV: and then if they still keep complaining I get them into bleeding pieces with a chainsaw
14:49 nelio joined #mojo
14:54 ladnaV ^)
14:58 d4rkie joined #mojo
15:00 jberger btw, I could care less if you listen to me
15:00 jberger but I did just last month chase down a nasty unicode bug in Galileo tests
15:00 sri o/
15:00 jberger which both taught me a lot, and led to improvements to the JSON testing on websockets
15:00 jberger sri: \o
15:01 jberger sri, I was thinking, might it me useful to have `use Test::Mojo` import `Mojo::Base -strict` like Mojolicious::Lite does
15:02 jberger just an idle idea
15:03 * sri wonders how to make this block in Mojo::Template more elegant https://github.com/kraih/mojo/blob​/master/lib/Mojo/Template.pm#L180
15:03 dhg joined #mojo
15:04 dod joined #mojo
15:05 jberger sri: for a start, named captures would help me understand what its doing
15:05 sri can't use named captures as long as we support perl versions where they were broken
15:05 jberger actually, I think I've got it
15:06 jberger its 5.10 right? which (non-dev) versions broke it?
15:07 sri named captures were leaking pretty bad until recently
15:07 jberger oh really?
15:07 jberger well anyway, I think I'm grokking this anyway.
15:07 jberger I just happen to like them is all :-)
15:09 bluescreen joined #mojo
15:09 sri think it was fixed in 5.16
15:11 nicolaas joined #mojo
15:11 nicolaas hi
15:12 nicolaas I get this error when Morbo restarts : Can't open file descriptor 3: Bad file descriptor at C:/strawberry/perl/site/lib/Mojo/IOLoop.pm line 147
15:12 nicolaas how can I fix this ?
15:13 nicolaas (by the way, I fixed my In-App App generation problem : it came from the name of my app ... "Test" made everything go wrong.. weird)
15:14 jberger sri: that block looks fine to me, not sure what else to do with it
15:31 nicolaas and i also get this warn : "after_static_dispatch hook is DEPRECATED in favor of before_routes!!!" but I don't know how to know which plugin "throws" this
15:31 nicolaas is it because of a hook ? a bridge ?
15:35 bjoernfan Are named captures the ~~ thingie? Are you saying you should avoid that in pre-5.16?
15:36 nicolaas mh, I'm sorry ?
15:36 nicolaas I'm running perl 5.14
15:36 nicolaas on windows
15:37 bjoernfan nicolaas: Oh, sorry, that wasn't about your issue. :)
15:37 nicolaas bjoernfan: haha, ok sorry
15:37 bjoernfan nicolaas: I don't think I can help you with that, sorry.
15:48 mire joined #mojo
16:04 Akron bjoernfan: Named captures are named regex groups with <>. ~~ is the smart match operator.
16:18 Britzel joined #mojo
16:29 labrown joined #mojo
16:33 mst OOOOOO
16:33 mst http://trac.nginx.org/nginx/changeset/5073/nginx
16:33 * sri tweeted that yesterday :)
16:34 sri and marcus seems to be running it successfully in production since then
16:49 asarch joined #mojo
16:52 mire joined #mojo
16:58 ka2u joined #mojo
17:01 good_news_everyone joined #mojo
17:01 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/59R4IA
17:01 good_news_everyone mojo/master 9f57b09 Sebastian Riedel: comment tweaks
17:01 good_news_everyone left #mojo
17:07 mugenken sri: where did the eventsource hack of the day go?
17:08 sri to the new blog i suppose
17:09 mugenken ah ok. google has the old url indexed
17:11 xaka joined #mojo
17:21 mike_ joined #mojo
17:22 dod joined #mojo
17:36 mattastrophe joined #mojo
17:48 mire joined #mojo
17:50 phillipadsmith So, I've been getting some advice on speeding up the serving of this Mojolicious app, and the main thing being recommended is using a cache strategy and URL structure for static content, e.g., static.domain.com/<%= $release %>/js/... where $release is some number that increments when those files change.
17:50 phillipadsmith Has anyone done this? Or advise on ways to accomplish something like that?
17:51 phillipadsmith The benefit here, I'm told, is that one can set a very long cache life on those asset paths, like 1 year
18:12 mattastrophe joined #mojo
18:19 inokenty joined #mojo
18:20 inokenty left #mojo
18:23 inokenty joined #mojo
18:29 nelio joined #mojo
18:36 sherr_ joined #mojo
18:40 DaTa joined #mojo
18:51 mattastrophe joined #mojo
19:04 sh4 joined #mojo
19:08 Mike-PerlRecruiter_ joined #mojo
19:12 bjoernfan avenj: Ah, related anyways. Thanks.
19:23 d4rkie joined #mojo
19:24 laidback_01 joined #mojo
19:27 _xaka_ joined #mojo
19:27 BeDa joined #mojo
19:28 dpetrov_ joined #mojo
19:30 xaka joined #mojo
19:43 r0b3rt joined #mojo
19:48 GabrielVieira joined #mojo
19:54 mire joined #mojo
20:12 GabrielVieira What you guys think of using $self->param( %hash ); having the same behavior of setting $self->parm( $_ => $hash{$_} ) for keys %hash; -- this should avoid doing loops to render filled forms with preselected content
20:28 Akron joined #mojo
20:35 lukep joined #mojo
20:49 BeDa joined #mojo
20:51 fotodigital joined #mojo
20:54 rem_lex|pivo joined #mojo
20:54 fotodigital i need a page with continously check a database, i try with timers but render fails
20:55 fotodigital Timer failed: Can't call method "res" on an undefined
20:55 fotodigital value at /usr/local/share/perl/5.10.​1/Mojolicious/Controller.pm line 276
20:56 fotodigital any help idea?
21:00 GabrielVieira can you show us the code you are using?
21:04 fotodigital #!/usr/bin/env perl use Mojolicious::Lite;
21:04 fotodigital use Mojo::IOLoop;
21:04 fotodigital my $numero =10;
21:04 fotodigital use DBI;
21:04 fotodigital my $dbh = DBI->connect("dbi:Pg:dbname=scanner;h​ost=10.39.1.3","postgres","postgres", {AutoCommit=>1}) or di
21:04 fotodigital my @rows =();
21:04 fotodigital #detiene($self);
21:04 fotodigital get '/' => sub  {
21:04 fotodigital my $self = shift;
21:04 ask In my application (not in my tests, grrh) some of my non-blocking Mojo::UserAgent calls returns "Premature connection close" ~immediately.
21:04 fotodigital #                  if (1 >0)
21:04 fotodigital #                    {
21:04 fotodigital say ' escribe principal ';
21:04 fotodigital #                                    $self->select ;
21:04 ask is that because my ua is going out of scope or something?
21:04 fotodigital #                                 my $rows = $self->select;
21:04 fotodigital #                                    $self->stash( rows => $rows );
21:04 fotodigital was kicked by sri: fotodigital
21:04 sri that was manually -.-
21:05 sri perhaps i should activate the autokick script again
21:06 fotodigital joined #mojo
21:06 sri please don't ever paste into an irc channel
21:07 ask phillipadsmith: I like using the git blob version or an md5 as the "release" number in the path or as part of the filename.
21:07 fotodigital ahh ok , i'am a newbie here
21:08 phillipadsmith ask: interesting… that's what I was kind of wondering about. Do you have an automated way of doing that?
21:09 ask phillipadsmith: not in Mojo, but this generates that data (versions etc) for the perl.org sites and some other sites: https://github.com/abh/combust/blob/m​aster/bin/deploy/static_version_cache
21:09 ask it makes a storable and a json file.
21:09 ask there's some support for concatenating files, too.
21:10 phillipadsmith ask: I'll have a look, thanks! :)
21:10 ask the static_url method here - https://github.com/abh/combust/blob​/master/lib/Combust/StaticFiles.pm - does the "what filename should I use?" logic, so in the templates you call c.static_url("/js/some/file.js")
21:10 ask and it'll make the url http://static.example.com/js/some/file.v123.js
21:11 sri that's generally called an asset pipeline these days
21:11 sri https://gist.github.com/kraih/3927875 # i'm still waiting for someone to turn this proof of concept into a plugin
21:11 ask phillipadsmith: and the controller code -- https://github.com/abh/combust/blob/ma​ster/lib/Combust/Control/Basic.pm#L67
21:12 ask phillipadsmith: a mojo plugin of all that would be useful if someone was to make it. ;-)
21:12 phillipadsmith :)
21:12 sri at least 3 people have started working on asset pipelines for mojolicious
21:12 sri nothing has been released so far though
21:13 ask sri: hopefully someone will finish one, too. :-)
21:13 ask sri: did you see my Mojo::UserAgent question above?
21:14 sri ask: don't see any questions
21:15 ask In my application (not in my tests, grrh) some of my non-blocking Mojo::UserAgent calls returns "Premature connection close" ~immediately. is that because my ua is going out of scope or something?
21:15 sri no clue
21:16 ask ok, "not hitting obvious doing-it-wrong" is useful feedback, I'll try to get something to fail that I can gist.
21:17 xaka joined #mojo
21:19 ask sri: eh, in my tests I use Mojo::IOLoop->delay's; but in my real code I just call $ua->get("http://example.com" => $callback) -- do I need to use delays always?
21:30 dhg joined #mojo
21:45 ask (update: I was, of course, missing a parameter somewhere else in my code so I wasn't actually calling the non-blocking version -- arrgh!)
21:46 ask stupid abstractions. :-) I've been programming too much Go lately.
21:51 BeDa joined #mojo
21:53 ObseLeTe joined #mojo
22:15 jberger sri: I wish I had more tuits, I would package that as a plugin
22:15 jberger its just needs tests and doc right?
22:15 jberger but that will have to wait until after my defense
22:35 GabrielVieira joined #mojo
22:36 good_news_everyone joined #mojo
22:36 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/S5xYHg
22:36 good_news_everyone mojo/master 87eff01 Sebastian Riedel: fixed small domain detection bug in Mojo::UserAgent::CookieJar
22:36 good_news_everyone left #mojo
22:37 sri jberger: it's just a proof of concept, it needs to be redesigned from scratch imo
22:37 jberger well then thats definitely going to have to wait :-)
22:39 jpn joined #mojo
22:39 sri at some point i would really like to have an asset pipeline in core
22:40 sri but so far, there aren't even any candidates
22:40 sri there were many problems to be solved, i posted quite a few to the mailing list
22:44 marty having an asset pipeline in core would be very useful me thinks.
22:48 jpn_ joined #mojo
22:53 good_news_everyone joined #mojo
22:53 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/l7BXLA
22:53 good_news_everyone mojo/master 6ccd730 Sebastian Riedel: added SPONSORS section
22:53 good_news_everyone left #mojo
22:54 asarch joined #mojo
23:05 buu So um, I'm getting this error with the latest version of Mojo::ByteStream:
23:05 buu syntax error at ByteStream.pm line 21, near "Mojo::Util::monkey_patch __PACKAGE__"
23:05 buu This appears to be the correct code from 3.85; but it's erroring on my perl 5.14
23:08 sri must be you, no fails from cpantesters
23:09 robinsmidsrod joined #mojo
23:09 buu Um.
23:10 buu The first error is Subroutine Mojo::ByteStream::has redefined at /usr/local/share/perl/5.14.2/Mojo/Base.pm line 41.
23:10 buu Well, warning.
23:12 good_news_everyone joined #mojo
23:12 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/d-N-ag
23:12 good_news_everyone mojo/master 00e726a Sebastian Riedel: link to Perl Foundation
23:12 good_news_everyone left #mojo
23:13 buu Oh I bet I know what's going on
23:24 buu Clearly all I needed was to be told it was my fault =]
23:26 BeDa joined #mojo
23:27 sri glad i could help :)
23:34 zivester joined #mojo

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