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

IRC log for #mojo, 2014-01-03

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

All times shown according to UTC.

Time Nick Message
00:01 marty joined #mojo
00:04 gryphon joined #mojo
00:07 howitdo joined #mojo
00:07 whatitdo joined #mojo
00:08 howitdo joined #mojo
00:15 marty joined #mojo
00:19 jberger we've been getting lake-effect snow for days now
00:19 jberger and that is strange for our side of the lake
00:23 jberger I live at the cursor: http://imgur.com/7SVJffX
00:24 * sri humms the x files theme
00:26 jberger not sure its THAT kind of strange ... but sure
01:08 phillipadsmith joined #mojo
01:14 dvinciguerra joined #mojo
01:46 sri neat mongodb text search becomes ->find({'$text' => {'$search' => 'mojo'}})
01:46 sri so it will work with aggregation too
01:56 laouji joined #mojo
02:00 bayashi joined #mojo
02:08 klapperl_ joined #mojo
02:12 d4rkie joined #mojo
02:37 batman jberger: not sure how to get rid of the Makefile :(
02:41 dvinciguerra joined #mojo
02:41 batman i think i made it now.
02:41 batman POSTing upload for Convos-0.3004.tar.gz
03:04 klapperl joined #mojo
03:10 KindTwo joined #mojo
03:18 jberger_ joined #mojo
03:20 phips joined #mojo
03:30 jberger_ batman, it would appear that my install is now hanging in the tests
04:00 laouji joined #mojo
04:09 jberger_ sri: http://pastie.org/8595333
04:09 jberger_ user-built test method references!
04:10 sri jberger_: that's actually a pretty good idea :)
04:10 * jberger_ blushes
04:11 sri all you really need to keep it external is to make {latest} public
04:12 sri could go all mst and do "use Test::Mojo::Deep '$_json_cmp';"
04:13 sri (or just have use Test::Mojo::Deep export $_json_cmp and $_json_message_cmp automatically)
04:14 jberger_ well, the idea I had was to put something like build_test into Test::Mojo, then it doesn't matter how {latest} works, and it handles the test level
04:14 sri biggest problem is to find an accessor name for {latest} ;)
04:15 sri jberger_: yea, that part i don't like too much ;p
04:15 jberger_ basically I'm just exposing _test in a way that doesn't involve monkey patching
04:16 jberger_ then Test::Mojo::Deep could act exactly as you say, the full mst
04:17 sri this methods stored in lexicals thing is still pretty new, supporting it outright would make me uncomfortable as long as idioms have not been established
04:17 jberger_ the idiom is newish, but the handling rather old right?
04:18 sri has there been any mainstream use yet?
04:18 jberger_ I actually wouldn't say that I would recommend a Test::Mojo::Deep exporting scalars right away, these would be things that people would build in their tests
04:18 jberger_ and maybe they wouldn't even be as detailed as the one in my example (ie. optional pointer)
04:20 sri ->or() is kind of annoying... how it gets in the way
04:20 jberger_ ?
04:21 sri with {latest}
04:21 sri how it requires all tests to have a centralized result
04:22 jberger_ not sure that there is a better way to do it
04:22 sri get rid of ->or()
04:22 jberger_ I like ->or
04:22 sri :S
04:23 sri $t->success(...) maybe
04:25 laouji joined #mojo
04:25 sri $t->ok(...)
04:25 sri $t->pass(...)
04:25 jberger_ how would that help diagnose a failed test?
04:26 sri ?
04:26 jberger_ that's what I use ->or for
04:26 sri no... i'm brainstorming accessor names
04:26 jberger_ oh
04:26 jberger_ in that case, success
04:27 jberger_ ok is a Test::More primative
04:27 sri success already exists in a different context though... not sure if it matters
04:27 jberger_ oh transaction success
04:27 jberger_ hrm
04:28 sri http://mojolicio.us/perldoc/Mojo/Transaction#success
04:31 sri haha, adding a success attribute is actually one less line of code and better test coverage
04:32 jberger_ nice
04:32 irq joined #mojo
04:40 preflex_ joined #mojo
04:42 good_news_everyone joined #mojo
04:42 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/WKvt6Q
04:42 good_news_everyone mojo/master 2782efc Sebastian Riedel: added success attribute to Test::Mojo
04:42 good_news_everyone left #mojo
04:42 sri jberger++
04:43 jberger_ sri++
04:43 jberger_ cool
04:44 jberger_ maybe now I should propose a doc patch with an example
04:45 sri i wouldn't mind a small example below the success description... but can you make an example small enough?
04:47 jberger_ sure, let me peek around for a good example
04:48 sri does the methods in lexicals concept have a name yet?
04:49 jberger_ dispatch to a subref?
04:49 sri coderef methods?
04:50 jberger_ its not really a method, its more about defeating the dispatcher
04:50 jberger_ same as a fully qualified method name
04:50 jberger_ s/method/"method"/
04:50 sri it has to accept an invocant, so it's a method
04:51 jberger_ well yeah
04:51 jberger_ but it doesn't go through @ISA dispatch, so there is no inheritance
04:52 jberger_ is that still considered a method?
04:52 * jberger_ nominates mst to name it
04:52 * sri pokes mst with a stick
04:57 jberger_ sri: http://pastie.org/8595479
04:58 jberger_ this is only the minification of my previous example, let me see if I can find a sensible one that doesn't need the other imports
04:59 jberger_ actually I should just do $json_like
05:09 jberger_ sri: http://pastie.org/8595498
05:11 jberger_ "Add your own test methods by using <<insert mst-created pattern name here>>"
05:11 jberger_ method dispatch to a lexical?
05:13 sri oh, that's a pretty huge example
05:13 jberger_ :-/
05:15 jberger_ it can be golfed a bit, the imports can be implied
05:15 sri for a success example it's too big and for a cookbook recipe not elegant enough (not reusable) :S
05:15 sri no other example has a lite app
05:16 sri or imports
05:17 * sri has an idea
05:17 purl know is a silly bot
05:19 jberger_ purl go home, you're drunk
05:19 purl jberger_: i'm not following you...
05:19 sri the simplest i can get away with ;p
05:27 good_news_everyone joined #mojo
05:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/jVbPpQ
05:27 good_news_everyone mojo/master 4e21bba Sebastian Riedel: added custom test example
05:27 good_news_everyone left #mojo
05:27 sri jberger_: what i had in mind
05:28 sri hmm, i guess the ->or is silly ;p
05:29 sri oh i know what to do!
05:29 jberger_ couple problems, isn't the order switched of args to "is" switched?
05:30 jberger_ and $value should be $location
05:30 jberger_ plus you could just do is( ... , $desc || "Location: $location")
05:30 good_news_everyone joined #mojo
05:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/xs4MHA
05:30 good_news_everyone mojo/master 65db1ef Sebastian Riedel: better diagnostics example
05:30 good_news_everyone left #mojo
05:30 mfontani_ joined #mojo
05:31 tianon hahaha
05:31 jberger_ hahaha
05:32 good_news_everyone joined #mojo
05:32 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/1c2Pww
05:32 good_news_everyone mojo/master 07a6454 Sebastian Riedel: fixed typo in custom test example
05:32 good_news_everyone left #mojo
05:34 sri jberger_: maybe your example can be turned into a cookbook recipe
05:36 sri would fit very well into the hacks section if you split it up, open with a Test::Mojo::Deep class maybe that exports subrefs
05:38 good_news_everyone joined #mojo
05:38 good_news_everyone [mojo] jberger pushed 1 new commit to master: http://git.io/Uemc3A
05:38 good_news_everyone mojo/master 75df849 Joel Berger: tweak example
05:38 good_news_everyone left #mojo
05:38 jberger_ sri: I'll work on that
05:38 jberger_ sounds like a useful thing
05:39 sri lol
05:39 sri i was about to commit that
05:39 * sri waves fist
05:39 jberger_ I haven't pushed a commit in a while :-D
05:39 jberger_ NINJA COMMIT!!
05:40 jwang joined #mojo
05:40 sri jberger++
05:41 jberger_ \o/
05:41 jberger_ anyway, off to bed
05:42 jberger_ I like the idea of the open wishlist thread too
05:42 jberger_ been a fun mojo day
05:42 jberger_ o/
05:42 tianon it makes me wish I had better ideas to contribute :)
05:43 tianon the only thing I can think of is something I know has been opposed in the past for very good reasons :)
05:43 jberger_ tianon, read everything mst and tobyink have written and figure out how to port it all to mojo
05:44 tianon hahaha :)
05:48 sri NEVER GO FULL MST
05:48 jberger last thing: sri, something like this might make for a good Mojolicious Hack of the Day
05:49 jberger nn (really)
05:49 * sri demands a cookbook recipe!
05:49 * sri pokes jberger with a stick too
05:49 sri nn
06:35 voegelas joined #mojo
06:43 bowtie_ joined #mojo
06:58 ka2u joined #mojo
07:05 hrupp +
07:10 hellyna joined #mojo
07:19 hellyna hello. i am facing some disambiguities with validation results. sometimes the results from some fields(being assigned to) will appear in some other fields instead.
07:33 hellyna i am typing a pastebin so that'll help you understand more.
07:33 tianon that's an excellent plan :)
07:35 hellyna i have code related to it stewn all over the place... i have to compile them in a pastebin :(
07:38 tianon the smaller your reproducing example, the easier it is for folks to help :)
07:38 tianon (generally speaking)
07:40 Vandal joined #mojo
07:47 hellyna okay.. the paste illustrates something like this http://pastebin.com/AuEAXeSN
07:48 hellyna then, upon dumping the $validation object via $self->dump; sometimes shows something fields shows some result which is not related to it. that only happens on fields that are not checked by ->required
07:49 moritz hellyna: that's not code we can actually run, so only speculation remains
07:50 moritz hellyna: I recommend against iterating with "each"; if something causes the loop to terminate early, the next time it is executed it won't start from the beginnig, but where it left off the previous time
07:53 hellyna http://imgur.com/fNOqxsG <- this is the screenshot part of the dump (die $self->dumper($validation)) you can see the error belongs to participant_home, but it is 'randomly assigned' to participant_dob__year__ instead.
07:54 hellyna moritz: then what should i use? for loop?
07:54 moritz hellyna: yes
07:55 hellyna moritz: didn't know that caveat - the 'resume' behavior
07:55 hellyna thanks for the tip i will change everything to 'for' and see how things go :)
07:56 moritz hellyna: fwiw I have no idea if it will actually fix your problem, but still it's a good idea in general
07:57 hellyna moritz:  thanks :)
08:15 ka2u joined #mojo
08:18 batman i don't get this $ENV{MOJO_MODE} = "testing"; $t = Test::Mojo->new("Convos"); # it's not loading convos.testing.conf - only convos.conf
08:19 batman oh. got it
08:22 batman tempire_: Convos-0.3005 installs at my server at least
08:23 trone joined #mojo
08:30 irq joined #mojo
08:31 arthas joined #mojo
08:34 arthas joined #mojo
08:35 odc joined #mojo
08:44 abra joined #mojo
08:45 basiliscos joined #mojo
09:02 hellyna moritz: do you have to call ->optional explicitly to change the topic for validation?
09:03 hellyna yes you have to. finally found the problem.
09:03 hellyna so $required ? $validation->required($param) : $validation->optional($param);
09:04 batman hellyna: both required() and required() change topic() attribute but it also does more to ready the validation
09:05 batman sorry. not "ready". nevermind that last bit :P
09:05 hellyna batman: i see. because what i was doing earlier was just $validation->required($param) if $required;
09:05 hellyna so ->optional doesn't get called if it isn't required
09:06 batman that sounds really strange. why not just run the validation that you want? it's "if $required" that looks weird to me
09:06 hellyna $required is something i read off my config, .. marking the field as required :)
09:07 hellyna so if the field isn't required ->required doesnt need to be called, but didn't know you ahve to call ->optional explicitly
09:09 hellyna batman: does ->has_error; (without params) check everything? because i am looping explicitly and doing ->has_error($param);
09:10 batman has_error will check if -anything- went wrong
09:10 batman hellyna: having validation in a config file is not a good idea imho. it makes it much harder to test.
09:12 hellyna batman: i see. but the 'thing' i am working on is required to change ever so often that it's best to isolate those changes to those config files.
09:12 hrupp joined #mojo
09:12 batman or...it's just as easy to test, but the config file is probably issue for change.
09:13 batman right. suit yourself.
09:55 S joined #mojo
09:55 S hi
09:57 S i am trying to use mojo in windows box for production
09:57 S but i am not sure its working properly
10:03 dod joined #mojo
10:03 batman S: mojo daemon, morbo, hypnotoad, ..?
10:03 S morbo
10:04 S and also i got confused with an switch in document
10:04 S -w switch in document
10:04 moritz uhm, I hope you're not using morbo for production :-)
10:05 S which is different from command
10:05 S i am using production
10:05 diegok oh!, does anyone use plugin::i18n ?
10:05 diegok looks it has broken our app on last released version 1.2 :-/
10:06 crab you are using (a) morbo, (b) on windows, and (c) in production? really?
10:06 S -c switch is not available in morbo --help
10:06 S but in doc its there
10:06 moritz which doc?
10:06 purl which doc is that in?
10:07 moritz purl: forget which doc?
10:07 purl moritz: I forgot which doc
10:07 S cookbook
10:07 purl somebody said cookbook was http://www.oreilly.com/catalog/perlckbk2/ or on castaway's list to organise ;) or located at http://search.cpan.org/dist/Handel/lib/Handel/Manual/Cookbook.pod or http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod
10:08 S mojolicious.us/
10:08 moritz S: there's more than one cookbook
10:08 moritz S: it would be more helpful if you were a bit more verbose.
10:09 S mojolicious.us/perldoc/Mojolicios/Guides/Cookbook
10:11 S in that ./script/myapp prefork -m production -w10 -c1
10:13 stephan48 diegok: i am using it
10:13 moritz S: I thought you said you were using morbo?
10:14 diegok stephan48: last version does work for you?
10:14 stephan48 hold on i will do the upgrade
10:16 S ok
10:16 diegok stephan48: also, you might be interested, I'll be releasing a lexicon extract plugin soon -> https://github.com/diegok/maketext-extract-plugin-mojo
10:18 diegok ^ I need to do some more testing and docs :)
10:27 S joined #mojo
10:32 S i used the switch in morbo command
10:32 S i feel the document is confusing
10:37 dod joined #mojo
10:37 cfedde_ joined #mojo
10:41 stephan48 cool
10:45 dvinciguerra joined #mojo
10:47 diegok stephan48: looks like tests are not passing on last version... did it broke your app too?
10:48 stephan48 test where passing
10:48 stephan48 seems to work over here
10:54 diegok oh... thank you !
11:14 d4rkie joined #mojo
11:24 marcus jberger: did you get convos up and running?
11:28 stephan48 diegok: what is your problem=
11:29 d4rkie joined #mojo
11:29 diegok stephan48: I've found my problem... what's broken on last version is the usage of url_for('name', { param => $value })
11:29 diegok that we use on one of our apps...
11:30 diegok it was working on previous version of the plugin and it works in mojo without the plugin
11:31 diegok now adding some tests to report to the author.
11:48 stephan48 ah
12:29 cfedde joined #mojo
13:31 sdiz joined #mojo
13:32 sdiz joined #mojo
13:44 dvinciguerra joined #mojo
13:52 sh4 joined #mojo
13:53 denisboyun joined #mojo
14:27 denis_boyun joined #mojo
14:28 asarch joined #mojo
14:33 kej joined #mojo
14:48 denisboyun joined #mojo
14:56 btyler joined #mojo
15:07 marty joined #mojo
15:13 laouji joined #mojo
15:16 paraplexed joined #mojo
15:23 rem_lex|pivo joined #mojo
15:23 marty joined #mojo
15:56 gryphon joined #mojo
16:11 Jonis what triggers the useragent error? http status codes?
16:25 * sri still wonders if the success attribute should have a different name
16:28 Jonis finished?
16:28 purl finished is any language finished?
16:28 marvin joined #mojo
16:28 Jonis Complete, done
16:29 marvin hi guys, could someone give me a tip on how to add "selected" to select_field, which parses array ((a,1),(b,2)) from mysql fetchall_arrayref?
16:30 marvin the database returns '1' in 3rd cell if the row is supposed to be selected in select form, but i don't know how to make it work with mojolicious taghelpers.
16:33 marvin my @arr = (['a',1],['b',2,'selected'],['c',3]);
16:33 marvin this seams to work. is this correct syntax?
16:37 cfedde it would be nice if that behavior was noted in the doc.
16:42 cfedde it looks like it'll take all the bits after the first two and try to turn them into attributes.
16:53 marvin selected="selected"=""
16:54 marvin yeah, i have to pass something like 'selected' => 'selected'
16:57 marvin ok. this worked: select col1,col2,replace(col3,1,'selected'),replace(col3,1,'selected') FROM table
16:59 marvin ... but it' very messy. it outputs <option ="" value="col2">col1</option>
17:00 russum joined #mojo
17:02 sri cfedde: you're welcome to describe the behavior in a sentence and propose that as an addition
17:03 tianon marvin: why are you taking the output from SQL and passing it directly into select_field?  why not do a little parsing to make your life easier?  even a fairly simple map would probably do what you need
17:04 marvin tianon: you might be right.
17:07 marvin i have to go. thanks for your help
17:09 russum1 joined #mojo
17:26 sri for anyone who missed it yesterday... we've decided to encourage this Test::Mojo extension style https://github.com/kraih/mojo/compare/c56a12ad774d585a2d035aa50996d718933e5da1...75df849d184dbd64712e5e8bfa54524b7c1df85a#diff-a3cb567ecd4d756d754d1baee62ee931R419
17:26 sri and jberger still owes us an elegant cookbook recipe :)
17:33 sri although... i'm unsure how Test::Deep + coderef exporting could be elegant...
17:49 paraplexed joined #mojo
17:50 ka2u joined #mojo
18:00 paraplexed1 joined #mojo
18:04 beyondcreed joined #mojo
18:12 abra joined #mojo
18:17 trone joined #mojo
18:20 Foxcool joined #mojo
18:20 irq joined #mojo
18:25 paraplexed joined #mojo
18:28 lucs joined #mojo
18:29 russum joined #mojo
18:33 russum joined #mojo
18:35 denisboyun joined #mojo
18:56 lammel2 joined #mojo
19:05 sri *crickets*
19:07 tianon I think we're all as unsure as you, waiting for Joel to wow us :)
19:07 sri jberger: no pressure
19:08 * marcus puts on the pressure.
19:19 sri too bad perl doesn't have actual singleton methods
19:28 paraplexed joined #mojo
20:09 irq joined #mojo
20:28 basiliscos joined #mojo
20:31 meshl joined #mojo
20:50 r0b3rt joined #mojo
21:17 maxhq joined #mojo
22:42 cfedde does mojo have a way to pretty print xml?
22:52 marty joined #mojo
23:05 marty joined #mojo
23:12 jberger_ joined #mojo
23:17 jberger_ sri: was at work all day
23:18 jberger_ I have a better idea than a coderef in a scalar actually ;-)
23:18 jberger_ Cookbook recipe should be ready some time tonight
23:19 jberger_ First we have to stock up for the freeze-in
23:19 jberger_ Someone should look up the expected real and wind chill temps for Chicago early next week!
23:22 abra_ joined #mojo
23:22 kej joined #mojo
23:38 marcus jberger_: wow, you guys have actual winter *jealous*
23:38 marcus http://www.yr.no/sted/Norge/Oslo/Oslo/Oslo/langtidsvarsel.html  :(
23:44 jberger_ It's been a few years since we've had a winter this cold
23:44 Adura Triple Oslo.
23:57 jnbek^dt joined #mojo

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