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

IRC log for #mojo, 2016-04-26

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

All times shown according to UTC.

Time Nick Message
00:03 tchaves1 joined #mojo
00:04 tchaves joined #mojo
00:07 trwww joined #mojo
00:14 jberger sri: pg backend
00:15 jberger For metacpan
00:16 jberger I spent a lot of time with the metacpan guys this weekend
00:16 jberger Not specifically on minion
00:16 jberger But learning about and helping with metacpan so that i can help with their minion usage layer
00:17 jberger Later
00:17 jberger They are in the middle of a large migration of elasticsearch
00:17 jberger Once that goes in I'll start hacking at more on demand minion enqueuing
00:18 jberger Like when pause reindexes a release
00:19 jberger I did add "cpan river data" integration for neilb
00:20 jberger Which for now is basically totally number of downstream dists by dist
00:20 jberger s/ly//
00:30 bpmedley http://bmedley.org/mojo.pdf <-- MOAR edits and clarifikations
00:31 jasanj_ joined #mojo
00:55 aborazmeh joined #mojo
01:21 asarch joined #mojo
01:34 dvinciguerra joined #mojo
01:37 tchaves1 joined #mojo
02:27 noganex_ joined #mojo
02:42 gizmomathboy joined #mojo
02:48 tchaves joined #mojo
03:02 inbioz joined #mojo
03:30 bpmedley http://bmedley.org/mojo.pdf <-- Is the title page ok?  Can I use that stuff?
03:40 irqq joined #mojo
04:54 Kripton joined #mojo
05:01 inokenty-w joined #mojo
05:02 cpan_mojo Mojo-Sendgrid-0.02 by SADAMS https://metacpan.org/release/SADAMS/Mojo-Sendgrid-0.02
05:05 prajith joined #mojo
05:41 inbioz joined #mojo
05:43 prajith joined #mojo
05:45 prajith joined #mojo
06:23 Vandal joined #mojo
06:29 dod joined #mojo
06:33 dod joined #mojo
07:17 AndrewIsh joined #mojo
07:21 trone joined #mojo
07:35 jasanj_ joined #mojo
07:43 Kripton joined #mojo
07:45 trwww joined #mojo
07:52 sri bpmedley: you can use the raptor with attribution, but not the rainbow
07:52 osfabibisi joined #mojo
07:56 sri bpmedley: if that grows into a real book i can try and make you a cover if you like
07:56 sri like i did for the perl6 book https://github.com/perl6/book/blob/master/src/images/cover.jpg
08:06 sri so, homebrew becomes evil after all :/ https://github.com/Homebrew/brew/issues/142
08:08 sri think what bugs me most is that the discussion never derailed, people just added up/down votes, yet they closed the discussion anyway
08:10 Jonis :(
08:52 Lee_ joined #mojo
09:02 Kripton joined #mojo
09:15 irqq joined #mojo
09:22 sri oh hey, my laptop is now on a plane in shanghai
09:23 tempire woot
09:23 tempire My August lock is on a trust in Indiana
09:23 tempire *truck
09:23 sri your what?
09:23 cpan_mojo MojoX-Renderer-Xslate-0.11 by HJANSEN https://metacpan.org/release/HJANSEN/MojoX-Renderer-Xslate-0.11
09:24 tempire http://august.com/products/august-smart-lock/
09:24 sri ah, cool, never seen those
09:24 sri think i would have trust issues with a smart lock
09:25 tempire The best part is it attaches to your existing deadbolt, so you don't have to worry about someone messing with your cool device from the outside
09:25 sri "DID IT LOCK THE DOOR OR DID IT NOT?!"
09:25 tempire Oh that's the best part!
09:25 tempire You can verify remotely.
09:25 tempire I guess you still have to trust it.
09:50 Jonis tempire: how do you get in if it runs out of battery?
09:51 tempire more battery
09:58 cpan_mojo Mojolicious-Plugin-FormFieldsFromJSON-0.32 by RENEEB https://metacpan.org/release/RENEEB/Mojolicious-Plugin-FormFieldsFromJSON-0.32
10:07 csroli joined #mojo
10:21 Kripton joined #mojo
10:23 bpmedley sri: I updated the title, thx for letter me use the raptor
10:36 punter joined #mojo
10:37 CHYC jabberwok: It's a hack, but $dbh->prepare("$sql") seems to keep $sql intact for me.
10:40 sri bpmedley: it's just the license, the raptor is cc-sa, and all art on the website cc-nc-nd
10:40 dvinciguerra joined #mojo
10:41 bpmedley Hrmm, I can change the license, I guess.. I just copied from some other book license..
10:42 sri no, i mean it's the licenses of the artwork
10:42 sri which dictate what you can and can't do with them atm
10:44 bpmedley I think I understand.  The license of the website is incompatible with my work, at present.  If I change my work so that it's compatible with cc-sa and cc-nc-nd, then could I use the rainbow?
10:44 sri nope, cc-nc-nd is a very restrictive license
10:44 sri you are not allowed to remix it
10:45 bpmedley Gotcha!
10:45 sri it's specific to the website
10:46 sri other artwork like the raptor can be remixed freely, just require attribution
10:47 sri the artwork bundled with mojolicious core is also a very open license to make redistribution easy
10:47 sri but so far only the raptor is really intended for reuse, which is why it is also available in vector format
10:48 bpmedley That's all logical, and makes sense..
10:48 ribasushi interesting...
10:49 ribasushi sri: I for some reason thought the raptor was not to be used on merchandise, was this an earlier set of terms?
10:49 ribasushi ( to be used by 3rd parties )
10:49 sri ribasushi: the attribution requirement kinda prevents most merchandising
10:50 sri but, if you put the copyright below the raptor, sure, you can make your own t-shirts
10:51 sri every now and then people ask me for custom licenses for non-commercial merchandising, like conf shirts, and i always give permission
10:55 sri basically, i just want to keep commercial raptor swag limited to the mojolicious store, but if it's for something non-commercial i don't really care
10:56 sri and i think it has always been cc-sa licensed
10:56 ribasushi it's completely possible I simply misremember
10:59 sri really liked the merit badges brian d foy made http://perltricks.com/images/64/Perl_Nerd_Merit_Badges.jpg
11:05 bpmedley sri: Have you skimmed the book at all?
11:05 sri bpmedley: very briefly, not enough for feedback
11:06 bpmedley Cool.  I've got a lot of edits remaining..
11:07 inbioz joined #mojo
11:13 inbioz joined #mojo
11:19 bpmedley How much of an introduction to Perl, HTML, and HTTP should a book have?
11:20 sri maybe look at what other web framework books are popular and model it on that
11:20 bpmedley Makes sense.  I've looked over a few.
11:59 vicash joined #mojo
12:06 Kripton joined #mojo
12:10 tchaves joined #mojo
12:11 asarch joined #mojo
12:15 kaare joined #mojo
12:18 oliver joined #mojo
12:21 oliver hi folks. may I ask a question about Minion here?
12:24 sri yes
12:26 oliver super, thanks. so I used Mojo::Pg to watch (NOTFIY) for particular jobs coming back, using the ID. but there is of course a race if the job completes before I register the watcher, because I only get the ID after the job is queued.
12:26 oliver I wonder if I have the wrong approach and would appreciate advice, or else I could patch to get an ID from the DB before enquue?
12:29 sri there's no easy way to avoid that race condition
12:30 oliver sri: okay.
12:30 sri you could enqueue into a named queue without worker i suppose, and then retry the job with the real named queue after you've subscribed to the notifications
12:31 oliver oh, cute. I don't mind the overhead of that.
12:32 sri wonder how Minion::Notifier handles the problem
12:32 oliver sri: I did take a look at that, and I don't think it does (with my novice understanding of these things)
12:33 sri jberger: ^^
12:35 oliver I was thinking using pg nextval() to get the ID in advance is surely a recipe for me messing things up, plus the patch to enqueue it would require.
12:36 oliver sri: thanks for the suggestion
12:42 mcsnolte joined #mojo
12:46 gizmomathboy joined #mojo
12:51 asarch joined #mojo
13:00 jberger sri oliver : in minion notifier i have an event that notifies on all jobs as well as events per job
13:01 jberger If you suspect a very short turn around job you should use that
13:01 ramortegui joined #mojo
13:02 jberger Yes the idea of a parking lot queue is a good one
13:02 jberger It is essential to my work on a job manager system
13:03 jberger Hadn't thought to use it in notifier alone though
13:04 jberger I suppose notifier could provide a wrapper method for enqueue that does that pattern
13:15 good_news_everyon joined #mojo
13:15 good_news_everyon [mojo] kraih tagged v6.60 at d754f5d: https://git.io/vw2qA
13:15 good_news_everyon left #mojo
13:16 good_news_everyon joined #mojo
13:16 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vw2mU
13:16 good_news_everyon mojo/master a8d7bd0 Sebastian Riedel: bump version
13:16 good_news_everyon left #mojo
13:16 sri kinda important bug fix
13:18 sri hehe, we're going to need a funny feature for mojolicious 6.66
13:19 sri or we go straight from 6.65 to 7.0 ;p
13:20 bpmedley Perhaps randomly change response headers for 6.66.. :)
13:29 Kripton joined #mojo
13:49 Kripton joined #mojo
14:01 Jonis randomly delete headers for 6.66
14:01 Jonis to get into the spirit of things
14:08 Kripton joined #mojo
14:11 inbioz joined #mojo
14:14 tchaves1 joined #mojo
14:18 nicomen how do I push an element to a Mojo::Collection object?
14:19 sri http://mojolicious.org/perldoc/Mojo/Collection#DESCRIPTION
14:19 jberger nicomen: push @$collection, $value
14:19 jberger nicomen: it is explicitly a blessed arrayref and array operations are expected interface
14:21 oliver jberger: thanks. I would prefer not to listen to all job notifications because in a distributed environment that's a lot of reacting to uninteresting jobs. I was instead only trying to respond to the finished jobs relevant to each processing node. (if that makes any sense)
14:22 oliver jberger: you mention a job manager system ... is this something you're going to release or are working on as open source?
14:22 jberger oliver: yes it would be open once it was ready
14:23 nicomen jberger: ah
14:23 jberger I could put what I have on github I suppose, but I would make NO GUARANTEE on stability
14:23 nicomen jberger: thanks ;)
14:23 oliver jberger: well whilst I'd appreciate that to get an understanding of what you want to achieve, I don't want to make you do additional work :-}
14:24 jberger oliver: all I have at the moment is a proof of concept from when I first joined the company I'm at now
14:24 jberger but before that was useful we decided there was a lot of low hanging fruit in refactoring first
14:24 oliver jberger: okay
14:24 jberger so that code has sat still for the most part
14:24 jberger I extracted Minion::Notifier from it
14:25 oliver jberger: ahh, okay. it's good, we use it :)
14:25 jberger I'm glad
14:25 jberger if you have suggestions about it please let me know
14:25 jberger we use it too but only for limited things
14:26 oliver I'm hoping ot throw together a better web interface for Minion based on a websocket, not only for managing the queue but also troubleshooting and dashboard of the queue for monitoring
14:27 oliver jberger: ah, in fact just realised we're also using your minion_ui from github
14:27 jberger oliver: minion_ui is bpmedley
14:27 oliver oh yes, you forked it
14:27 jberger mine is Minion::Monitor
14:28 jberger oh right
14:28 jberger that was for bpmedley to merge back if he wanted, I can't remember what I did
14:28 oliver I was given the link to your fork so assumed wrongly
14:28 jberger I think it was the plugin arch
14:28 oliver yeah well we'll probably replace that with the websocket thing I just described
14:28 jberger oliver: I'd be interested in working on that with you if you were game
14:29 oliver I'll see what we can release, when we can, and let you know
14:33 Kripton joined #mojo
14:37 bpmedley Oliver: Websockets would be a nice addition.  I'd be happy to replace my polling with a websocket.  I can work on that this week.
14:37 bpmedley Or, do you want to try a new approach with your code?
14:38 oliver bpmedley: actual plan (partly implemented) is to sit swagger2 api in front of Minion and use that as the websocket endpoint
14:39 bpmedley Cool, will you be able to release as open source?
14:39 oliver as I say, we'll see. we also have many plates spinning so I don't know when this bit will get worked on
14:40 jabberwok cheers CHYC that's an easy workaround.  I have traced some and filed https://rt.cpan.org/Ticket/Display.html?id=114000
14:42 Kripton joined #mojo
14:47 sri allright, one final call for votes https://github.com/kraih/mojo-pg/pull/18
14:48 Kripton joined #mojo
14:50 pink_mist jabberwok++ maybe also mention what versions of pg, DBI, DBD::Pg, and perl you're using
14:51 sri jabberwok++
14:51 * pink_mist is completely neutral to #18
14:52 sri don't mind the code of #18 too much, i mostly need opinions on the feature itself
14:52 CHYC Am I allowed to try to sell it here on the channel?
14:52 pink_mist of course you are
14:52 sri you're encouraged to :)
14:57 CHYC Mojo has so many objects to help with everyday things, like Mojo::Dom, Mojo::Date, JSON::PP::Boolean (OK, that's not strictly Mojo). To me it makes sense to provide these objects when expanded.
14:58 CHYC The reason it's customizable is for my own use case of creating NetAddr::IP objects, and the speed benefits of me casting during hashes rather than using a map later will be considerable.
14:59 Kripton joined #mojo
15:00 CHYC Finally, the thorny side of perl not having booleans could be dealt with cleanly, without much effort for the users of Mojolicious.
15:01 Shaeto joined #mojo
15:03 CHYC '$db->query("select to_json(true)")->expand->array' vs '$db->query("select true")->expand->array' . The second should be substantially faster (of the order 100% by my benchmarks)
15:04 tchaves joined #mojo
15:05 jberger to me, the most interesting thing about the Results class doing the coersions is because it hides the type inspection from the users
15:05 pink_mist if you can address the concern about ->expand becoming more complex, I'd probably give you a +1
15:06 jberger CHYC can you make a "simplest thing that can possibly work" version?
15:06 sri jberger: but with pluggable expand the DBD::Pg types become part of our api
15:06 jberger sri: and the fear is that they might change?
15:07 sri especially stuff like "_json" (yes, underscore!) makes me nervous
15:07 jberger hmmmm
15:07 jberger yeah
15:07 jberger I wonder if we can get a comment from the DBD::Pg author about that
15:09 sri some clarification from the DBD::Pg author would certainly help, but i'm not holding my breath ;p
15:09 jberger hmmmm they list f#postgresql as the irc location
15:10 CHYC The pg_types is a documented attribute, even if the types themselves aren't documented.
15:10 CHYC I agree that _json looks worrying.
15:11 Kripton joined #mojo
15:11 sri had you not brought it up in the doc patch, i would never even have known about _json :)
15:11 CHYC sri: ARRRRGGGGGHHHHHH :)
15:12 jberger CHYC: yeah, there's an art to crafting a PR :D
15:12 CHYC Did you try this? http://pastebin.com/VbT79k8P
15:14 * CHYC thinks he's talking his way out of a sale
15:19 jberger sri: I just commented on https://github.com/kraih/mojo/issues/948
15:19 jberger I don't think we really need a vote on that before closing right?
15:20 sri it's a hard decision, on the one hand there's a lot of small issues, like performance, sketchy DBD::Pg api... and on the other hand there's only niche use cases for pluggable expanders, like ip addresses and booleans
15:20 sri jberger: no
15:22 perlpilot CHYC: you can always make a module that monkey-patches Mojo::Pg to your liking.  Once there's enough people using that module, you might have a stronger argument for making it part of Mojo::Pg out-of-the-box
15:22 CHYC The booleans is particularly tricky. On the one hand, render({ json => $something_from_the_db}) may render { is_bool => 1 }, which doesn't look good. On the other hand, making it the default risks breaking backwards compatibility.
15:23 perlpilot (just some thoughts from the peanut gallery of occasional mojo users)
15:24 CHYC perlpilot: I'm not a fan of monkey-patching, and I'm not sure people would buy into a Mojolicious plugin that did it. Saying that, I'm happy to be corrected.
15:24 cfedde call it a mixin then.
15:26 Peppard joined #mojo
15:53 sri CHYC: actually, this one is pretty popular https://metacpan.org/pod/Test::Mojo::Role
15:55 CHYC I guess I stand corrected.
15:58 jberger kindof a special case
15:59 jberger since the use is adding test methods in a composable way
16:00 jberger sri btw that exact namespace I added just so no one stole the namespace :D
16:00 jberger note the complete lack of code
16:00 jberger \o/
16:01 Mikey so say i wanted to print an error in a helper that ends the HTTP request... exits the server context, etc.. is there a simple method that says "send/finish this transaction and send nothing else to the client"?
16:02 Mikey cos it seems like a 500 is overwriting my response even tho i call $c->rendered(200); and call $c->tx->closed; ..  and MOJO_DAEMON_DEBUG=1 shows it's not even trying to send my response
16:04 Mikey (the actual use case is, i have a helper that returns a database handle.  what i want to do is, if it cannot get one, it renders an error page, but not the 500/exception page.. )
16:11 bwf joined #mojo
16:29 Peppard hi... is it possible to add the semicolon as separator for query strings in a clean manner? (currently it seems hardcoded to '&', see https://github.com/kraih/mojo/blob/master/lib/Mojo/Parameters.pm#L84, so i guess i must work around and mess with the raw input or mangle the relevant structures afterwards, is that correct?)
16:31 preaction semi-colons aren't valid seperators anymore, at all
16:32 Peppard why "anymore"? is there any change regarding the W3C recommendation?
16:33 preaction yes. html5 left out semi colons in the url part
16:37 Peppard well, that's bad (i guess), but in my case there is no html involved at all, it's for an api returning xml documents... you might argue that i have no problem with the ampersand then anyways, still the client i'm writing this for is using semicolons, it would probably be hard to change that...
16:40 dotan joined #mojo
16:59 vicash Mikey: you may want to render a custom error page instead of using $c->reply->exception()
17:00 jberger reading through the growing QAH results page I'm reminded that klapperl_ and I discussed a cookbook section about known mojolicious patterns involving weaken: http://act.qa-hackathon.org/qa2016/wiki?node=Results
17:17 sri ouch, that sounds like a nightmare to write
17:25 jberger this was the conversation he was remembering: http://irclog.perlgeek.de/mojo/2015-08-18#i_11073615
17:28 PryMar56 joined #mojo
17:30 jberger A mojo interface to RabbitMQ would be really nice
17:30 jberger (reading back into the mailing list)
17:30 Mikey vicash: yes, but i also want to stop running other code at that point.  like a web equivalent of 'die' ..
17:31 Mikey i might just go low level.. grab the socket, write the request, and close the connection.
17:31 Mikey response*
17:31 sri jberger: is the weaken situation even in a state where we are ready to write about it?
17:32 sri i mean, we still have stuff like https://github.com/kraih/mojo/blob/master/lib/Mojolicious.pm#L125
17:32 jberger I think we are certainly in a stronger position to write about holding strong references rather than weakening other ones
17:33 jberger turning this into some kind of Cookbook section might be a place to start http://mojolicious.org/perldoc/Mojolicious/Plugin/DefaultHelpers#delay
17:34 jberger that helper and its documentation are useful for getting things done
17:34 jberger but it doesn't explain why
17:35 jberger nor would I suggest adding it there, its the wrong place
17:35 jberger could just be a section in http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#REAL-TIME-WEB
17:35 jberger I'll try to give it a think and maybe put something together tonight
17:36 jberger I'll be writing "documents" anyway as I'll be finishing up my QAH blog post
17:39 dod joined #mojo
17:50 Shaeto1 joined #mojo
18:11 Mikey when in rome, i'll just use die.
18:12 irqq joined #mojo
18:13 dod1 joined #mojo
18:15 trone joined #mojo
18:16 Grinnz Mikey, https://metacpan.org/pod/Mojolicious::Guides::Rendering#Rendering-exception-and-not_found-pages (last example)
18:16 Grinnz not exactly what you were asking, but nother way to go about it
18:17 Mikey yeah i thought my approach would be simpler than it was but i got way too deep into the guts and decided to do it that way :)  thanks Grinnz and vicash
18:20 tchaves joined #mojo
18:32 inbioz joined #mojo
18:35 Shaeto joined #mojo
19:01 asarch joined #mojo
19:41 mgrimes /who
19:41 mgrimes oops sorry, errant space
19:52 pink_mist at least it wasn't targetted at someone specific :P
19:52 pink_mist then that person would be wondering wth :P
19:53 genio heh. "YOU DON'T KNOW ME!"
19:55 sri /who pink_mist
19:55 sri oops
19:56 marcus busted :)
20:05 jberger /who jberger
20:06 sri this is getting awkward
20:15 marcus and not in a good way :p
20:24 jnbek joined #mojo
20:32 sivoais joined #mojo
21:29 trwww joined #mojo
21:32 marty joined #mojo
21:34 henq joined #mojo
21:56 jberger https://github.com/PDLPorters/pdl/commit/418b592285dc8c7296e881aff48cdc6ad2b9c8b5
21:56 jberger if we want to prevent the perl 6 file detection
21:57 sri we knew that already ;p
21:58 * jberger must have forgotten
21:58 jberger happened to see it scroll by in #pdl
21:58 jberger sorry for the noise
21:59 genio linguist linguist     linquist?!?
22:00 sri we said we wanted not to do it to put more pressure on github to fix it
22:00 sri yea, that seems to have worked out -.-
22:04 nicomen it could've been worse: http://github.com/github/linguist/issues/435
22:04 good_news_everyon joined #mojo
22:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vwaFe
22:04 good_news_everyon mojo/master 89662d3 Sebastian Riedel: silly GitHub, Perl6 is not a real language
22:04 good_news_everyon left #mojo
22:04 sri trolololo
22:05 Grinnz_ nicomen: damn, I didn't realize there was such a passionate prolog community
22:06 nicomen me neither, but I feel for them
22:06 nicomen did p6 really continue using .pl and .pm ?
22:06 * jberger hopes no one sees that commit message
22:06 jberger "its just a joke people"
22:06 nicomen jberger: heh
22:06 * jberger looks around nervously
22:07 jberger I've had quite enough controversy lately
22:07 jberger mostly due to rurban
22:08 nicomen hehe, was thinking the same
22:08 * jberger heads home
22:08 nicomen jberger: are you going to follow the results tonight, or gave up?
22:09 nicomen wow, https://github.com/github/linguist/issues/2458
22:10 nicomen ah doh
22:10 Grinnz_ nicomen: they actually use .pl6 and .pm6, but I don't know if that's a hard rule
22:11 nicomen is there a reason other than historically to not just use one extension?
22:11 henq http://pastebin.com/dxG8c78g
22:11 henq oops
22:11 good_news_everyon joined #mojo
22:11 good_news_everyon [mojo] kraih force-pushed master from 89662d3 to 19cdf77: https://git.io/BhzC7A
22:11 good_news_everyon mojo/master 19cdf77 Sebastian Riedel: silly GitHub, Perl6 is not a real language :trollface:
22:11 good_news_everyon left #mojo
22:11 sri worth a force push, hahaha
22:12 henq Hello newbie here.  I use Mojolicious::Plugin::Config with no problems in the app package and the controller packages of my none-lite mojo app.  However, I also have a separate ORM hierarchy, and in the model classes I have problems accessing the (same) config file via the plugin. What is the right invocation?
22:12 henq Or maybe related question is: how do I make the app object visible to/in my model classes? Then I could just do app->config;
22:12 henq http://pastebin.com/dxG8c78g   #both plugin invocations in give error.  TIA
22:12 sri now we have trollface in the file list forever, since .gitattributes will never change ;p https://github.com/kraih/mojo
22:13 nicomen henq: IGenerally speaking, 'm not so sure you want to couple your models to a config plugin, but maybe you want to pass in a config on instantiating your models?
22:13 jberger sri: hahaha
22:14 henq for like setting min max values for attributes of my models, default validation messages and so on.
22:14 henq but yeah, on instantiation sounds good
22:16 henq well, second thought, to pass config on each model object instantiation is not very DRY
22:18 nicomen wow didn't know about .ph files
22:18 nicomen henq: true, so you need a model base module, and/or a factory
22:19 nicomen dbix::class does something in those lines, I'm not 100% sure what is the bestest
22:22 henq I am using Rose::Object , it has an DB::object base module, I can make make a new() default behaviour ;  I’ll try to do inject in there. thx
22:23 sri this is kinda the recommended way for managing model classes http://mojolicious.org/perldoc/Mojo/Pg#GROWING
22:24 nicomen Ah, wanted to have a look at Rose::Object last time I investigated ORMs, as DBIx::Class is always so daunting (and after a while you have no control (unless you are a wizard) on what SQLyou end up with), but ended up doing a really thin in-house stupid layer
22:25 nicomen sri++
22:26 pink_mist bpmedley: sorry, I don't have time today to look more into your book; will try it again tomorrow
22:27 sri omg, i made a typo
22:27 henq sri : thx, will study it;  each line of mojo docs is black-hole dense ;-)  wish me luck ;-)
22:28 good_news_everyon joined #mojo
22:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vwaAN
22:28 good_news_everyon mojo/master e635011 Sebastian Riedel: fix a few typos
22:28 good_news_everyon left #mojo
22:28 bpmedley pink_mist: No worries; perhaps give me a few days and I'll hopefully have some more edits.
22:28 henq nicomen: thx
22:28 pink_mist bpmedley: alright, ping me =)
22:28 nicomen sri: ah lol, and I even checked for typos
22:28 nicomen sri--
22:29 sri yea, i screwed that up pretty bad :(
22:29 nicomen well, it was fun as long as it lasted ;D
22:34 trone_ joined #mojo
22:36 trwww joined #mojo
22:38 ajr_ joined #mojo
22:55 sivoais joined #mojo
23:18 Vitrifur joined #mojo
23:20 henq In myApp:DB::Object factory class (Rose) I’d like to access the application-wide config file.  I’ve read the #GROWING and other docs, but I am lost. I’d like to do something like this:  use Mojolicious::Plugin::Config;  Mojolicious::Plugin::Config::->new({file => ‘/path’});   Any concrete suggestions/pointers/code welcome.
23:30 dvinciguerra joined #mojo
23:44 nicomen henq: I think you need to think the other way around. you make for instance a helper (controller-wide) or attr on the app (app-wide), that contains a factory object, and access models from it, for instance:  $myapp->attr( 'model' => sub { MyRose::Factory->new( config => shift->config); ); ... package MyRose::Factory; ... sub get { MyRose::Object->new( type => shift ); } later in a controller somewhere ...
23:44 nicomen ... my $res = $c->model->get('MyType')->method();
23:44 bpmedley henq: http://mojolicious.org/perldoc/Mojolicious/Plugin/DefaultHelpers#config
23:44 nicomen or you could premake all models and put them in a helper/attr too of course
23:48 henq nicomen: i think i understand what you mean. I am not sure if it fits, as the factory in Rose is not a real instantiated object, just a superclass.  I will try it tomorrow, go  to bed now. thx again.
23:51 henq bpmedley: that magic is only available in mojo and controllers and templates, not in separate ORM class, afaik. thx
23:52 bpmedley henq: I was confused.  I only sparsely read what you wrote - there was a lot of code there.
23:52 nicomen henq: ok, tried to look into its docs now, but I couldn't get much sense of it, so I might be saying the whole wrong thing. But I think you need some way of injecting the config into the rose stuff from the outside, and not fetching it from the inside as you want to.
23:52 nicomen -whole
23:57 henq nicomen: i understand what you are saying, but maybe Rose is not suited for that. Creating a new object is something like my $car = Myapp::Models::Car->new;  so a class method. Its very clean, no params. I’d like to keep it that way. Maybe I go the way of the ….. global var    *DraculasCrossShown
23:57 henq ;-)
23:58 henq But I think in perl one can use instance methods too in lieu of clas mothodds, will experiment tomorrow. thx again.

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