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

IRC log for #mojo, 2015-05-24

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

All times shown according to UTC.

Time Nick Message
00:10 nf joined #mojo
00:30 henq_ joined #mojo
00:54 absolut_todd joined #mojo
00:56 fhelmber_ joined #mojo
01:01 tempire padre isn't the ugliest ide
01:01 tempire but it's on that side of the scale
01:01 tempire maybe ugly is the wrong word
01:01 tempire old school
01:01 purl get off darkuncle's damn lawn or I'll beat you with a vampire tap
01:45 jb360 joined #mojo
01:48 klapperl_ joined #mojo
01:52 henq_ joined #mojo
01:59 henq joined #mojo
02:43 asarch joined #mojo
02:51 noganex_ joined #mojo
02:56 nf joined #mojo
03:14 basic6_ joined #mojo
03:50 kaare joined #mojo
04:23 mattastrophe joined #mojo
04:37 nf joined #mojo
05:22 * sri plays some more wizard poker
05:45 zivester joined #mojo
06:00 mattastrophe joined #mojo
06:17 polettix joined #mojo
06:21 marmez joined #mojo
06:25 marmez left #mojo
07:32 Vandal31341 joined #mojo
08:01 mattastrophe joined #mojo
08:38 dotandimet joined #mojo
08:42 dod joined #mojo
08:46 dod joined #mojo
08:47 amon joined #mojo
08:54 jasanjun joined #mojo
08:56 jasanjun hi, what's the equivalent template syntax as Python flask's {% macro somefunc() %} in mojo?
08:57 ToApolytoXaos joined #mojo
08:57 jasanjun begin / end blocak can't share between template files ,so how can I define a macro in a template and use it in another template ?
09:00 kaare joined #mojo
09:20 nf joined #mojo
09:21 ssm jasanjun: would making a "helper" be appropriate? (https://github.com/kraih/mojo/wiki/Working-with-helpers)
09:49 batman joined #mojo
09:53 henq joined #mojo
10:04 henq joined #mojo
10:31 henq_ joined #mojo
10:32 marmez joined #mojo
10:32 marmez left #mojo
10:37 polettix joined #mojo
10:39 nf joined #mojo
11:11 henq joined #mojo
11:13 polettix joined #mojo
11:23 jberger jasanjun: yes, a helper is what you are looking for, presumably one that has render_to_string called
11:42 henq joined #mojo
11:44 howitdo joined #mojo
11:45 sh4 joined #mojo
11:46 dotandimet joined #mojo
11:52 punter joined #mojo
11:55 berov joined #mojo
12:03 nf joined #mojo
12:24 Vandal31341 joined #mojo
12:46 henq joined #mojo
13:00 dotandimet joined #mojo
13:04 nf joined #mojo
13:05 dotandimet joined #mojo
13:19 marmez joined #mojo
13:22 jasanjun jberger: actually I want this (http://jinja.pocoo.org/docs/dev/templates/#import)
13:23 jasanjun defined several macro in a template file, then re-use it in other template
13:26 jasanjun I think helper is a way to define one macro in a template file, not several macro in a template file ?
13:52 PotatoGim^Home joined #mojo
14:05 nf joined #mojo
14:12 gryphon joined #mojo
14:13 zivester joined #mojo
14:17 lluad joined #mojo
14:29 ajr_ joined #mojo
14:31 henq joined #mojo
15:06 nf joined #mojo
15:07 mattastrophe joined #mojo
15:11 mattastrophe1 joined #mojo
15:36 tojo joined #mojo
16:06 nf joined #mojo
16:13 jberger jasanjun: reading that document, I think a helper is exactly what you want
16:13 jberger notice also that the examples shown in that document are all available as helpers already actually
16:25 asarch joined #mojo
16:32 jberger jasanjun: http://pastie.org/10205063
16:32 jberger oh, hmmm, (s)he left
16:33 jberger but again, for completeness there is an input_tag helper built in
16:43 dotandimet joined #mojo
17:08 nf joined #mojo
17:08 dod joined #mojo
17:19 trone joined #mojo
17:33 polettix joined #mojo
17:36 marcus https://github.com/gliderlabs/sigil seems like something we could easily do with mojo::template too.
17:37 marcus (not sure if it makes sense tho)
17:44 lluad We could do something similar pretty easily.
17:44 lluad I don't know if it's something I've ever actually needed, though.
17:44 lluad Maybe replacing some sed hackery in ad-hoc templates.
17:50 mattastrophe joined #mojo
18:07 basic6_ joined #mojo
18:08 nf joined #mojo
18:17 ajr_ joined #mojo
18:27 basic6_ joined #mojo
18:29 kaare_ joined #mojo
19:09 nf joined #mojo
19:15 disputin joined #mojo
19:24 punter joined #mojo
19:31 absolut_todd joined #mojo
20:10 nf joined #mojo
20:13 ajr_ Where in the documentation would I find an explanation of "index_name", please?
20:13 pink_mist wherefrom do you see index_name referenced?
20:14 ajr_ Somebody else's code.
20:14 purl somebody else's code is giving undefined variable warnings and i have to find out why.  but the error is buried 10 levels down in the call stack in a CGI script.  are there any decent tools to make call graphs of perl programs?
20:14 pink_mist well take a look through somebody else's code then, I'd say
20:15 ajr_ In other words, it's not a Mojo concept?
20:15 pink_mist I don't know
20:15 pink_mist I've not seen it myself at least
20:27 mst ajr_: so you've found a random method in a random file and haven't even tried checking what it's being called on, and we're supposed to know what it is?
20:28 mst ajr_: what happens when you e.g. 'warn Dumper($whatever_youre_calling_it_on);' ?
20:28 mst or did debugging this not occur to you? :D
20:29 ajr_ I'm trying to RTFM before plunging into debugging. If somebody can tell me it's not a Mojo concept, then I don't waste time looking for something that's not there.
20:34 mst ajr_:
20:34 mst ajr_: http://paste.scsys.co.uk/482379
20:34 mst ajr_: you could've confirmed that in five seconds the same way I did
20:34 mst ajr_: now will you please stop -actually- wasting your time and ours, and try actually debugging it?
20:35 mst of course if you're using an older version of mojo
20:35 mst you'll have to ack your own
20:35 mst but, really, figuring out the class of the object
20:35 mst is the first step to knowing where the concept's from
20:35 mst and you still don't seem to've done that
20:37 jberger ack is good, Data::Printer can also give you clues sometimes about methods
20:38 jberger oh, hmmmm, I wonder if anyone has made a filter for mojolicious :P
20:38 bpmedley ajr_: Can you give some context?
20:41 ajr_ A number of the modules at the head of paths have a line at the beginning "has index_name => 'somevalue'
20:42 ajr_ (Moo is involved)
20:42 bpmedley ajr_: Would you show the code?
20:42 ajr_ How much do you need?
20:42 bpmedley Dunno.. :)  Maybe 15-20 lines?
20:43 ajr_ If it's not a standard Mojo feature, I don't want to waste anyone's time.
20:43 ajr_ s/feature/concept/
20:44 ajr_ Now I have to look up "ack" as well. :-)*
20:44 bpmedley I have lots of time right now; I don’t mind.  However, I would need context (and code) to know if it’s a Mojo feature.  Seems doubtful given mst’s commmand, tho.
20:45 ajr_ I suspect this may be enough code:
20:45 ajr_ package Xamman::Web::AdminEvent;
20:45 ajr_ use Mojo::Base qw(Xamman::Web::Base);
20:45 ajr_ has index_name => 'search';
20:45 ajr_ sub search {
20:45 bpmedley Please don’t do that.  Use a paste bin.
20:47 bpmedley ajr_: https://metacpan.org/pod/Moo#has
20:47 bpmedley Woops!  It’s Mojo::Base..
20:48 bpmedley https://metacpan.org/pod/Mojo::Base <— See the attribute creator function “has”.
20:48 bpmedley ajr_: Does that make sense?
20:48 jberger has in both cases declares an attribute
20:48 jberger the type of attribute (or the type of accessors they build) are slightly different but the concept is the same
20:49 jberger Moo vs Mojo::Base
20:49 mst ajr_: uh, so, 'has' is the attribute declaration syntax for Mojo::Base and Moo
20:49 mst ajr_: index_name is just the name of the attribute, unrelated to Mojo
20:49 jberger since you have many classes that declare the same attribute and since they are extending a base class, I would look at the base class to see if that attribute does something
20:49 mst ajr_: perhaps Xamman::Web::Base does something with index_name
20:50 mst ajr_: perhaps 'ack index_name lib' on your lib/Xamman tree would help
20:50 mst ajr_: and I already *proved* index_name isn't a Mojo concept by searching for it in the code tree - ack is a fancy grep -r
20:50 mst ajr_: hence my suggesting checking the class and inheritance
20:50 ajr_ I think I understand the concept of attributes &c. What I wasn't sure was whether it was a Mojo concept.
20:51 mst what?
20:51 mst again: 'has' is an attribute declaration. index_name is the NAME of the attribute
20:51 ajr_ Since it's clearly not, I won't ask for any more help on it here.
20:51 mst ajr_: or you could try doing what I keep suggesting instead of ignoring me, and we could actually help you
20:51 jberger mojo has few if any classes that it expects you to extend AND overload attributes
20:52 mst an attribute name is no more a 'concept' than a particular hash key is
20:52 * mst grumbles, I actually want to help you figure this out, stop making it hard :(
20:52 jberger the only mojo classes that you extend typically are Mojolicious (app), Mojolicious::Controller, Mojolicious::Plugin and Mojolicious::Command
20:53 jberger all of those expect you to implement a method (and perhaps overload a few others possibly), but I don't think any expect you to overload attributes, so in general I can answer (where mst has already shown) that no, not a Mojolicious concept
20:53 ajr_ mst, the answer I was looking for was whether it was a Mojolicious concept. You've answered that, thank you and I am about to lose signwl.
20:54 mst ajr_: I answered it three or four times before you believed me, even :)
20:54 ajr_ jberger, too, thanks.
20:54 mst ajr_: and showed you how to answer the same question yourself next time, which is more useful
20:54 mst grep-like things ftw
20:54 ajr_ True. ack looks useful
20:55 mst if you don't have it, 'grep -r index_name lib/'
20:55 jberger mst/all do any of you have experience with Selenium in practice?
20:55 mst would've produced the same answer
20:55 mst jberger: yes, but SeleniumRC rather than webdriver because I used the IDE
20:55 bpmedley jberger: Yes; and PhantomJS.
20:55 mst being able to have QA people upload IDE scripts to bug reports was so nice
20:55 jberger so, as part of my YAPC talk I'm writing about my PhantomJS module
20:55 bpmedley PhantomJS is awesome.  Screenshots and everything.
20:56 jberger and of course its primary competition for usage is Selenium
20:56 mst I hear better things about Phantom than webdriver
20:56 jberger and I want to argue that my wrapper is easier to use that Selenium
20:56 jberger but of course, I don't actually use Selenium so I want to ask before I sound like an idiot
20:56 bpmedley You’re wrapper being a PhantomJS wrapper?
20:56 jberger yes
20:56 mst bpmedley: OH SHIT LOOK OUT HERE COMES AN S :D
20:57 bpmedley sorry, what?
20:57 mst bpmedley: you meant 'your' :)
20:57 jberger mst: hehe
20:57 bpmedley My grammer is fine.
20:57 bpmedley ;)
20:57 jberger I can indeed be a wrapper
20:57 jberger ANWWAY
20:57 mst there's a famous-ish graphic that says "an apostrophe does not mean oh shit look out here comes an S"
20:57 mst so that's my default response to weird apostrophes
20:58 mst it seems to have better overall outcomes than doing the pedantry directly :)
20:58 jberger in order to use Selenium, in general, do you need to have your app server running and a Selenium server or whatever running too?
20:59 jberger and then your test interacts with selenium which interacts with a browser which interacts with your application/server?
20:59 jberger that is how I understand it anyway
20:59 jberger is that true?
20:59 bpmedley From memory, yes.  It’s not the easiest setup.
20:59 mst certainly the old SeleniumRC worked like that, yes
21:00 mst I have code that fires up xvnc, the server, the browser, etc.
21:00 mst then if a test fails in interactive mode, it pauses so you can go vnc in and poke around
21:00 jberger ok I thought so, and anecdotally I have seen that in talks about Perl/Selenium interfaces
21:00 jberger I just wanted to check
21:00 mst right, for me, the killer feature was macro recording in firefox
21:00 mst if you don't need that, pretty much anything else is better ;)
21:01 jberger I'm pretty sure I've shown mst, but bpmedley this is what I'm on about: https://github.com/jberger/Test-Mojo-Phantom
21:01 bpmedley That’s super sweet.
21:01 jberger which is waiting on Test::Stream being stabilized/released
21:02 jberger but I'm giving a talk on it, released or not
21:11 nf joined #mojo
21:50 Jonis joined #mojo
22:11 nf joined #mojo
22:26 punter joined #mojo
23:12 nf joined #mojo
23:14 mattastrophe joined #mojo

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